From 8aae7d153d53b0af12610f593a970136c8ddab5c Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 6 Mar 2025 13:31:30 +0100 Subject: [PATCH] panvk: expose VK_KHR_display It seems the common WSI code does all that's really needed here for us already. Enabling this lets me run vkmark on PanVK. This is a bit silly, because what actually happens here is that we end up passing -1 as the display_fd to wsi_device_init(). This in turn leads us to returning zero usable displays, which renders the extension somewhat useless. But it is better than not supporting the extension, and not supporting applications who have a hard depdendency on it fail, like is the case with vkmark. Tested-by: Alexandre ARNOUD Acked-by: Daniel Stone Part-of: --- docs/features.txt | 2 +- docs/relnotes/new_features.txt | 1 + src/panfrost/vulkan/panvk_instance.c | 3 +++ src/panfrost/vulkan/panvk_instance.h | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 679dc80ec3c..9d5219d8f70 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -537,7 +537,7 @@ Khronos extensions that are not part of any Vulkan version: VK_KHR_cooperative_matrix DONE (anv, radv/gfx11+) VK_KHR_depth_clamp_zero_one DONE (vn) VK_KHR_deferred_host_operations DONE (anv, hasvk, lvp, radv, vn) - VK_KHR_display DONE (anv, nvk, pvr, radv, tu, v3dv, vn) + VK_KHR_display DONE (anv, nvk, panvk, pvr, radv, tu, v3dv, vn) VK_KHR_display_swapchain not started VK_KHR_external_fence_fd DONE (anv, hasvk, nvk, panvk, pvr, radv, tu, v3dv, vn) VK_KHR_external_fence_win32 not started diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index 0a15e24b6a6..a7a032914c0 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -18,3 +18,4 @@ VK_KHR_shader_quad_control on panvk/v10+ VK_EXT_device_memory_report on RADV VK_KHR_shader_subgroup_extended_types on panvk/v10+ shaderStorageImageExtendedFormats on panvk +VK_KHR_display on panvk diff --git a/src/panfrost/vulkan/panvk_instance.c b/src/panfrost/vulkan/panvk_instance.c index 10f0ea5f296..40288fd6cd8 100644 --- a/src/panfrost/vulkan/panvk_instance.c +++ b/src/panfrost/vulkan/panvk_instance.c @@ -62,6 +62,9 @@ static const struct vk_instance_extension_table panvk_instance_extensions = { #ifdef PANVK_USE_WSI_PLATFORM .KHR_surface = true, #endif +#ifdef VK_USE_PLATFORM_DISPLAY_KHR + .KHR_display = true, +#endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR .KHR_wayland_surface = true, #endif diff --git a/src/panfrost/vulkan/panvk_instance.h b/src/panfrost/vulkan/panvk_instance.h index f600eef4d24..b72166ac11e 100644 --- a/src/panfrost/vulkan/panvk_instance.h +++ b/src/panfrost/vulkan/panvk_instance.h @@ -29,7 +29,8 @@ enum panvk_debug_flags { #if defined(VK_USE_PLATFORM_WAYLAND_KHR) || \ defined(VK_USE_PLATFORM_XCB_KHR) || \ - defined(VK_USE_PLATFORM_XLIB_KHR) + defined(VK_USE_PLATFORM_XLIB_KHR) || \ + defined(VK_USE_PLATFORM_DISPLAY_KHR) #define PANVK_USE_WSI_PLATFORM #endif