v3dv: drop explicit u_gralloc init

u_gralloc will be initialized upon the initial vk_android_get_ugralloc.

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
This commit is contained in:
Yiwei Zhang 2025-06-16 01:50:49 -07:00 committed by Marge Bot
parent 6d27c16f13
commit edbefeb5b1

View file

@ -240,7 +240,8 @@ get_device_extensions(const struct v3dv_physical_device *device,
.EXT_vertex_attribute_divisor = true,
};
#if DETECT_OS_ANDROID
if (vk_android_get_ugralloc() != NULL) {
struct u_gralloc *gralloc = vk_android_get_ugralloc();
if (gralloc && u_gralloc_get_type(gralloc) != U_GRALLOC_TYPE_FALLBACK) {
ext->ANDROID_external_memory_android_hardware_buffer = true;
ext->ANDROID_native_buffer = true;
}
@ -614,16 +615,6 @@ v3dv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
#if DETECT_OS_ANDROID
struct u_gralloc *u_gralloc = vk_android_init_ugralloc();
if (u_gralloc && u_gralloc_get_type(u_gralloc) == U_GRALLOC_TYPE_FALLBACK) {
mesa_logw(
"v3dv: Gralloc is not supported. Android extensions are disabled.");
vk_android_destroy_ugralloc();
}
#endif
*pInstance = v3dv_instance_to_handle(instance);
return VK_SUCCESS;
@ -682,10 +673,6 @@ v3dv_DestroyInstance(VkInstance _instance,
if (!instance)
return;
#if DETECT_OS_ANDROID
vk_android_destroy_ugralloc();
#endif
VG(VALGRIND_DESTROY_MEMPOOL(instance));
vk_instance_finish(&instance->vk);