egl/x11: Move the multibuffers check into dri2_initialize_x11()

No functional change.  This just moves code higher up the call stack.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
This commit is contained in:
Faith Ekstrand
2025-07-07 11:48:55 -04:00
committed by Marge Bot
parent 1dde634b6a
commit 42b5130ea7
+9 -20
View File
@@ -1204,31 +1204,11 @@ check_xshm(struct dri2_egl_display *dri2_dpy)
return ret;
}
static EGLBoolean
dri2_x11_check_multibuffers(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
#ifdef HAVE_X11_DRM
dri2_dpy->multibuffers_available = x11_dri3_has_multibuffer(dri2_dpy->conn);
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
!dri2_dpy->multibuffers_available &&
!dri2_dpy->kopper_without_modifiers)
return EGL_FALSE;
#endif
return EGL_TRUE;
}
static bool
platform_x11_finalize(_EGLDisplay *disp)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (!dri2_x11_check_multibuffers(disp))
return false;
if (!dri2_create_screen(disp))
return false;
@@ -1356,6 +1336,15 @@ dri2_initialize_x11(_EGLDisplay *disp)
#endif
dri2_detect_swrast(disp);
#ifdef HAVE_X11_DRM
dri2_dpy->multibuffers_available = x11_dri3_has_multibuffer(dri2_dpy->conn);
if (disp->Options.Zink && !disp->Options.ForceSoftware &&
!dri2_dpy->multibuffers_available &&
!dri2_dpy->kopper_without_modifiers)
return EGL_FALSE;
#endif
if (disp->Options.ForceSoftware || dri2_dpy->kopper)
return dri2_initialize_x11_swrast(disp);