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:
parent
bceaca28d3
commit
8c0267b60f
|
@ -284,37 +284,6 @@ xwl_glamor_needs_n_buffering(struct xwl_screen *xwl_screen)
|
||||||
return TRUE;
|
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
|
Bool
|
||||||
xwl_glamor_init(struct xwl_screen *xwl_screen)
|
xwl_glamor_init(struct xwl_screen *xwl_screen)
|
||||||
{
|
{
|
||||||
|
@ -327,6 +296,11 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
|
||||||
return FALSE;
|
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)) {
|
if (!xwl_glamor_gbm_init_egl(xwl_screen)) {
|
||||||
ErrorF("EGL setup failed, disabling glamor\n");
|
ErrorF("EGL setup failed, disabling glamor\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -119,8 +119,6 @@ struct xwl_egl_backend {
|
||||||
|
|
||||||
#ifdef XWL_HAS_GLAMOR
|
#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_glamor_init(struct xwl_screen *xwl_screen);
|
||||||
|
|
||||||
Bool xwl_screen_set_drm_interface(struct xwl_screen *xwl_screen,
|
Bool xwl_screen_set_drm_interface(struct xwl_screen *xwl_screen,
|
||||||
|
|
|
@ -869,8 +869,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XWL_HAS_GLAMOR
|
#ifdef XWL_HAS_GLAMOR
|
||||||
if (xwl_screen->glamor)
|
if (xwl_screen->glamor && !xwl_glamor_init_gbm(xwl_screen)) {
|
||||||
xwl_glamor_init_backends(xwl_screen);
|
ErrorF("xwayland glamor: failed to setup GBM backend, falling back to sw accel\n");
|
||||||
|
xwl_screen->glamor = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* In rootless mode, we don't have any screen storage, and the only
|
/* In rootless mode, we don't have any screen storage, and the only
|
||||||
|
@ -992,14 +994,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#ifdef XWL_HAS_GLAMOR
|
#ifdef XWL_HAS_GLAMOR
|
||||||
if (xwl_screen->glamor) {
|
if (xwl_screen->glamor && !xwl_glamor_init(xwl_screen)) {
|
||||||
xwl_glamor_select_backend(xwl_screen);
|
|
||||||
|
|
||||||
if (!xwl_glamor_init(xwl_screen)) {
|
|
||||||
ErrorF("Failed to initialize glamor, falling back to sw\n");
|
ErrorF("Failed to initialize glamor, falling back to sw\n");
|
||||||
xwl_screen->glamor = XWL_GLAMOR_NONE;
|
xwl_screen->glamor = XWL_GLAMOR_NONE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xwl_screen->present = xwl_present_init(pScreen);
|
xwl_screen->present = xwl_present_init(pScreen);
|
||||||
|
|
Loading…
Reference in New Issue