Module: Mesa
Branch: staging/22.2
Commit: 78e12c983e4ab5b1fb147b942d418c43ea901741
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=78e12c983e4ab5b1fb147b942d418c43ea901741

Author: Bas Nieuwenhuizen <[email protected]>
Date:   Fri Aug 19 14:17:28 2022 +0200

vulkan/wsi: Take max extent into consideration for modifier selection.

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 <[email protected]>
Reviewed-by: Joshua Ashton <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18139>
(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];
       }
 

Reply via email to