From cbe4943ae949d6c46222bafacac573c7ea50caed Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Tue, 18 Jan 2022 00:38:10 +0100 Subject: [PATCH] vulkan/wsi/wayland: Fix add_drm_format_modifier aplha/opaqueness. This had the opposite problem of the shm path. R8G8B8A8 was always support if either DRM_FORMAT_XBGR8888 or DRM_FORMAT_ABGR8888 was supported, but we need both. Fixes: d944136f363 ("vulkan/wsi/wayland: don't expose surface formats not fully supported") Signed-off-by: Georg Lehmann Reviewed-by: Simon Ser Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index b9db002ac32..1e37ae32f13 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -298,14 +298,21 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display, wsi_wl_format_add_modifier(format, modifier); if (srgb_format) wsi_wl_format_add_modifier(srgb_format, modifier); - FALLTHROUGH; + + srgb_format = wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_R8G8B8A8_SRGB, + false, true); + format = wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_R8G8B8A8_UNORM, + false, true); + break; case DRM_FORMAT_ABGR8888: srgb_format = wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_R8G8B8A8_SRGB, - true, true); + true, false); format = wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_R8G8B8A8_UNORM, - true, true); + true, false); break; case DRM_FORMAT_XRGB8888: srgb_format = wsi_wl_display_add_vk_format(display, formats, @@ -319,14 +326,20 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display, if (srgb_format) wsi_wl_format_add_modifier(srgb_format, modifier); - FALLTHROUGH; + srgb_format = wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_B8G8R8A8_SRGB, + false, true); + format = wsi_wl_display_add_vk_format(display, formats, + VK_FORMAT_B8G8R8A8_UNORM, + false, true); + break; case DRM_FORMAT_ARGB8888: srgb_format = wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_B8G8R8A8_SRGB, - true, true); + true, false); format = wsi_wl_display_add_vk_format(display, formats, VK_FORMAT_B8G8R8A8_UNORM, - true, true); + true, false); break; }