Use glamor_xv_core_init() returned value to disable Xv support early if glamor-xv is not usable.
Signed-off-by: Olivier Fourdan <ofour...@redhat.com> Fixes: https://bugzilla.redhat.com/1412814 --- hw/xwayland/xwayland-glamor-xv.c | 3 ++- hw/xwayland/xwayland-glamor.c | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/xwayland/xwayland-glamor-xv.c b/hw/xwayland/xwayland-glamor-xv.c index 65f93c6..48c93de 100644 --- a/hw/xwayland/xwayland-glamor-xv.c +++ b/hw/xwayland/xwayland-glamor-xv.c @@ -406,7 +406,8 @@ xwl_glamor_xv_init(ScreenPtr pScreen) xwlXvScreen->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xwl_glamor_xv_close_screen; - glamor_xv_core_init(pScreen); + if (!glamor_xv_core_init(pScreen)) + return FALSE; return xwl_glamor_xv_add_adaptors(pScreen); } diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 63f2303..b085efb 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -249,6 +249,12 @@ xwl_glamor_create_screen_resources(ScreenPtr screen) SetRootClip(screen, xwl_screen->root_clip_mode); + /* xwl_glamor_xv_init() needs screen resources */ +#ifdef XV + if (!xwl_glamor_xv_init(screen)) + ErrorF("Failed to initialize glamor Xv extension\n"); +#endif + return screen->devPrivate != NULL; } @@ -614,10 +620,5 @@ xwl_glamor_init(struct xwl_screen *xwl_screen) screen->CreatePixmap = xwl_glamor_create_pixmap; screen->DestroyPixmap = xwl_glamor_destroy_pixmap; -#ifdef XV - if (!xwl_glamor_xv_init(screen)) - ErrorF("Failed to initialize glamor Xv extension\n"); -#endif - return TRUE; } -- 2.9.3 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel