summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykhailo Skorokhodov <mykhailo.skorokhodov@globallogic.com>2024-05-05 01:03:59 +0300
committerMarge Bot <emma+marge@anholt.net>2024-05-06 20:55:59 +0000
commit066fc39f45181c30b9b3ee93c17f52763a8e4356 (patch)
treede1125823d8f0cb5f3f705c90337866bb0109e0b
parentc26fc237bbdb9663040a4a6c722c746d9cc556db (diff)
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 <mykhailo.skorokhodov@globallogic.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29052>
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
1 files changed, 3 insertions, 0 deletions
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;