Control: tag -1 upstream, fixed-upstream patch
Control: forwarded -1 https://gitlab.freedesktop.org/mesa/mesa/-/issues/11360 
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29837

On 14 Jun 2024 13:36:54 +0200 Emilio Pozuelo Monfort <po...@debian.org> wrote:
> Control: reassign -1 mesa 24.1.1-2
> Control: affects -1 kuserfeedback
> Control: retitle -1 mesa: fails to initialize OpenGL on s390x: Unexpected
> format PIPE_FORMAT_X8B8G8R8_SRGB in st_new_renderbuffer_fb
> 
> Actually this looks like a regression in mesa in 24.1. A few rdeps are
> failing their autopkgtests with the same PIPE_FORMAT_X8B8G8R8_SRGB error,
> e.g.:
> 
> https://ci.debian.net/packages/k/kodi/testing/s390x/47675600/
> https://ci.debian.net/packages/o/openscad/testing/s390x/47689316/

This is fixed in upstream commit 5ca85d75c05de9df7c3170122dfdb04bc795b43a
("dri: Fix BGR format exclusion"), which I attached for your convenience.

I haven't tried it as I don't have access to a s390x machine, so if
someone can verify it, that would be most welcome.

Cheers,
  Diederik
>From 5ca85d75c05de9df7c3170122dfdb04bc795b43a Mon Sep 17 00:00:00 2001
From: Daniel Stone <dani...@collabora.com>
Date: Fri, 21 Jun 2024 11:24:31 +0100
Subject: [PATCH] dri: Fix BGR format exclusion
Origin: upstream, https://gitlab.freedesktop.org/mesa/mesa/-/commit/5ca85d75c05de9df7c3170122dfdb04bc795b43a
Bug-Debian: https://bugs.debian.org/1072971

The check we had for BGR vs. RGB formats was testing completely the
wrong thing. Fix it so we can restore the previous set of configs we
expose to the frontend, which also fixes surfaceless platform on s390x.

Signed-off-by: Daniel Stone <dani...@collabora.com>
Fixes: ad0edea53a73 ("st/dri: Check format properties from format helpers")
Closes: mesa/mesa#11360
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29837>
---
 src/gallium/frontends/dri/dri_screen.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c
index 97d11f324ee0b..2e9ce01147a89 100644
--- a/src/gallium/frontends/dri/dri_screen.c
+++ b/src/gallium/frontends/dri/dri_screen.c
@@ -386,17 +386,21 @@ dri_fill_in_modes(struct dri_screen *screen)
       uint8_t msaa_modes[MSAA_VISUAL_MAX_SAMPLES];
 
       /* Expose only BGRA ordering if the loader doesn't support RGBA ordering. */
-      if (!allow_rgba_ordering &&
-          util_format_get_component_shift(pipe_formats[f],
-                                          UTIL_FORMAT_COLORSPACE_RGB, 0)
+      if (!allow_rgba_ordering) {
+          unsigned sh_ax = util_format_get_component_shift(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 3);
+          unsigned sh_b = util_format_get_component_shift(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 2);
 #if UTIL_ARCH_BIG_ENDIAN
-         >
+          unsigned sz_b = util_format_get_component_bits(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 2);
+
+          if (sz_b + sh_b == sh_ax)
+             continue;
 #else
-         <
+          unsigned sz_ax = util_format_get_component_bits(pipe_formats[f], UTIL_FORMAT_COLORSPACE_RGB, 3);
+
+          if (sz_ax + sh_ax == sh_b)
+             continue;
 #endif
-          util_format_get_component_shift(pipe_formats[f],
-                                          UTIL_FORMAT_COLORSPACE_RGB, 2))
-         continue;
+       }
 
       if (!allow_rgb10 &&
           util_format_get_component_bits(pipe_formats[f],
-- 
GitLab

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to