xwayland/glamor: Make xwl_glamor_init_gbm() return its status

This is a preliminary step to remove the backend's field "is_available".

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:14:55 +01:00 committed by Marge Bot
parent 63e2f98f0a
commit 5df6a1e969
2 changed files with 6 additions and 8 deletions

View File

@ -1283,27 +1283,25 @@ drmDevice *xwl_gbm_get_main_device(struct xwl_screen *xwl_screen)
return xwl_gbm->device;
}
void
Bool
xwl_glamor_init_gbm(struct xwl_screen *xwl_screen)
{
struct xwl_gbm_private *xwl_gbm;
xwl_screen->gbm_backend.is_available = FALSE;
if (!xwl_glamor_gbm_has_egl_extension())
return;
return FALSE;
if (!dixRegisterPrivateKey(&xwl_gbm_private_key, PRIVATE_SCREEN, 0))
return;
return FALSE;
xwl_gbm = calloc(sizeof(*xwl_gbm), 1);
if (!xwl_gbm) {
ErrorF("glamor: Not enough memory to setup GBM, disabling\n");
return;
return FALSE;
}
dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key,
xwl_gbm);
xwl_screen->gbm_backend.is_available = TRUE;
return TRUE;
}

View File

@ -36,7 +36,7 @@
#include "xwayland-types.h"
void xwl_glamor_init_gbm(struct xwl_screen *xwl_screen);
Bool xwl_glamor_init_gbm(struct xwl_screen *xwl_screen);
Bool xwl_glamor_has_wl_drm(struct xwl_screen *xwl_screen);
Bool xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen);
Bool xwl_glamor_gbm_init_screen(struct xwl_screen *xwl_screen);