Mesa (staging/21.3): vulkan/wsi/wayland: Add modifiers for RGB formats.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 2 21:21:48 UTC 2022


Module: Mesa
Branch: staging/21.3
Commit: 49e088239406db0d550f29680f9ca700f37ba421
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=49e088239406db0d550f29680f9ca700f37ba421

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Tue Jan 18 11:19:34 2022 +0100

vulkan/wsi/wayland: Add modifiers for RGB formats.

These formats get overwritten after the FALLTHROUGH, so no modifers got added
to them at all.

Fixes: 151b65b2119 ("vulkan/wsi/wayland: generalize modifier handling")

Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>
(cherry picked from commit 9843fddffff24a4add73182b909802d2ba74581c)

---

 .pick_status.json                   | 2 +-
 src/vulkan/wsi/wsi_common_wayland.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index a97c2160d87..4e9d422e661 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1300,7 +1300,7 @@
         "description": "vulkan/wsi/wayland: Add modifiers for RGB formats.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "151b65b211907d92f3012997aba12b7dbe004e61"
     },
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index 1a3621277b3..d6649a2e34f 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -294,6 +294,10 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display,
       format = wsi_wl_display_add_vk_format(display, formats,
                                             VK_FORMAT_R8G8B8_UNORM,
                                             true, true);
+      if (format)
+         wsi_wl_format_add_modifier(format, modifier);
+      if (srgb_format)
+         wsi_wl_format_add_modifier(srgb_format, modifier);
       FALLTHROUGH;
    case DRM_FORMAT_ABGR8888:
       srgb_format = wsi_wl_display_add_vk_format(display, formats,
@@ -310,6 +314,11 @@ wsi_wl_display_add_drm_format_modifier(struct wsi_wl_display *display,
       format = wsi_wl_display_add_vk_format(display, formats,
                                             VK_FORMAT_B8G8R8_UNORM,
                                             true, true);
+      if (format)
+         wsi_wl_format_add_modifier(format, modifier);
+      if (srgb_format)
+         wsi_wl_format_add_modifier(srgb_format, modifier);
+
       FALLTHROUGH;
    case DRM_FORMAT_ARGB8888:
       srgb_format = wsi_wl_display_add_vk_format(display, formats,



More information about the mesa-commit mailing list