From 8efa17cf76e178693bece84b0b6eddbe9fa6c78e Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 20 May 2024 09:29:08 -0700 Subject: [PATCH] egl/android: Fix sRGB visuals The switch to filtering visuals by pipe_format overlooked the corresponding _SRGB formats. Fixes: 273e54391af7 ("egl/android: Remove hard-coded color-channel data") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11182 Signed-off-by: Rob Clark Part-of: (cherry picked from commit 924c5ad2ac9077f7bc4bd1e19ca86946fbd97c3f) --- .pick_status.json | 2 +- src/egl/drivers/dri2/platform_android.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index bb4d849758f..a4d44a8e0e0 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -74,7 +74,7 @@ "description": "egl/android: Fix sRGB visuals", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "273e54391af7e0a89daec778980c3f8a800bcd7b", "notes": null diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index e631418380c..87e647ae706 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -838,7 +838,12 @@ droid_add_configs_for_visuals(_EGLDisplay *disp) const struct gl_config *gl_config = (struct gl_config *) dri2_dpy->driver_configs[j]; - if (gl_config->color_format != visuals[i].pipe_format) + /* Rather than have duplicate table entries for _SRGB formats, just + * use the linear version of the format for the comparision: + */ + enum pipe_format linear_format = + util_format_linear(gl_config->color_format); + if (linear_format != visuals[i].pipe_format) continue; const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;