Files
Jeongik Cha 0f4f3852d9 Add a flag for gfxstream to let cached memory pretend as coherent memory
Test: atest --host gfxstream_vkemulatedphysicaldevicememory_tests
Bug: 424729656
Change-Id: If0a3e931d0fc41002deda099dd471ff8a4197714
2025-07-10 23:58:52 +00:00

281 lines
8.3 KiB
Plaintext

// Copyright 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expresso or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package {
default_team: "trendy_team_android_developer_tools",
default_applicable_licenses: ["hardware_google_gfxstream_license"],
}
cc_library_static {
name: "libgfxstream_host_vulkan_server",
defaults: ["gfxstream_host_cc_defaults"],
header_libs: [
"libgfxstream_thirdparty_opengl_headers",
"libgfxstream_host_vulkan_cereal_common",
"libgfxstream_thirdparty_renderdoc_headers",
"libgfxstream_thirdparty_glm",
],
export_header_lib_headers: [
"libgfxstream_thirdparty_renderdoc_headers",
],
whole_static_libs: [
"libgfxstream_host_tracing",
],
shared_libs: [
"liblog",
],
static_libs: [
"gfxstream_host_common",
"libgfxstream_common_base",
"libgfxstream_common_logging",
"libgfxstream_host_backend",
"libgfxstream_host_compressedtextures",
"libgfxstream_host_decoder_common",
"libgfxstream_host_features",
"libgfxstream_host_health",
"libgfxstream_host_iostream",
"libgfxstream_host_library",
"libgfxstream_host_openglesdispatch",
"libgfxstream_host_renderdoc",
"libgfxstream_host_snapshot",
"libgfxstream_host_vulkan_cereal",
"libgfxstream_host_vulkan_emulatedtextures",
],
export_static_lib_headers: [
"libgfxstream_host_decoder_common",
"libgfxstream_host_health",
],
cflags: [
"-fvisibility=hidden",
"-Wno-inconsistent-missing-override",
"-Wno-unused-value",
"-Wno-return-type",
"-Wno-return-type-c-linkage",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wno-unused-function",
"-Wno-uninitialized",
"-Wno-unreachable-code-loop-increment",
],
srcs: [
"BorrowedImageVk.cpp",
"BufferVk.cpp",
"ColorBufferVk.cpp",
"CompositorVk.cpp",
"DebugUtilsHelper.cpp",
"DependencyGraph.cpp",
"DeviceLostHelper.cpp",
"DeviceOpTracker.cpp",
"DisplaySurfaceVk.cpp",
"DisplayVk.cpp",
"PostWorkerVk.cpp",
"RenderThreadInfoVk.cpp",
"SwapChainStateVk.cpp",
"VkAndroidNativeBuffer.cpp",
"VkCommonOperations.cpp",
"VkDecoder.cpp",
"VkDecoderGlobalState.cpp",
"VkDecoderSnapshot.cpp",
"VkDecoderSnapshotUtils.cpp",
"VkEmulatedPhysicalDeviceMemory.cpp",
"VkEmulatedPhysicalDeviceQueue.cpp",
"VkFormatUtils.cpp",
"VkReconstruction.cpp",
"VkUtils.cpp",
"VulkanBoxedHandles.cpp",
"VulkanDispatch.cpp",
"VulkanHandleMapping.cpp",
"VulkanStream.cpp",
],
// http://b/178667698 - clang-tidy crashes with VulkanStream.cpp
// https://android-review.googlesource.com/c/device/generic/vulkan-cereal/+/1560695/
// http://b/255937616 - clang-tidy can take long with VkDecoder.cpp
tidy_disabled_srcs: [
"VulkanStream.cpp",
"VkDecoderGlobalState.cpp", // took more than 400 seconds
"VkDecoder.cpp",
],
export_include_dirs: [
".",
],
}
// Run with `atest --host gfxstream_compositorvk_test`
cc_test_host {
name: "gfxstream_compositorvk_test",
defaults: ["gfxstream_host_cc_defaults"],
header_libs: [
"libgfxstream_host_vulkan_cereal_common",
"libgfxstream_thirdparty_glm",
],
srcs: [
"CompositorVk_unittest.cpp",
],
data: [
"testdata/256x256_android.png",
"testdata/256x256_android_with_transparency.png",
"testdata/256x256_golden_blend_premultiplied.png",
"testdata/256x256_golden_crop.png",
"testdata/256x256_golden_simple_composition.png",
"testdata/256x256_golden_multiple_layers.png",
"testdata/256x256_golden_multiple_targets_0.png",
"testdata/256x256_golden_multiple_targets_1.png",
"testdata/256x256_golden_multiple_targets_2.png",
"testdata/256x256_golden_multiple_targets_3.png",
"testdata/256x256_golden_multiple_targets_4.png",
"testdata/256x256_golden_multiple_targets_5.png",
"testdata/256x256_golden_multiple_targets_6.png",
"testdata/256x256_golden_multiple_targets_7.png",
"testdata/256x256_golden_multiple_targets_8.png",
"testdata/256x256_golden_multiple_targets_9.png",
"testdata/256x256_golden_solid_color.png",
"testdata/256x256_golden_solid_color_above.png",
"testdata/256x256_golden_solid_color_below.png",
"testdata/256x256_golden_transform_none.png",
"testdata/256x256_golden_transform_fliph.png",
"testdata/256x256_golden_transform_flipv.png",
"testdata/256x256_golden_transform_rot90.png",
"testdata/256x256_golden_transform_rot180.png",
"testdata/256x256_golden_transform_rot270.png",
"testdata/256x256_golden_transform_fliphrot90.png",
"testdata/256x256_golden_transform_flipvrot90.png",
],
shared_libs: [
"libbase",
"libgfxstream_backend",
"libgfxstream_common_image",
],
static_libs: [
"libgfxstream_common_logging",
"libgfxstream_host_vulkan_server",
"libgfxstream_host_test_support",
],
test_options: {
// Disabled by default as requires Vulkan.
unit_test: false,
},
test_suites: [
"general-tests",
],
}
// Run with `atest --host gfxstream_vkformatutils_tests`
cc_test_host {
name: "gfxstream_vkformatutils_tests",
defaults: ["gfxstream_host_cc_defaults"],
srcs: [
"VkFormatUtils_unittest.cpp",
],
header_libs: [
"libgfxstream_thirdparty_glm",
],
shared_libs: [
"libbase",
"liblog",
],
static_libs: [
"gfxstream_host_common",
"libgfxstream_common_logging",
"libgfxstream_host_vulkan_server",
"libgtest",
"libgmock",
],
test_options: {
unit_test: true,
},
}
// Run with `atest --host gfxstream_vkemulatedphysicaldevicememory_tests`
cc_test_host {
name: "gfxstream_vkemulatedphysicaldevicememory_tests",
defaults: ["gfxstream_host_cc_defaults"],
srcs: [
"VkEmulatedPhysicalDeviceMemoryTests.cpp",
],
shared_libs: [
"libbase",
"liblog",
],
static_libs: [
"gfxstream_host_common",
"libgfxstream_common_base",
"libgfxstream_common_logging",
"libgfxstream_host_features",
"libgfxstream_host_vulkan_server",
"libgmock",
"libgtest",
],
test_options: {
unit_test: true,
},
test_suites: [
"general-tests",
],
}
// Run with `atest --host gfxstream_vkutil_tests`
cc_test_host {
name: "gfxstream_vkutil_tests",
defaults: ["gfxstream_host_cc_defaults"],
srcs: [
"VkUtilsTests.cpp",
],
shared_libs: [
"libbase",
"liblog",
],
header_libs: [
"libgfxstream_host_vulkan_cereal_common",
],
static_libs: [
"libgfxstream_common_logging",
"libgfxstream_host_vulkan_server",
"libgmock",
"libgtest",
],
test_options: {
unit_test: true,
},
test_suites: [
"general-tests",
],
}
// Run with `atest --host gfxstream_vkguestqueueutils_tests`
cc_test_host {
name: "gfxstream_vkemulatedphysicaldevicequeue_tests",
defaults: ["gfxstream_host_cc_defaults"],
srcs: [
"VkEmulatedPhysicalDeviceQueueTests.cpp",
],
shared_libs: [
"libbase",
"liblog",
],
static_libs: [
"gfxstream_host_common",
"libgfxstream_common_base",
"libgfxstream_host_features",
"libgfxstream_host_vulkan_server",
"libgmock",
"libgtest",
],
test_options: {
unit_test: true,
},
test_suites: [
"general-tests",
],
}