venus: properly check and fill ahb buffer properties
When it comes to AHB, pExternalBufferInfo->handleType is already
overridden to the renderer handle type. Thus the AHB buffer prop path is
not used. However, this is not caught by cts, vvl or apps because the
host renderer memory features so far satisfy the ahb requirement.
Fixes: ebf0e45506 ("venus: add ahb image and buffer properties query support")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13076>
This commit is contained in:
@@ -2256,6 +2256,9 @@ vn_GetPhysicalDeviceExternalBufferProperties(
|
||||
physical_dev->external_memory.renderer_handle_type;
|
||||
const VkExternalMemoryHandleTypeFlags supported_handle_types =
|
||||
physical_dev->external_memory.supported_handle_types;
|
||||
const bool is_ahb =
|
||||
pExternalBufferInfo->handleType ==
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
|
||||
|
||||
VkExternalMemoryProperties *props =
|
||||
&pExternalBufferProperties->externalMemoryProperties;
|
||||
@@ -2278,8 +2281,7 @@ vn_GetPhysicalDeviceExternalBufferProperties(
|
||||
physical_dev->instance, physicalDevice, pExternalBufferInfo,
|
||||
pExternalBufferProperties);
|
||||
|
||||
if (pExternalBufferInfo->handleType ==
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
|
||||
if (is_ahb) {
|
||||
props->compatibleHandleTypes =
|
||||
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID;
|
||||
/* AHB backed buffer requires renderer to support import bit while it
|
||||
|
||||
Reference in New Issue
Block a user