mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
Revert "egl/glx: add fallback for zink loading"
This reverts commit2569215f43. Conflicts: src/egl/main/eglapi.c src/glx/glxext.c It broke the fallback to swrast in some cases where zink can't work. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7333 Fixes:2569215f43("egl/glx: add fallback for zink loading") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19681>
This commit is contained in:
parent
b1b419f7fe
commit
71a0a386b5
3 changed files with 12 additions and 40 deletions
|
|
@ -701,26 +701,12 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
|
|||
* If the initialisation fails, try again using only software rendering.
|
||||
*/
|
||||
if (!_eglDriver.Initialize(disp)) {
|
||||
bool fail = true;
|
||||
if (!disp->Options.ForceSoftware && !disp->Options.Zink &&
|
||||
!debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER")) {
|
||||
/* zink fallback */
|
||||
disp->Options.Zink = EGL_TRUE;
|
||||
if (disp->Options.ForceSoftware)
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
else {
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
fail = !_eglDriver.Initialize(disp);
|
||||
if (fail) {
|
||||
disp->Options.Zink = EGL_FALSE;
|
||||
disp->Options.ForceSoftware = EGL_FALSE;
|
||||
}
|
||||
}
|
||||
if (fail) {
|
||||
if (disp->Options.ForceSoftware)
|
||||
if (!_eglDriver.Initialize(disp))
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
else {
|
||||
disp->Options.ForceSoftware = EGL_TRUE;
|
||||
if (!_eglDriver.Initialize(disp))
|
||||
RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1058,8 +1058,11 @@ static struct glx_screen *
|
|||
driswCreateScreen(int screen, struct glx_display *priv)
|
||||
{
|
||||
const struct drisw_display *pdpyp = (struct drisw_display *)priv->driswDisplay;
|
||||
if (pdpyp->zink && !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false)) {
|
||||
return driswCreateScreenDriver(screen, priv, "zink");
|
||||
}
|
||||
|
||||
return driswCreateScreenDriver(screen, priv, pdpyp->zink ? "zink" : "swrast");
|
||||
return driswCreateScreenDriver(screen, priv, "swrast");
|
||||
}
|
||||
|
||||
/* Called from __glXFreeDisplayPrivate.
|
||||
|
|
|
|||
|
|
@ -923,9 +923,9 @@ __glXInitialize(Display * dpy)
|
|||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||
Bool glx_direct = !debug_get_bool_option("LIBGL_ALWAYS_INDIRECT", false);
|
||||
Bool glx_accel = !debug_get_bool_option("LIBGL_ALWAYS_SOFTWARE", false);
|
||||
Bool zink;
|
||||
const char *env = getenv("MESA_LOADER_DRIVER_OVERRIDE");
|
||||
Bool explicit_zink = env && !strcmp(env, "zink");
|
||||
Bool infer_zink = false;
|
||||
zink = env && !strcmp(env, "zink");
|
||||
|
||||
dpyPriv->drawHash = __glxHashCreate();
|
||||
|
||||
|
|
@ -940,20 +940,17 @@ __glXInitialize(Display * dpy)
|
|||
** (e.g., those called in AllocAndFetchScreenConfigs).
|
||||
*/
|
||||
#if defined(GLX_USE_DRM)
|
||||
if (glx_direct && glx_accel && !explicit_zink) {
|
||||
if (glx_direct && glx_accel && !zink) {
|
||||
#if defined(HAVE_DRI3)
|
||||
if (!debug_get_bool_option("LIBGL_DRI3_DISABLE", false))
|
||||
dpyPriv->dri3Display = dri3_create_display(dpy);
|
||||
#endif /* HAVE_DRI3 */
|
||||
if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false))
|
||||
dpyPriv->dri2Display = dri2CreateDisplay(dpy);
|
||||
/* zink fallback */
|
||||
if (!dpyPriv->dri3Display && !dpyPriv->dri2Display)
|
||||
infer_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && !getenv("GALLIUM_DRIVER");
|
||||
}
|
||||
#endif /* GLX_USE_DRM */
|
||||
if (glx_direct)
|
||||
dpyPriv->driswDisplay = driswCreateDisplay(dpy, explicit_zink | infer_zink);
|
||||
dpyPriv->driswDisplay = driswCreateDisplay(dpy, zink);
|
||||
|
||||
#ifdef GLX_USE_WINDOWSGL
|
||||
if (glx_direct && glx_accel)
|
||||
|
|
@ -969,22 +966,8 @@ __glXInitialize(Display * dpy)
|
|||
#endif
|
||||
|
||||
if (!AllocAndFetchScreenConfigs(dpy, dpyPriv)) {
|
||||
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
|
||||
Bool fail = true;
|
||||
/* if zink was inferred, retry without zink */
|
||||
if (infer_zink && !explicit_zink) {
|
||||
free(dpyPriv->screens);
|
||||
driswCreateDisplay(dpy, false);
|
||||
fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv);
|
||||
}
|
||||
if (fail) {
|
||||
free(dpyPriv);
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
free(dpyPriv);
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
__glX_send_client_info(dpyPriv);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue