From 00d0f2bec54fc045d51ffe876e2019e16cfe1647 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 18 Jul 2025 21:20:05 +0000 Subject: [PATCH] nvk: clean up direct u_gralloc dep The u_gralloc fallback backend exists as a best effort attempt and it does log in the Android logcat so can be easily identified if not WAI. So far there's no Vulkan impl in mesa could reasonably work with the fallback backend alone, so if that becomes a real pain, we can exclude it from inside vk_android_get_ugralloc runtime helper. Also drop redundant ANB header. Part-of: --- src/nouveau/vulkan/meson.build | 2 +- src/nouveau/vulkan/nvk_physical_device.c | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/nouveau/vulkan/meson.build b/src/nouveau/vulkan/meson.build index afdaffc9b6f..5897830bcc5 100644 --- a/src/nouveau/vulkan/meson.build +++ b/src/nouveau/vulkan/meson.build @@ -132,7 +132,7 @@ nvk_deps = [ nvk_flags = [] if with_platform_android - nvk_deps += [dep_android, idep_u_gralloc] + nvk_deps += [dep_android] nvk_flags += '-DVK_USE_PLATFORM_ANDROID_KHR' nvk_files += files('nvk_android.c') endif diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index e0fe019c7bd..67bc5493ce3 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -22,11 +22,6 @@ #include "util/disk_cache.h" #include "util/mesa-sha1.h" -#if DETECT_OS_ANDROID -#include -#include "util/u_gralloc/u_gralloc.h" -#endif - #include "vk_android.h" #include "vk_device.h" #include "vk_drm_syncobj.h" @@ -286,8 +281,7 @@ nvk_get_device_extensions(const struct nvk_instance *instance, .EXT_ycbcr_image_arrays = true, .EXT_zero_initialize_device_memory = true, #if DETECT_OS_ANDROID - .ANDROID_native_buffer = vk_android_get_ugralloc() && - u_gralloc_get_type(vk_android_get_ugralloc()) != U_GRALLOC_TYPE_FALLBACK, + .ANDROID_native_buffer = vk_android_get_ugralloc() != NULL, #endif .GOOGLE_decorate_string = true, .GOOGLE_hlsl_functionality1 = true,