xwayland: call miCreateScreenResources() directly

No need for complicated wrapping/unwrapping: it's always just
miCreateResources() anyway - so we can call it directly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-02 15:24:27 +02:00
parent fbc1300cbc
commit c839203c8c
4 changed files with 7 additions and 19 deletions

View File

@ -42,6 +42,8 @@
#include "linux-dmabuf-unstable-v1-client-protocol.h" #include "linux-dmabuf-unstable-v1-client-protocol.h"
#include "linux-drm-syncobj-v1-client-protocol.h" #include "linux-drm-syncobj-v1-client-protocol.h"
#include "mi/mi_priv.h"
#include "xwayland-dmabuf.h" #include "xwayland-dmabuf.h"
#include "xwayland-glamor.h" #include "xwayland-glamor.h"
#include "xwayland-glamor-gbm.h" #include "xwayland-glamor-gbm.h"
@ -143,15 +145,9 @@ static Bool
xwl_glamor_create_screen_resources(ScreenPtr screen) xwl_glamor_create_screen_resources(ScreenPtr screen)
{ {
struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_screen *xwl_screen = xwl_screen_get(screen);
int ret;
screen->CreateScreenResources = xwl_screen->CreateScreenResources; if (!miCreateScreenResources(screen))
ret = (*screen->CreateScreenResources) (screen); return FALSE;
xwl_screen->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = xwl_glamor_create_screen_resources;
if (!ret)
return ret;
if (xwl_screen->rootless) { if (xwl_screen->rootless) {
screen->devPrivate = screen->devPrivate =
@ -256,7 +252,6 @@ xwl_glamor_init(struct xwl_screen *xwl_screen)
return FALSE; return FALSE;
} }
xwl_screen->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = xwl_glamor_create_screen_resources; screen->CreateScreenResources = xwl_glamor_create_screen_resources;
#ifdef XV #ifdef XV

View File

@ -1125,7 +1125,6 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->present = xwl_present_init(pScreen); xwl_screen->present = xwl_present_init(pScreen);
if (!xwl_screen->glamor) { if (!xwl_screen->glamor) {
xwl_screen->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = xwl_shm_create_screen_resources; pScreen->CreateScreenResources = xwl_shm_create_screen_resources;
pScreen->CreatePixmap = xwl_shm_create_pixmap; pScreen->CreatePixmap = xwl_shm_create_pixmap;
pScreen->DestroyPixmap = xwl_shm_destroy_pixmap; pScreen->DestroyPixmap = xwl_shm_destroy_pixmap;

View File

@ -69,7 +69,6 @@ struct xwl_screen {
int hidpi; int hidpi;
ClipNotifyProcPtr ClipNotify; ClipNotifyProcPtr ClipNotify;
CreateScreenResourcesProcPtr CreateScreenResources;
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
ConfigNotifyProcPtr ConfigNotify; ConfigNotifyProcPtr ConfigNotify;
RealizeWindowProcPtr RealizeWindow; RealizeWindowProcPtr RealizeWindow;

View File

@ -36,6 +36,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "mi/mi_priv.h"
#include "os/osdep.h" #include "os/osdep.h"
#include "fb.h" #include "fb.h"
@ -351,15 +352,9 @@ Bool
xwl_shm_create_screen_resources(ScreenPtr screen) xwl_shm_create_screen_resources(ScreenPtr screen)
{ {
struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_screen *xwl_screen = xwl_screen_get(screen);
int ret;
screen->CreateScreenResources = xwl_screen->CreateScreenResources; if (!miCreateScreenResources(screen))
ret = (*screen->CreateScreenResources) (screen); return FALSE;
xwl_screen->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = xwl_shm_create_screen_resources;
if (!ret)
return ret;
if (xwl_screen->rootless) if (xwl_screen->rootless)
screen->devPrivate = screen->devPrivate =