EGL: legacy-x11=dri2 should support hardware driver
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Since MR !33891 EGL only supports a software driver (LLVM).
Routine dri3_x11_connect at
src/egl/drivers/dri2/platform_x11.c fails if DRI3 is not
available. So at that location variable *allow_dri2 should be set.

Looking at the major codition, we see it is not executed
if LIBGL_DRI3_DISABLE is set. In that case the hardware driver
is activated as desired. Previously this was not needed.
Also it is not practical, and not necessary.

I do not understand the major condition, so I did not change it.
This causes some duplicate coding.

Fixes: 323bad6b18 ("egl/x11: split out dri2 init entirely")
Signed-off-by: GKraats <vd.kraats@hccnet.nl>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34530>
This commit is contained in:
GKraats 2025-04-15 17:23:36 +02:00 committed by Marge Bot
parent 76031ba53d
commit 995dc61bf5

View file

@ -1989,8 +1989,15 @@ dri2_initialize_x11(_EGLDisplay *disp, bool *allow_dri2)
/* the status here is ignored for zink-with-kopper and swrast,
* otherwise return whatever error/fallback status as failure
*/
if (!dri2_dpy->kopper && !disp->Options.ForceSoftware && !status)
return EGL_FALSE;
if (!dri2_dpy->kopper && !disp->Options.ForceSoftware) {
#ifdef HAVE_X11_DRI2
*allow_dri2 = !debug_get_bool_option("LIBGL_DRI2_DISABLE", false);
#else
*allow_dri2 = false;
#endif
if (!status)
return EGL_FALSE;
}
}
#endif
if (!dri2_load_driver(disp))