From 78e12c983e4ab5b1fb147b942d418c43ea901741 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Fri, 19 Aug 2022 14:17:28 +0200 Subject: [PATCH] vulkan/wsi: Take max extent into consideration for modifier selection. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For AMD we kinda have some modifiers with a max size ... (Which is really a compositor/kms issue, but getting them to try kinda falls into the unsolved "how to allocate/what pitch to use" bucket, so we solve it on the allocating side) Cc: mesa-stable Tested-by: Michel Dänzer Reviewed-by: Joshua Ashton Part-of: (cherry picked from commit bb2a44432400f6c7613905eceb14c6544687ed1f) --- .pick_status.json | 2 +- src/vulkan/wsi/wsi_common_drm.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index eeeba20eca4..f25adf2f99b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -11425,7 +11425,7 @@ "description": "vulkan/wsi: Take max extent into consideration for modifier selection.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/vulkan/wsi/wsi_common_drm.c b/src/vulkan/wsi/wsi_common_drm.c index a767cb4d549..628715079f7 100644 --- a/src/vulkan/wsi/wsi_common_drm.c +++ b/src/vulkan/wsi/wsi_common_drm.c @@ -400,7 +400,9 @@ wsi_configure_native_image(const struct wsi_swapchain *chain, result = wsi->GetPhysicalDeviceImageFormatProperties2(wsi->pdevice, &format_info, &format_props); - if (result == VK_SUCCESS) + if (result == VK_SUCCESS && + pCreateInfo->imageExtent.width <= format_props.imageFormatProperties.maxExtent.width && + pCreateInfo->imageExtent.height <= format_props.imageFormatProperties.maxExtent.height) info->modifier_props[info->modifier_prop_count++] = info->modifier_props[i]; }