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>
This commit is contained in:
parent
2ccabf5aa8
commit
ca73cd8a9d
|
@ -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.
|
||||
|
@ -1007,19 +1016,6 @@ xwl_glamor_gbm_has_egl_extension(void)
|
|||
epoxy_has_egl_extension(NULL, "EGL_KHR_platform_gbm"));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 *
|
||||
|
|
Loading…
Reference in New Issue