X11: fix crash of gnome-shell if mesa is compiled with legacy-x11=dri2

X11 starts up if Mesa is compiled with legacy-x11=dri2 and shows
the desktop.
It crashes with segfault as soon as an application is started.
At src/egl/drivers/dri2/platform_x11.c function dri2_from_names
(at src/gallium/frontends/dri/dri2.c) should be called
with offset address instead of with offset value.

Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31406>
(cherry picked from commit 6c84103276)
This commit is contained in:
GKraats 2024-09-26 21:32:28 +02:00 committed by Eric Engestrom
parent a307748a70
commit 3598b41e45
2 changed files with 4 additions and 3 deletions

View file

@ -704,7 +704,7 @@
"description": "X11: fix crash of gnome-shell if mesa is compiled with legacy-x11=dri2",
"nominated": false,
"nomination_type": 3,
"resolution": 4,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1330,10 +1330,11 @@ dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx,
_eglInitImage(&dri2_img->base, disp);
int offset = 0;
dri2_img->dri_image = dri2_dpy->image->createImageFromNames(
dri2_dpy->dri_screen_render_gpu, buffers_reply->width,
buffers_reply->height, fourcc, (int *) &buffers[0].name, 1,
(int *) &buffers[0].pitch, 0, dri2_img);
buffers_reply->height, fourcc, (int *)&buffers[0].name, 1,
(int *)&buffers[0].pitch, &offset, dri2_img);
free(buffers_reply);
free(geometry_reply);