xwayland/glamor: Drop init_backend() and select_backend()

Now that we have only one backend, there is no need to initialize or
select between different backends.

Drop the corresponding functions.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
This commit is contained in:
Olivier Fourdan 2024-03-12 15:03:31 +01:00 committed by Marge Bot
parent bceaca28d3
commit 8c0267b60f
3 changed files with 12 additions and 42 deletions

View File

@ -284,37 +284,6 @@ xwl_glamor_needs_n_buffering(struct xwl_screen *xwl_screen)
return TRUE;
}
void
xwl_glamor_init_backends(struct xwl_screen *xwl_screen)
{
#ifdef GLAMOR_HAS_GBM
if (!xwl_glamor_init_gbm(xwl_screen))
ErrorF("Xwayland glamor: GBM backend is not available\n");
#endif
}
static Bool
xwl_glamor_select_gbm_backend(struct xwl_screen *xwl_screen)
{
#ifdef GLAMOR_HAS_GBM
if (xwl_glamor_has_wl_interfaces(xwl_screen)) {
LogMessageVerb(X_INFO, 3, "glamor: Using GBM backend\n");
return TRUE;
}
else
LogMessageVerb(X_INFO, 3,
"Missing Wayland requirements for glamor GBM backend\n");
#endif
return FALSE;
}
void
xwl_glamor_select_backend(struct xwl_screen *xwl_screen)
{
xwl_glamor_select_gbm_backend(xwl_screen);
}
Bool
xwl_glamor_init(struct xwl_screen *xwl_screen)
{
@ -327,6 +296,11 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
return FALSE;
}
if (!xwl_glamor_has_wl_interfaces(xwl_screen)) {
ErrorF("Xwayland glamor: GBM Wayland interfaces not available\n");
return FALSE;
}
if (!xwl_glamor_gbm_init_egl(xwl_screen)) {
ErrorF("EGL setup failed, disabling glamor\n");
return FALSE;

View File

@ -119,8 +119,6 @@ struct xwl_egl_backend {
#ifdef XWL_HAS_GLAMOR
void xwl_glamor_init_backends(struct xwl_screen *xwl_screen);
void xwl_glamor_select_backend(struct xwl_screen *xwl_screen);
Bool xwl_glamor_init(struct xwl_screen *xwl_screen);
Bool xwl_screen_set_drm_interface(struct xwl_screen *xwl_screen,

View File

@ -869,8 +869,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
}
#ifdef XWL_HAS_GLAMOR
if (xwl_screen->glamor)
xwl_glamor_init_backends(xwl_screen);
if (xwl_screen->glamor && !xwl_glamor_init_gbm(xwl_screen)) {
ErrorF("xwayland glamor: failed to setup GBM backend, falling back to sw accel\n");
xwl_screen->glamor = 0;
}
#endif
/* In rootless mode, we don't have any screen storage, and the only
@ -992,13 +994,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
#ifdef XWL_HAS_GLAMOR
if (xwl_screen->glamor) {
xwl_glamor_select_backend(xwl_screen);
if (!xwl_glamor_init(xwl_screen)) {
ErrorF("Failed to initialize glamor, falling back to sw\n");
xwl_screen->glamor = XWL_GLAMOR_NONE;
}
if (xwl_screen->glamor && !xwl_glamor_init(xwl_screen)) {
ErrorF("Failed to initialize glamor, falling back to sw\n");
xwl_screen->glamor = XWL_GLAMOR_NONE;
}
#endif