* [PR PATCH] mesa: update to 24.3.1.
@ 2024-12-11 19:16 SpidFightFR
2024-12-11 19:19 ` classabbyamp
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: SpidFightFR @ 2024-12-11 19:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
There is a new pull request by SpidFightFR against master on the void-packages repository
https://github.com/SpidFightFR/void-packages update-mesa
https://github.com/void-linux/void-packages/pull/53470
mesa: update to 24.3.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Local build testing
- I built this PR locally for my native architecture, (x64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- x64-musl
Hey everyone, so that's the second try with mesa 24.3.1, this time with a patch that should fix https://github.com/void-linux/void-packages/issues/53434.
Can someone (who had the problems linked above) test this patch and let me know if it does fix the bug ? my hardware doesn't seem to be affected by that somehow.
A patch file from https://github.com/void-linux/void-packages/pull/53470.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-mesa-53470.patch --]
[-- Type: text/x-diff, Size: 9044 bytes --]
From 646e2b1f0391741f5d2b77f250313a8c5ce9e870 Mon Sep 17 00:00:00 2001
From: SpidFightFR <spidfight@swisscows.email>
Date: Wed, 11 Dec 2024 20:14:05 +0100
Subject: [PATCH] mesa: update to 24.3.1.
---
.../egl-implicit-modifiers-fixes.patch | 181 ++++++++++++++++++
srcpkgs/mesa/template | 7 +-
2 files changed, 184 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/mesa/patches/egl-implicit-modifiers-fixes.patch
diff --git a/srcpkgs/mesa/patches/egl-implicit-modifiers-fixes.patch b/srcpkgs/mesa/patches/egl-implicit-modifiers-fixes.patch
new file mode 100644
index 00000000000000..61a8b9a43939bb
--- /dev/null
+++ b/srcpkgs/mesa/patches/egl-implicit-modifiers-fixes.patch
@@ -0,0 +1,181 @@
+From 35852799aef8efdb4516c51913f86cd7d795a8d7 Mon Sep 17 00:00:00 2001
+From: Simon Ser <contact@emersion.fr>
+Date: Sat, 7 Dec 2024 13:10:04 +0100
+Subject: [PATCH 1/3] dri: don't fetch X11 modifiers if we don't support them
+
+If we supply modifiers to dri_create_image_with_modifiers() and
+the driver doesn't support them, the function will fail. The X11
+server always supports implicit modifiers so we can always fall
+back to that.
+
+Signed-off-by: Simon Ser <contact@emersion.fr>
+Fixes: 4c065158927d ("dri: revert INVALID modifier special-casing")
+---
+ src/gallium/frontends/dri/loader_dri3_helper.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/frontends/dri/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c
+index 268ec3d86c8a3..e1f51619c5fa3 100644
+--- a/src/gallium/frontends/dri/loader_dri3_helper.c
++++ b/src/gallium/frontends/dri/loader_dri3_helper.c
+@@ -36,9 +36,11 @@
+
+ #include "loader_dri_helper.h"
+ #include "loader_dri3_helper.h"
++#include "pipe/p_screen.h"
+ #include "util/macros.h"
+ #include "util/simple_mtx.h"
+ #include "drm-uapi/drm_fourcc.h"
++#include "dri_screen.h"
+ #include "dri_util.h"
+
+ /**
+@@ -1401,7 +1403,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int fourcc,
+
+ if (draw->dri_screen_render_gpu == draw->dri_screen_display_gpu) {
+ #ifdef HAVE_X11_DRM
+- if (draw->multiplanes_available) {
++ if (draw->multiplanes_available && draw->dri_screen_render_gpu->base.screen->resource_create_with_modifiers) {
+ xcb_dri3_get_supported_modifiers_cookie_t mod_cookie;
+ xcb_dri3_get_supported_modifiers_reply_t *mod_reply;
+ xcb_generic_error_t *error = NULL;
+--
+GitLab
+
+
+From 3c78ff12864e87d5a293cea55ebd1ae9ca3e6df0 Mon Sep 17 00:00:00 2001
+From: Simon Ser <contact@emersion.fr>
+Date: Sat, 7 Dec 2024 13:12:40 +0100
+Subject: [PATCH 2/3] egl/wayland: only supply LINEAR modifier when supported
+
+If we supply modifiers to dri_create_image_with_modifiers() and
+the driver doesn't support them, the function will fail. We pass
+__DRI_IMAGE_USE_LINEAR anyways so stripping the modifier is fine.
+
+Signed-off-by: Simon Ser <contact@emersion.fr>
+Fixes: 4c065158927d ("dri: revert INVALID modifier special-casing")
+---
+ src/egl/drivers/dri2/platform_wayland.c | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
+index 513d2d0709b14..472665a36b0dd 100644
+--- a/src/egl/drivers/dri2/platform_wayland.c
++++ b/src/egl/drivers/dri2/platform_wayland.c
+@@ -45,11 +45,13 @@
+ #include "util/u_vector.h"
+ #include "util/format/u_formats.h"
+ #include "main/glconfig.h"
++#include "pipe/p_screen.h"
+ #include "egl_dri2.h"
+ #include "eglglobals.h"
+ #include "kopper_interface.h"
+ #include "loader.h"
+ #include "loader_dri_helper.h"
++#include "dri_screen.h"
+ #include "dri_util.h"
+ #include <loader_wayland_helper.h>
+
+@@ -1193,14 +1195,25 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
+ if (dri2_dpy->fd_render_gpu != dri2_dpy->fd_display_gpu &&
+ dri2_surf->back->linear_copy == NULL) {
+ uint64_t linear_mod = DRM_FORMAT_MOD_LINEAR;
++ const uint64_t *render_modifiers = NULL, *display_modifiers = NULL;
++ unsigned int render_num_modifiers = 0, display_num_modifiers = 0;
+ struct dri_image *linear_copy_display_gpu_image = NULL;
+
++ if (dri2_dpy->dri_screen_render_gpu->base.screen->resource_create_with_modifiers) {
++ render_modifiers = &linear_mod;
++ render_num_modifiers = 1;
++ }
++ if (dri2_dpy->dri_screen_display_gpu->base.screen->resource_create_with_modifiers) {
++ display_modifiers = &linear_mod;
++ display_num_modifiers = 1;
++ }
++
+ if (dri2_dpy->dri_screen_display_gpu) {
+ linear_copy_display_gpu_image = dri_create_image_with_modifiers(
+ dri2_dpy->dri_screen_display_gpu,
+ dri2_surf->base.Width, dri2_surf->base.Height,
+ linear_pipe_format, use_flags | __DRI_IMAGE_USE_LINEAR,
+- &linear_mod, 1, NULL);
++ display_modifiers, display_num_modifiers, NULL);
+
+ if (linear_copy_display_gpu_image) {
+ int i, ret = 1;
+@@ -1285,7 +1298,7 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
+ dri2_dpy->dri_screen_render_gpu,
+ dri2_surf->base.Width, dri2_surf->base.Height,
+ linear_pipe_format, use_flags | __DRI_IMAGE_USE_LINEAR,
+- &linear_mod, 1, NULL);
++ render_modifiers, render_num_modifiers, NULL);
+ }
+
+ if (dri2_surf->back->linear_copy == NULL)
+--
+GitLab
+
+
+From bf278ee26628898b674d86d39198babe0174f8bf Mon Sep 17 00:00:00 2001
+From: Simon Ser <contact@emersion.fr>
+Date: Sat, 7 Dec 2024 13:15:57 +0100
+Subject: [PATCH 3/3] egl/wayland: fallback to implicit modifiers if advertised
+ by compositor
+
+The Wayland protocol defines INVALID as a special marker indicating
+that implicit modifiers are supported. If the driver doesn't support
+explicit modifiers and the compositor advertises support for implicit
+modifiers, fallback to these.
+
+This effectively restores logic removed in 4c065158927d, but only
+for the specific case of Wayland instead of affecting all APIs.
+(Wayland is one of the few APIs defining a special meaning for
+INVALID.)
+
+Signed-off-by: Simon Ser <contact@emersion.fr>
+Fixes: 4c065158927d ("dri: revert INVALID modifier special-casing")
+---
+ src/egl/drivers/dri2/platform_wayland.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
+index 472665a36b0dd..2406bc18b7448 100644
+--- a/src/egl/drivers/dri2/platform_wayland.c
++++ b/src/egl/drivers/dri2/platform_wayland.c
+@@ -1010,6 +1010,7 @@ create_dri_image(struct dri2_egl_surface *dri2_surf,
+ uint64_t *modifiers;
+ unsigned int num_modifiers;
+ struct u_vector *modifiers_present;
++ bool implicit_mod_supported;
+
+ assert(visual_idx != -1);
+
+@@ -1049,6 +1050,25 @@ create_dri_image(struct dri2_egl_surface *dri2_surf,
+ num_modifiers = u_vector_length(modifiers_present);
+ }
+
++ if (!dri2_dpy->dri_screen_render_gpu->base.screen->resource_create_with_modifiers) {
++ /* We don't support explicit modifiers, check if the compositor supports
++ * implicit modifiers. */
++ implicit_mod_supported = false;
++ for (unsigned int i = 0; i < num_modifiers; i++) {
++ if (modifiers[i] == DRM_FORMAT_MOD_INVALID) {
++ implicit_mod_supported = true;
++ break;
++ }
++ }
++
++ if (!implicit_mod_supported) {
++ return;
++ }
++
++ num_modifiers = 0;
++ modifiers = NULL;
++ }
++
+ /* For the purposes of this function, an INVALID modifier on
+ * its own means the modifiers aren't supported. */
+ if (num_modifiers == 0 ||
+--
+GitLab
+
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 5c25e440e4ad5c..b99086a0f20b9a 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,13 +1,12 @@
# Template file for 'mesa'
pkgname=mesa
-reverts="24.3.1_1"
-version=24.2.8
+version=24.3.1
revision=1
build_style=meson
_llvmver=19
#Disable LTO flag should be present, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/6911
configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
- -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
+ -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri
-Dlmsensors=enabled -Dplatforms=x11$(vopt_if wayland ,wayland)
-Dllvm=enabled -Db_lto=false -Dcpp_std=gnu++17"
hostmakedepends="gettext flex pkg-config python3-Mako glslang llvm${_llvmver}
@@ -25,7 +24,7 @@ license="MIT, LGPL-2.1-or-later"
homepage="https://www.mesa3d.org/"
changelog="https://docs.mesa3d.org/relnotes.html"
distfiles="https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
-checksum=999d0a854f43864fc098266aaf25600ce7961318a1e2e358bff94a7f53580e30
+checksum=9c795900449ce5bc7c526ba0ab3532a22c3c951cab7e0dd9de5fcac41b0843af
build_helper="qemu"
build_options="wayland"
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: mesa: update to 24.3.1.
2024-12-11 19:16 [PR PATCH] mesa: update to 24.3.1 SpidFightFR
@ 2024-12-11 19:19 ` classabbyamp
2024-12-11 19:49 ` SpidFightFR
2024-12-11 19:50 ` [PR PATCH] [Closed]: " SpidFightFR
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2024-12-11 19:19 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/53470#issuecomment-2536910845
Comment:
let's wait for .2 at least, there were other, similar issues for other graphics cards
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: mesa: update to 24.3.1.
2024-12-11 19:16 [PR PATCH] mesa: update to 24.3.1 SpidFightFR
2024-12-11 19:19 ` classabbyamp
@ 2024-12-11 19:49 ` SpidFightFR
2024-12-11 19:50 ` [PR PATCH] [Closed]: " SpidFightFR
2 siblings, 0 replies; 4+ messages in thread
From: SpidFightFR @ 2024-12-11 19:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
New comment by SpidFightFR on void-packages repository
https://github.com/void-linux/void-packages/pull/53470#issuecomment-2536973689
Comment:
> let's wait for .2 at least, there were other, similar issues for other graphics cards
alright agreed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Closed]: mesa: update to 24.3.1.
2024-12-11 19:16 [PR PATCH] mesa: update to 24.3.1 SpidFightFR
2024-12-11 19:19 ` classabbyamp
2024-12-11 19:49 ` SpidFightFR
@ 2024-12-11 19:50 ` SpidFightFR
2 siblings, 0 replies; 4+ messages in thread
From: SpidFightFR @ 2024-12-11 19:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 840 bytes --]
There's a closed pull request on the void-packages repository
mesa: update to 24.3.1.
https://github.com/void-linux/void-packages/pull/53470
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Local build testing
- I built this PR locally for my native architecture, (x64-glibc)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- x64-musl
Hey everyone, so that's the second try with mesa 24.3.1, this time with a patch that should fix https://github.com/void-linux/void-packages/issues/53434.
Can someone (who had the problems linked above) test this patch and let me know if it does fix the bug please ? my hardware doesn't seem to be affected by that somehow.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-11 19:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11 19:16 [PR PATCH] mesa: update to 24.3.1 SpidFightFR
2024-12-11 19:19 ` classabbyamp
2024-12-11 19:49 ` SpidFightFR
2024-12-11 19:50 ` [PR PATCH] [Closed]: " SpidFightFR
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).