Mesa/0001-dri-don-t-fetch-X11-modifiers-if-we-don-t-support-th.patch
Stefan Dirsch 756b7868e8 - 0001-dri-don-t-fetch-X11-modifiers-if-we-don-t-support-th.patch
0002-egl-wayland-only-supply-LINEAR-modifier-when-support.patch
  0003-egl-wayland-fallback-to-implicit-modifiers-if-advert.patch
  * fixes mesa 24.3.1 gallium crash/segfault on GPUs without
    format modifiers (mesa issue#12253, mesa MR#32535, boo#1234302)

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=1354
2024-12-08 22:09:41 +00:00

45 lines
1.7 KiB
Diff

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 268ec3d86c8..e1f51619c5f 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;
--
2.43.0