summaryrefslogtreecommitdiff
path: root/hw/xwayland
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2024-03-12 11:09:55 +0100
committerMarge Bot <emma+marge@anholt.net>2024-03-18 15:41:17 +0000
commitca73cd8a9d4fba648601f78027b0099548c796de (patch)
tree3f31ae81f78f62e8dcb2b6f6a2f6240df1ca83da /hw/xwayland
parent2ccabf5aa8b110b8de52fcc74a89e4dcbc91f7fe (diff)
xwayland/glamor: Drop xwl_glamor_gbm_has_wl_interfaces()
And merge it back into xwl_glamor_has_wl_interfaces() Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1386>
Diffstat (limited to 'hw/xwayland')
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.c23
-rw-r--r--hw/xwayland/xwayland-glamor-gbm.h1
-rw-r--r--hw/xwayland/xwayland-glamor.c8
3 files changed, 17 insertions, 15 deletions
diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c
index 7028f9508..dab51e1d9 100644
--- a/hw/xwayland/xwayland-glamor-gbm.c
+++ b/hw/xwayland/xwayland-glamor-gbm.c
@@ -47,6 +47,7 @@
#include "drm-client-protocol.h"
#include "xwayland-glamor.h"
+#include "xwayland-glamor-gbm.h"
#include "xwayland-pixmap.h"
#include "xwayland-screen.h"
@@ -85,6 +86,14 @@ xwl_gbm_get(struct xwl_screen *xwl_screen)
&xwl_gbm_private_key);
}
+Bool
+xwl_glamor_has_wl_drm(struct xwl_screen *xwl_screen)
+{
+ struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
+
+ return !!(xwl_gbm->drm != NULL);
+}
+
/* There is a workaround for Mesa behaviour, which will cause black windows
* when RGBX formats is using. Why exactly? There is an explanation:
* 1. We create GL_RGBA texture with GL_UNSIGNED_BYTE type, all allowed by ES.
@@ -1008,19 +1017,6 @@ xwl_glamor_gbm_has_egl_extension(void)
}
static Bool
-xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen)
-{
- struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
-
- if (xwl_gbm->drm == NULL && xwl_screen->dmabuf_protocol_version < 4) {
- LogMessageVerb(X_INFO, 3, "glamor: 'wl_drm' not supported and linux-dmabuf v4 not supported\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static Bool
xwl_glamor_try_to_make_context_current(struct xwl_screen *xwl_screen)
{
if (xwl_screen->egl_context == EGL_NO_CONTEXT)
@@ -1305,7 +1301,6 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen)
dixSetPrivate(&xwl_screen->screen->devPrivates, &xwl_gbm_private_key,
xwl_gbm);
- xwl_screen->gbm_backend.has_wl_interfaces = xwl_glamor_gbm_has_wl_interfaces;
xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl;
xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen;
xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap;
diff --git a/hw/xwayland/xwayland-glamor-gbm.h b/hw/xwayland/xwayland-glamor-gbm.h
index 411b11aec..125d8a1b5 100644
--- a/hw/xwayland/xwayland-glamor-gbm.h
+++ b/hw/xwayland/xwayland-glamor-gbm.h
@@ -35,5 +35,6 @@
#include "xwayland-types.h"
void xwl_glamor_init_gbm(struct xwl_screen *xwl_screen);
+Bool xwl_glamor_has_wl_drm(struct xwl_screen *xwl_screen);
#endif /* XWAYLAND_GLAMOR_GBM_H */
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 42a5ea820..d518bfb90 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -121,7 +121,13 @@ Bool
xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen,
struct xwl_egl_backend *xwl_egl_backend)
{
- return xwl_egl_backend->has_wl_interfaces(xwl_screen);
+ if (!xwl_glamor_has_wl_drm(xwl_screen) &&
+ xwl_screen->dmabuf_protocol_version < 4) {
+ LogMessageVerb(X_INFO, 3, "glamor: 'wl_drm' not supported and linux-dmabuf v4 not supported\n");
+ return FALSE;
+ }
+
+ return TRUE;
}
struct wl_buffer *