diff options
| author | Yilong Li <liyl@google.com> | 2020-09-16 18:46:36 -0700 |
|---|---|---|
| committer | Yilong Li <liyl@google.com> | 2020-09-16 18:51:36 -0700 |
| commit | 452ffebe65e6d0d8db786f16f1adafea466082a4 (patch) | |
| tree | 171eec338e3e304f422134458d22d5ba63c33a2c | |
| parent | e8f712f5d1edd931aa919d6b3857ff1c33891ccf (diff) | |
| download | device_generic_goldfish-opengl-452ffebe65e6d0d8db786f16f1adafea466082a4.tar.gz device_generic_goldfish-opengl-452ffebe65e6d0d8db786f16f1adafea466082a4.tar.bz2 device_generic_goldfish-opengl-452ffebe65e6d0d8db786f16f1adafea466082a4.zip | |
vulkan: Use heap type to determine buffer collection type
Instead of using coherency domain, goldfish should use |heap|
properties to determine the buffer collection type, and reject
all the non-goldfish buffer collections.
TEST=chromium on core.qemu-x64
Change-Id: Ia8d11519f89ce9e880525a188c327dba7cc286dc
| -rw-r--r-- | system/vulkan_enc/ResourceTracker.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp index 03635d55..c20e394f 100644 --- a/system/vulkan_enc/ResourceTracker.cpp +++ b/system/vulkan_enc/ResourceTracker.cpp @@ -1965,10 +1965,15 @@ public: llcpp::fuchsia::sysmem::BufferCollectionInfo_2 info = std::move(result.Unwrap()->buffer_collection_info); - bool is_host_visible = info.settings.buffer_settings.coherency_domain == - llcpp::fuchsia::sysmem::CoherencyDomain::CPU; - bool is_device_local = info.settings.buffer_settings.coherency_domain == - llcpp::fuchsia::sysmem::CoherencyDomain::INACCESSIBLE; + bool is_host_visible = info.settings.buffer_settings.heap == + llcpp::fuchsia::sysmem::HeapType::GOLDFISH_HOST_VISIBLE; + bool is_device_local = info.settings.buffer_settings.heap == + llcpp::fuchsia::sysmem::HeapType::GOLDFISH_DEVICE_LOCAL; + if (!is_host_visible && !is_device_local) { + ALOGE("buffer collection uses a non-goldfish heap (type 0x%lu)", + static_cast<uint64_t>(info.settings.buffer_settings.heap)); + return VK_ERROR_INITIALIZATION_FAILED; + } pProperties->count = info.buffer_count; |
