xwayland: move EGL backend init to glamor
Move EGL backends initialization to its own function in
xwayland-glamor.c
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 48f037a27c
)
This commit is contained in:
parent
8ffee3a6bd
commit
cb698ec2ba
|
@ -162,6 +162,23 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xwl_glamor_init_backends(struct xwl_screen *xwl_screen, Bool use_eglstream)
|
||||||
|
{
|
||||||
|
#ifdef XWL_HAS_EGLSTREAM
|
||||||
|
if (use_eglstream) {
|
||||||
|
if (!xwl_glamor_init_eglstream(xwl_screen)) {
|
||||||
|
ErrorF("xwayland glamor: failed to setup EGLStream backend\n");
|
||||||
|
use_eglstream = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!use_eglstream && !xwl_glamor_init_gbm(xwl_screen)) {
|
||||||
|
ErrorF("xwayland glamor: failed to setup GBM backend, falling back to sw accel\n");
|
||||||
|
xwl_screen->glamor = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xwl_glamor_init(struct xwl_screen *xwl_screen)
|
xwl_glamor_init(struct xwl_screen *xwl_screen)
|
||||||
{
|
{
|
||||||
|
|
|
@ -992,20 +992,8 @@ 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)
|
||||||
#ifdef XWL_HAS_EGLSTREAM
|
xwl_glamor_init_backends(xwl_screen, use_eglstreams);
|
||||||
if (use_eglstreams) {
|
|
||||||
if (!xwl_glamor_init_eglstream(xwl_screen)) {
|
|
||||||
ErrorF("xwayland glamor: failed to setup EGLStream backend\n");
|
|
||||||
use_eglstreams = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!use_eglstreams && !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
|
#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
|
||||||
|
|
|
@ -423,6 +423,8 @@ Bool xwl_shm_destroy_pixmap(PixmapPtr pixmap);
|
||||||
struct wl_buffer *xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap);
|
struct wl_buffer *xwl_shm_pixmap_get_wl_buffer(PixmapPtr pixmap);
|
||||||
|
|
||||||
#ifdef XWL_HAS_GLAMOR
|
#ifdef XWL_HAS_GLAMOR
|
||||||
|
void xwl_glamor_init_backends(struct xwl_screen *xwl_screen,
|
||||||
|
Bool use_eglstream);
|
||||||
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,
|
||||||
|
|
Loading…
Reference in New Issue