xwayland/glamor: Remove the backend pointers

We have only one backend now.

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 14:57:52 +01:00 committed by Marge Bot
parent 863ee2da4d
commit bceaca28d3
4 changed files with 5 additions and 11 deletions

View File

@ -409,7 +409,7 @@ xwl_glamor_create_pixmap_for_window(struct xwl_window *xwl_window)
WindowPtr window = xwl_window->window;
unsigned border_width = 2 * window->borderWidth;
if (!xwl_screen->glamor || !xwl_screen->egl_backend)
if (!xwl_screen->glamor)
return NullPixmap;
return xwl_glamor_gbm_create_pixmap_internal(xwl_screen,

View File

@ -114,8 +114,7 @@ xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen,
}
static Bool
xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
struct xwl_egl_backend *xwl_egl_backend)
xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen)
{
if (!xwl_glamor_has_wl_drm(xwl_screen) &&
xwl_screen->dmabuf_protocol_version < 4) {
@ -273,7 +272,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
Bool
xwl_glamor_needs_buffer_flush(struct xwl_screen *xwl_screen)
{
if (!xwl_screen->glamor || !xwl_screen->egl_backend)
if (!xwl_screen->glamor)
return FALSE;
return TRUE;
@ -298,8 +297,7 @@ static Bool
xwl_glamor_select_gbm_backend(struct xwl_screen *xwl_screen)
{
#ifdef GLAMOR_HAS_GBM
if (xwl_glamor_has_wl_interfaces(xwl_screen, &xwl_screen->gbm_backend)) {
xwl_screen->egl_backend = &xwl_screen->gbm_backend;
if (xwl_glamor_has_wl_interfaces(xwl_screen)) {
LogMessageVerb(X_INFO, 3, "glamor: Using GBM backend\n");
return TRUE;
}

View File

@ -995,7 +995,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
if (xwl_screen->glamor) {
xwl_glamor_select_backend(xwl_screen);
if (xwl_screen->egl_backend == NULL || !xwl_glamor_init(xwl_screen)) {
if (!xwl_glamor_init(xwl_screen)) {
ErrorF("Failed to initialize glamor, falling back to sw\n");
xwl_screen->glamor = XWL_GLAMOR_NONE;
}

View File

@ -127,10 +127,6 @@ struct xwl_screen {
struct xwl_format *formats;
void *egl_display, *egl_context;
struct xwl_egl_backend gbm_backend;
/* pointer to the current backend for creating pixmaps on wayland */
struct xwl_egl_backend *egl_backend;
struct glamor_context *glamor_ctx;
Atom allow_commits_prop;