Declare AHB blob unsupported in Vulkan

It diverged between old gralloc and minigbm.

Merged-In: If0c1896c6acef97db9ec3ae3abfe88eea333b42f
Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Yahan Zhou 2023-09-14 16:24:26 -07:00 committed by Marge Bot
parent 5781ca340a
commit 8d8540772e

View file

@ -3444,7 +3444,8 @@ VkResult ResourceTracker::on_vkAllocateMemory(void* context, VkResult input_resu
ResourceTracker::threadingCallbacks.hostConnectionGetFunc()->grallocHelper();
const uint32_t hostHandle = gralloc->getHostHandle(ahw);
if (gralloc->getFormat(ahw) == AHARDWAREBUFFER_FORMAT_BLOB) {
if (gralloc->getFormat(ahw) == AHARDWAREBUFFER_FORMAT_BLOB &&
!gralloc->treatBlobAsImage()) {
importBufferInfo.buffer = hostHandle;
vk_append_struct(&structChainIter, &importBufferInfo);
} else {
@ -6496,6 +6497,19 @@ void ResourceTracker::on_vkGetPhysicalDeviceExternalBufferProperties_common(
VkExternalBufferProperties* pExternalBufferProperties) {
VkEncoder* enc = (VkEncoder*)context;
// Older versions of Goldfish's Gralloc did not support allocating AHARDWAREBUFFER_FORMAT_BLOB
// with GPU usage (b/299520213).
if (ResourceTracker::threadingCallbacks.hostConnectionGetFunc()
->grallocHelper()
->treatBlobAsImage() &&
pExternalBufferInfo->handleType ==
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
pExternalBufferProperties->externalMemoryProperties.externalMemoryFeatures = 0;
pExternalBufferProperties->externalMemoryProperties.exportFromImportedHandleTypes = 0;
pExternalBufferProperties->externalMemoryProperties.compatibleHandleTypes = 0;
return;
}
uint32_t supportedHandleType = 0;
#ifdef VK_USE_PLATFORM_FUCHSIA
supportedHandleType |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA;