From 943478c94a5a285eff70cfe5db35b5891c53f0c43ef8d4a48c90ee17dd5c0227 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Tue, 25 Jun 2024 11:43:33 +0000 Subject: [PATCH 1/4] Accepting request 1183148 from home:sndirsch:branches:X11:XOrg - u_dri-Fix-BGR-format-exclusion.patch * fixes glxinfo/eglxinfo on s390x (boo#1226725, comment#6) OBS-URL: https://build.opensuse.org/request/show/1183148 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1307 --- Mesa.changes | 6 ++++ Mesa.spec | 4 ++- u_dri-Fix-BGR-format-exclusion.patch | 53 ++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 u_dri-Fix-BGR-format-exclusion.patch diff --git a/Mesa.changes b/Mesa.changes index 3d2662f..71cbead 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 25 11:14:15 UTC 2024 - Stefan Dirsch + +- u_dri-Fix-BGR-format-exclusion.patch + * fixes glxinfo/eglxinfo on s390x (boo#1226725, comment#6) + ------------------------------------------------------------------- Sun Jun 23 00:24:07 UTC 2024 - Soc Virnyl Estela diff --git a/Mesa.spec b/Mesa.spec index 78c0c59..ea115eb 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -1,5 +1,5 @@ # -# spec file for package Mesa +# spec file # # Copyright (c) 2024 SUSE LLC # @@ -183,6 +183,7 @@ Patch54: n_drirc-disable-rgb10-for-chromium-on-amd.patch Patch58: u_dep_xcb.patch Patch100: U_fix-mpeg1_2-decode-mesa-20.2.patch Patch400: n_stop-iris-flicker.patch +Patch500: u_dri-Fix-BGR-format-exclusion.patch %ifarch %{ix86} x86_64 BuildRequires: DirectX-Headers %endif @@ -837,6 +838,7 @@ cp %{SOURCE6} subprojects/packagecache/ %patch -P 58 -p1 %patch -P 100 -p1 %patch -P 400 -p1 +%patch -P 500 -p1 # Remove requires to vulkan libs from baselibs.conf on platforms # where vulkan build is disabled; ugly ... diff --git a/u_dri-Fix-BGR-format-exclusion.patch b/u_dri-Fix-BGR-format-exclusion.patch new file mode 100644 index 0000000..46b1eff --- /dev/null +++ b/u_dri-Fix-BGR-format-exclusion.patch @@ -0,0 +1,53 @@ +From 79ca6e3a329dbfc3bc68df37b8f3ea7156e41aae Mon Sep 17 00:00:00 2001 +From: Daniel Stone +Date: Fri, 21 Jun 2024 11:24:31 +0100 +Subject: [PATCH] dri: Fix BGR format exclusion + +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 +Fixes: ad0edea53a73 ("st/dri: Check format properties from format helpers") +Closes: mesa/mesa#11360 +--- + 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 6bc61dbd641..debff54c090 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], +-- +2.35.3 + From 7d2faa24c207b07137a08b5c36243d21d6041afec3e61b3292bf788b7b14c2ec Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Wed, 26 Jun 2024 08:36:33 +0000 Subject: [PATCH 2/4] - u_egl-gbm-Enable-RGBA-configs.patch, u_egl-surfaceless-Enable-RGBA-configs.patch * these are needed now after applying previous patch u_dri-Fix-BGR-format-exclusion.patch also on other platforms than s390x? (boo#1226725) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1308 --- Mesa.changes | 9 +++++++ Mesa.spec | 4 +++ u_egl-gbm-Enable-RGBA-configs.patch | 29 +++++++++++++++++++++ u_egl-surfaceless-Enable-RGBA-configs.patch | 29 +++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 u_egl-gbm-Enable-RGBA-configs.patch create mode 100644 u_egl-surfaceless-Enable-RGBA-configs.patch diff --git a/Mesa.changes b/Mesa.changes index 71cbead..7af2b4c 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jun 26 08:27:46 UTC 2024 - Stefan Dirsch + +- u_egl-gbm-Enable-RGBA-configs.patch, + u_egl-surfaceless-Enable-RGBA-configs.patch + * these are needed now after applying previous patch + u_dri-Fix-BGR-format-exclusion.patch also on other platforms + than s390x? (boo#1226725) + ------------------------------------------------------------------- Tue Jun 25 11:14:15 UTC 2024 - Stefan Dirsch diff --git a/Mesa.spec b/Mesa.spec index ea115eb..f5f306e 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -184,6 +184,8 @@ Patch58: u_dep_xcb.patch Patch100: U_fix-mpeg1_2-decode-mesa-20.2.patch Patch400: n_stop-iris-flicker.patch Patch500: u_dri-Fix-BGR-format-exclusion.patch +Patch501: u_egl-gbm-Enable-RGBA-configs.patch +Patch502: u_egl-surfaceless-Enable-RGBA-configs.patch %ifarch %{ix86} x86_64 BuildRequires: DirectX-Headers %endif @@ -839,6 +841,8 @@ cp %{SOURCE6} subprojects/packagecache/ %patch -P 100 -p1 %patch -P 400 -p1 %patch -P 500 -p1 +%patch -P 501 -p1 +%patch -P 502 -p1 # Remove requires to vulkan libs from baselibs.conf on platforms # where vulkan build is disabled; ugly ... diff --git a/u_egl-gbm-Enable-RGBA-configs.patch b/u_egl-gbm-Enable-RGBA-configs.patch new file mode 100644 index 0000000..bdfaa4b --- /dev/null +++ b/u_egl-gbm-Enable-RGBA-configs.patch @@ -0,0 +1,29 @@ +From b3904d23ccc76b76d352a160164f293cf65305e0 Mon Sep 17 00:00:00 2001 +From: Daniel Stone +Date: Fri, 21 Jun 2024 14:19:06 +0100 +Subject: [PATCH] egl/gbm: Enable RGBA configs + +Doing this is harmless since we operate on an allowlist of pipe_configs +anyway. + +Signed-off-by: Daniel Stone +--- + src/gbm/backends/dri/gbm_dri.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c +index 0526f4f8dc1..6cc2d5d8197 100644 +--- a/src/gbm/backends/dri/gbm_dri.c ++++ b/src/gbm/backends/dri/gbm_dri.c +@@ -108,6 +108,8 @@ dri_get_capability(void *loaderPrivate, enum dri_loader_cap cap) + switch (cap) { + case DRI_LOADER_CAP_FP16: + return 1; ++ case DRI_LOADER_CAP_RGBA_ORDERING: ++ return 1; + default: + return 0; + } +-- +2.35.3 + diff --git a/u_egl-surfaceless-Enable-RGBA-configs.patch b/u_egl-surfaceless-Enable-RGBA-configs.patch new file mode 100644 index 0000000..5c63f52 --- /dev/null +++ b/u_egl-surfaceless-Enable-RGBA-configs.patch @@ -0,0 +1,29 @@ +From 1eb67fcae01d9f4fbe584e718d71cdfa745ce75f Mon Sep 17 00:00:00 2001 +From: Daniel Stone +Date: Fri, 21 Jun 2024 14:19:06 +0100 +Subject: [PATCH] egl/surfaceless: Enable RGBA configs + +Doing this is harmless since we operate on an allowlist of pipe_configs +anyway. + +Signed-off-by: Daniel Stone +--- + src/egl/drivers/dri2/platform_surfaceless.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c +index 0668ec9285f..4b69874d3f6 100644 +--- a/src/egl/drivers/dri2/platform_surfaceless.c ++++ b/src/egl/drivers/dri2/platform_surfaceless.c +@@ -190,6 +190,8 @@ surfaceless_get_capability(void *loaderPrivate, enum dri_loader_cap cap) + switch (cap) { + case DRI_LOADER_CAP_FP16: + return 1; ++ case DRI_LOADER_CAP_RGBA_ORDERING: ++ return 1; + default: + return 0; + } +-- +2.35.3 + From 43ec8d3aa1c23533d4350542dcb73dc46eb17a4adc7da97269004beeab0195a8 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Thu, 27 Jun 2024 09:00:28 +0000 Subject: [PATCH 3/4] - apply patches below to get GL on s390x working again only on s390x, because they break colors during YaST installation also on x86_64 platform (QT/GTK using GL backend?) (boo#1226725) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1309 --- Mesa.changes | 7 +++++++ Mesa.spec | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Mesa.changes b/Mesa.changes index 7af2b4c..0f3bb61 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jun 27 08:55:00 UTC 2024 - Stefan Dirsch + +- apply patches below to get GL on s390x working again only on + s390x, because they break colors during YaST installation + also on x86_64 platform (QT/GTK using GL backend?) (boo#1226725) + ------------------------------------------------------------------- Wed Jun 26 08:27:46 UTC 2024 - Stefan Dirsch diff --git a/Mesa.spec b/Mesa.spec index f5f306e..17c50d9 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -840,9 +840,11 @@ cp %{SOURCE6} subprojects/packagecache/ %patch -P 58 -p1 %patch -P 100 -p1 %patch -P 400 -p1 +%ifarch s390x %patch -P 500 -p1 %patch -P 501 -p1 %patch -P 502 -p1 +%endif # Remove requires to vulkan libs from baselibs.conf on platforms # where vulkan build is disabled; ugly ... From 3c3b62388b4dc0000d2613c2aaff03201761888e4c72996ec090848485ce6192 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Fri, 28 Jun 2024 12:54:24 +0000 Subject: [PATCH 4/4] - boo1226725-test-fix1.patch * another try to fix coloring on s390x and other platforms - re-enabled patchtes only applied on s390x with previous change on all platforms again OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1310 --- Mesa.changes | 8 ++++++++ Mesa.spec | 4 ++-- boo1226725-test-fix1.patch | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 boo1226725-test-fix1.patch diff --git a/Mesa.changes b/Mesa.changes index 0f3bb61..0e164bc 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jun 28 12:48:56 UTC 2024 - Stefan Dirsch + +- boo1226725-test-fix1.patch + * another try to fix coloring on s390x and other platforms +- re-enabled patchtes only applied on s390x with previous change + on all platforms again + ------------------------------------------------------------------- Thu Jun 27 08:55:00 UTC 2024 - Stefan Dirsch diff --git a/Mesa.spec b/Mesa.spec index 17c50d9..c712afa 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -186,6 +186,7 @@ Patch400: n_stop-iris-flicker.patch Patch500: u_dri-Fix-BGR-format-exclusion.patch Patch501: u_egl-gbm-Enable-RGBA-configs.patch Patch502: u_egl-surfaceless-Enable-RGBA-configs.patch +Patch503: boo1226725-test-fix1.patch %ifarch %{ix86} x86_64 BuildRequires: DirectX-Headers %endif @@ -840,11 +841,10 @@ cp %{SOURCE6} subprojects/packagecache/ %patch -P 58 -p1 %patch -P 100 -p1 %patch -P 400 -p1 -%ifarch s390x %patch -P 500 -p1 %patch -P 501 -p1 %patch -P 502 -p1 -%endif +%patch -P 503 -p1 # Remove requires to vulkan libs from baselibs.conf on platforms # where vulkan build is disabled; ugly ... diff --git a/boo1226725-test-fix1.patch b/boo1226725-test-fix1.patch new file mode 100644 index 0000000..6bcdebd --- /dev/null +++ b/boo1226725-test-fix1.patch @@ -0,0 +1,37 @@ +diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c +index 2e9ce01147a..15dde5152b8 100644 +--- a/src/gallium/frontends/dri/dri_screen.c ++++ b/src/gallium/frontends/dri/dri_screen.c +@@ -386,21 +386,16 @@ 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) { +- 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 +- } ++ if (!allow_rgba_ordering && ++ (pipe_formats[f] == PIPE_FORMAT_RGBA8888_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_RGBX8888_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_RGBA8888_SRGB || ++ pipe_formats[f] == PIPE_FORMAT_RGBX8888_SRGB || ++ pipe_formats[f] == PIPE_FORMAT_R5G5B5A1_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R5G5B5X1_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R4G4B4A4_UNORM || ++ pipe_formats[f] == PIPE_FORMAT_R4G4B4X4_UNORM)) ++ continue; + + if (!allow_rgb10 && + util_format_get_component_bits(pipe_formats[f], +