egl: unify LIBGL_KOPPER_DRI2 checks

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30872>
This commit is contained in:
Mike Blumenkrantz
2024-08-27 09:56:02 -04:00
committed by Marge Bot
parent d94d152498
commit aae62e5d29
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -591,6 +591,7 @@ dri2_load_driver(_EGLDisplay *disp)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
dri2_dpy->kopper = disp->Options.Zink && !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false);
dri2_dpy->kopper_without_modifiers = dri2_dpy->kopper && debug_get_bool_option("LIBGL_KOPPER_DRI2", false);
dri2_dpy->swrast = (disp->Options.ForceSoftware && !dri2_dpy->kopper) ||
!dri2_dpy->driver_name || strstr(dri2_dpy->driver_name, "swrast");
dri2_dpy->swrast_not_kms = dri2_dpy->swrast && (!dri2_dpy->driver_name || strcmp(dri2_dpy->driver_name, "kms_swrast"));
+1
View File
@@ -258,6 +258,7 @@ struct dri2_egl_display {
bool own_device;
bool invalidate_available;
bool kopper;
bool kopper_without_modifiers;
bool swrast;
bool swrast_not_kms;
int min_swap_interval;
+2 -2
View File
@@ -1795,7 +1795,7 @@ dri2_x11_check_multibuffers(_EGLDisplay *disp)
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
!dri2_dpy->multibuffers_available &&
!debug_get_bool_option("LIBGL_KOPPER_DRI2", false))
!dri2_dpy->kopper_without_modifiers)
return EGL_FALSE;
#endif
@@ -1820,7 +1820,7 @@ dri2_initialize_x11_swrast(_EGLDisplay *disp)
#ifdef HAVE_DRI3
if (disp->Options.Zink &&
!debug_get_bool_option("LIBGL_DRI3_DISABLE", false) &&
!debug_get_bool_option("LIBGL_KOPPER_DRI2", false))
!dri2_dpy->kopper_without_modifiers)
dri3_x11_connect(dri2_dpy, disp->Options.Zink, disp->Options.ForceSoftware);
#endif
if (!dri2_load_driver(disp))