egl: delete dri2_egl_driver_fail
before refactoring egl init was more complex, but things are simpler now and with recent hoisting this can all go away Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33891>
This commit is contained in:
committed by
Marge Bot
parent
b12a929bbe
commit
4e405af61c
@@ -211,12 +211,6 @@ struct dmabuf_feedback {
|
||||
};
|
||||
#endif
|
||||
|
||||
enum dri2_egl_driver_fail {
|
||||
DRI2_EGL_DRIVER_LOADED = 0,
|
||||
DRI2_EGL_DRIVER_FAILED = 1,
|
||||
DRI2_EGL_DRIVER_PREFER_ZINK = 2,
|
||||
};
|
||||
|
||||
struct dri2_egl_display {
|
||||
const struct dri2_egl_display_vtbl *vtbl;
|
||||
|
||||
|
||||
@@ -1991,7 +1991,6 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
|
||||
EGLBoolean
|
||||
dri2_initialize_x11(_EGLDisplay *disp, bool *allow_dri2)
|
||||
{
|
||||
enum dri2_egl_driver_fail status = DRI2_EGL_DRIVER_FAILED;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
|
||||
|
||||
/*
|
||||
@@ -2012,11 +2011,11 @@ dri2_initialize_x11(_EGLDisplay *disp, bool *allow_dri2)
|
||||
*/
|
||||
if (!debug_get_bool_option("LIBGL_DRI3_DISABLE", false) &&
|
||||
(!disp->Options.Zink || !debug_get_bool_option("LIBGL_KOPPER_DRI2", false))) {
|
||||
status = dri3_x11_connect(dri2_dpy, disp->Options.Zink, disp->Options.ForceSoftware);
|
||||
bool status = dri3_x11_connect(dri2_dpy, disp->Options.Zink, disp->Options.ForceSoftware);
|
||||
/* 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 != DRI2_EGL_DRIVER_LOADED)
|
||||
if (!dri2_dpy->kopper && !disp->Options.ForceSoftware && !status)
|
||||
return EGL_FALSE;
|
||||
}
|
||||
#endif
|
||||
@@ -2031,8 +2030,7 @@ dri2_initialize_x11(_EGLDisplay *disp, bool *allow_dri2)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X11_DRI2
|
||||
*allow_dri2 = !debug_get_bool_option("LIBGL_DRI2_DISABLE", false) &&
|
||||
status != DRI2_EGL_DRIVER_PREFER_ZINK;
|
||||
*allow_dri2 = !debug_get_bool_option("LIBGL_DRI2_DISABLE", false);
|
||||
#else
|
||||
*allow_dri2 = false;
|
||||
#endif
|
||||
|
||||
@@ -521,7 +521,7 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = {
|
||||
.close_screen_notify = dri3_close_screen_notify,
|
||||
};
|
||||
|
||||
enum dri2_egl_driver_fail
|
||||
bool
|
||||
dri3_x11_connect(struct dri2_egl_display *dri2_dpy, bool zink, bool swrast)
|
||||
{
|
||||
dri2_dpy->fd_render_gpu =
|
||||
@@ -535,7 +535,7 @@ dri3_x11_connect(struct dri2_egl_display *dri2_dpy, bool zink, bool swrast)
|
||||
_eglLog(_EGL_WARNING, "DRI3: Failed to initialize");
|
||||
}
|
||||
|
||||
return DRI2_EGL_DRIVER_FAILED;
|
||||
return false;
|
||||
}
|
||||
|
||||
loader_get_user_preferred_fd(&dri2_dpy->fd_render_gpu,
|
||||
@@ -547,14 +547,14 @@ dri3_x11_connect(struct dri2_egl_display *dri2_dpy, bool zink, bool swrast)
|
||||
if (!zink && !strcmp(dri2_dpy->driver_name, "zink")) {
|
||||
close(dri2_dpy->fd_render_gpu);
|
||||
dri2_dpy->fd_render_gpu = -1;
|
||||
return DRI2_EGL_DRIVER_PREFER_ZINK;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!dri2_dpy->driver_name) {
|
||||
_eglLog(_EGL_WARNING, "DRI3: No driver found");
|
||||
close(dri2_dpy->fd_render_gpu);
|
||||
dri2_dpy->fd_render_gpu = -1;
|
||||
return DRI2_EGL_DRIVER_FAILED;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
@@ -565,5 +565,5 @@ dri3_x11_connect(struct dri2_egl_display *dri2_dpy, bool zink, bool swrast)
|
||||
drmGetRenderDeviceNameFromFd(dri2_dpy->fd_render_gpu);
|
||||
#endif
|
||||
|
||||
return DRI2_EGL_DRIVER_LOADED;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ struct dri3_egl_surface {
|
||||
extern const __DRIimageLoaderExtension dri3_image_loader_extension;
|
||||
extern struct dri2_egl_display_vtbl dri3_x11_display_vtbl;
|
||||
|
||||
enum dri2_egl_driver_fail
|
||||
bool
|
||||
dri3_x11_connect(struct dri2_egl_display *dri2_dpy, bool zink, bool swrast);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user