summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2022-11-17 10:12:59 +0100
committerEric Engestrom <eric@engestrom.ch>2022-11-23 19:11:58 +0000
commit9a31d05b011b15ebbc6c241882345408e502b77d (patch)
treee9871b5af29b5a87bf6bff9e365f4cb26f1219a4
parent054a971ecdcfee57640638659cf40e7edf536056 (diff)
downloadmesa-9a31d05b011b15ebbc6c241882345408e502b77d.tar.gz
vulkan/wsi/wayland: Set num_modifier_lists = 0 if num_drm_modifiers == 0
This case was missed in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826 , resulting in native Wayland apps failing with ../src/vulkan/wsi/wsi_common_drm.c:452: wsi_configure_native_image: Assertion `!"Failed to find a supported modifier! This should never " "happen because LINEAR should always be available"' failed. if the Wayland compositor advertises only the INVALID modifier. Fixes: c315e20d6198 ("vulkan/wsi/wayland: Configure images via params passed to wsi_swapchain_init()") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19795> (cherry picked from commit 8d7aa4279aa26e1a24b76b707caf423ecde1d597)
-rw-r--r--.pick_status.json2
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 70c01bd8c18..789b6ea4159 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2254,7 +2254,7 @@
"description": "vulkan/wsi/wayland: Set num_modifier_lists = 0 if num_drm_modifiers == 0",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "c315e20d619849091595450ce416e55369770234"
},
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index 4e3381bcaab..742313f3eb1 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -1836,7 +1836,10 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
if (f != NULL) {
num_drm_modifiers = u_vector_length(&f->modifiers);
drm_modifiers = u_vector_tail(&f->modifiers);
- drm_image_params.num_modifier_lists = 1;
+ if (num_drm_modifiers > 0)
+ drm_image_params.num_modifier_lists = 1;
+ else
+ drm_image_params.num_modifier_lists = 0;
drm_image_params.num_modifiers = &num_drm_modifiers;
drm_image_params.modifiers = &drm_modifiers;
}