From 066fc39f45181c30b9b3ee93c17f52763a8e4356 Mon Sep 17 00:00:00 2001 From: Mykhailo Skorokhodov Date: Sun, 5 May 2024 01:03:59 +0300 Subject: [PATCH] egl/wayland: Fix sRGB format look up for config That check should help with situations when the dri2_wl_visual_idx_from_pipe_format function can't recognize pipe_format as before. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10829 Fixes: 6a084e2b("egl/wayland: Use pipe_format to look up configs") Signed-off-by: Mykhailo Skorokhodov Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 76161732216..7d73411e04b 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -170,6 +170,9 @@ static const struct dri2_wl_visual { static int dri2_wl_visual_idx_from_pipe_format(enum pipe_format pipe_format) { + if (util_format_is_srgb(pipe_format)) + pipe_format = util_format_linear(pipe_format); + for (int i = 0; i < ARRAY_SIZE(dri2_wl_visuals); i++) { if (dri2_wl_visuals[i].pipe_format == pipe_format) return i;