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

This aligns the code with the drm format code

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11945>
This commit is contained in:
Dave Airlie
2021-07-19 10:22:09 +10:00
parent fd5fa73e6c
commit 75aa8524ec

View File

@@ -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);
}