diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index 6618a0a34..d25f85d65 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -40,6 +40,8 @@ #include "linux-dmabuf-unstable-v1-client-protocol.h" #include "linux-drm-syncobj-v1-client-protocol.h" +#include "mi/mi_priv.h" + #include "xwayland-dmabuf.h" #include "xwayland-glamor.h" #include "xwayland-glamor-gbm.h" @@ -141,15 +143,9 @@ static Bool xwl_glamor_create_screen_resources(ScreenPtr screen) { struct xwl_screen *xwl_screen = xwl_screen_get(screen); - int ret; - screen->CreateScreenResources = xwl_screen->CreateScreenResources; - ret = (*screen->CreateScreenResources) (screen); - xwl_screen->CreateScreenResources = screen->CreateScreenResources; - screen->CreateScreenResources = xwl_glamor_create_screen_resources; - - if (!ret) - return ret; + if (!miCreateScreenResources(screen)) + return FALSE; if (xwl_screen->rootless) { screen->devPrivate = @@ -254,7 +250,6 @@ xwl_glamor_init(struct xwl_screen *xwl_screen) return FALSE; } - xwl_screen->CreateScreenResources = screen->CreateScreenResources; screen->CreateScreenResources = xwl_glamor_create_screen_resources; #ifdef XV diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 308879213..b462cc7ce 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -1123,7 +1123,6 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) xwl_screen->present = xwl_present_init(pScreen); if (!xwl_screen->glamor) { - xwl_screen->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = xwl_shm_create_screen_resources; pScreen->CreatePixmap = xwl_shm_create_pixmap; pScreen->DestroyPixmap = xwl_shm_destroy_pixmap; diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h index 49a167a12..7db6d3c87 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h @@ -69,7 +69,6 @@ struct xwl_screen { int hidpi; ClipNotifyProcPtr ClipNotify; - CreateScreenResourcesProcPtr CreateScreenResources; CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; RealizeWindowProcPtr RealizeWindow; diff --git a/hw/xwayland/xwayland-shm.c b/hw/xwayland/xwayland-shm.c index faca5224e..09844ee04 100644 --- a/hw/xwayland/xwayland-shm.c +++ b/hw/xwayland/xwayland-shm.c @@ -36,6 +36,7 @@ #include #include +#include "mi/mi_priv.h" #include "os/osdep.h" #include "fb.h" @@ -351,15 +352,9 @@ Bool xwl_shm_create_screen_resources(ScreenPtr screen) { struct xwl_screen *xwl_screen = xwl_screen_get(screen); - int ret; - screen->CreateScreenResources = xwl_screen->CreateScreenResources; - ret = (*screen->CreateScreenResources) (screen); - xwl_screen->CreateScreenResources = screen->CreateScreenResources; - screen->CreateScreenResources = xwl_shm_create_screen_resources; - - if (!ret) - return ret; + if (!miCreateScreenResources(screen)) + return FALSE; if (xwl_screen->rootless) screen->devPrivate =