From 25620f8fcdbfe8cb6381baaed7a56d0a366e952b Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 21 Jun 2024 08:19:04 -0400 Subject: [PATCH] Fix egl on s390x Resolves: RHEL-40876 --- fix-s390x-modes.patch | 34 ++++++++++++++++++++++++++++++++++ mesa.spec | 3 ++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 fix-s390x-modes.patch diff --git a/fix-s390x-modes.patch b/fix-s390x-modes.patch new file mode 100644 index 0000000..9e62f34 --- /dev/null +++ b/fix-s390x-modes.patch @@ -0,0 +1,34 @@ +diff -up mesa-24.1.0/src/gallium/frontends/dri/dri_screen.c.s390x mesa-24.1.0/src/gallium/frontends/dri/dri_screen.c +--- mesa-24.1.0/src/gallium/frontends/dri/dri_screen.c.s390x 2024-06-20 14:57:54.495763904 -0400 ++++ mesa-24.1.0/src/gallium/frontends/dri/dri_screen.c 2024-06-20 15:01:33.555766438 -0400 +@@ -386,17 +386,21 @@ dri_fill_in_modes(struct dri_screen *scr + 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], + diff --git a/mesa.spec b/mesa.spec index 4c54532..5e23d75 100644 --- a/mesa.spec +++ b/mesa.spec @@ -97,7 +97,8 @@ BuildRequires: spirv-headers-devel BuildRequires: spirv-tools-devel BuildRequires: zlib-devel -Patch10: gnome-shell-glthread-disable.patch +Patch: gnome-shell-glthread-disable.patch +Patch: fix-s390x-modes.patch # Build our own version but keep the dependency for the RPM macros BuildRequires: meson