Mesa (staging/21.2): wl/shm: don't fetch formats if not requested.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 6 20:02:10 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 3e228bc8a90972cc40e08f754f24f34c8c95135d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e228bc8a90972cc40e08f754f24f34c8c95135d

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jul 19 10:22:09 2021 +1000

wl/shm: don't fetch formats if not requested.

This aligns the code with the drm format code

Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11959>

---

 src/vulkan/wsi/wsi_common_wayland.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index c5509eb0b6c..40f5338314f 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -418,6 +418,9 @@ static void
 shm_handle_format(void *data, struct wl_shm *shm, uint32_t format)
 {
    struct wsi_wl_display *display = data;
+   if (display->swrast.formats.element_size == 0)
+      return;
+
    wsi_wl_display_add_wl_shm_format(display, &display->swrast.formats, format);
 }
 



More information about the mesa-commit mailing list