xwayland: add detection for drivers that don't support implicit sync
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
This commit is contained in:
parent
c5e88238f2
commit
89c327f263
|
@ -62,6 +62,7 @@ struct xwl_gbm_private {
|
||||||
Bool drm_authenticated;
|
Bool drm_authenticated;
|
||||||
Bool dmabuf_capable;
|
Bool dmabuf_capable;
|
||||||
Bool glamor_gles;
|
Bool glamor_gles;
|
||||||
|
Bool implicit_sync;
|
||||||
|
|
||||||
/* Set if wl_drm is available */
|
/* Set if wl_drm is available */
|
||||||
struct wl_drm *drm;
|
struct wl_drm *drm;
|
||||||
|
@ -1020,6 +1021,14 @@ xwl_glamor_gbm_has_egl_extension(void)
|
||||||
epoxy_has_egl_extension(NULL, "EGL_KHR_platform_gbm"));
|
epoxy_has_egl_extension(NULL, "EGL_KHR_platform_gbm"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
xwl_glamor_supports_implicit_sync(struct xwl_screen *xwl_screen)
|
||||||
|
{
|
||||||
|
/* absent glamor, implicit sync is irrelevant so just return TRUE */
|
||||||
|
return !xwl_screen->glamor ||
|
||||||
|
xwl_gbm_get(xwl_screen)->implicit_sync;
|
||||||
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
xwl_glamor_try_to_make_context_current(struct xwl_screen *xwl_screen)
|
xwl_glamor_try_to_make_context_current(struct xwl_screen *xwl_screen)
|
||||||
{
|
{
|
||||||
|
@ -1164,7 +1173,7 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
|
||||||
struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
|
struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
|
||||||
EGLint major, minor;
|
EGLint major, minor;
|
||||||
const GLubyte *renderer;
|
const GLubyte *renderer;
|
||||||
const char *gbm_backend_name;
|
const char *gbm_backend_name, *egl_vendor;
|
||||||
|
|
||||||
if (!xwl_gbm->drm && !xwl_glamor_gbm_init_main_dev(xwl_screen))
|
if (!xwl_gbm->drm && !xwl_glamor_gbm_init_main_dev(xwl_screen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1229,6 +1238,14 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
|
||||||
xwl_screen->glvnd_vendor = gbm_backend_name;
|
xwl_screen->glvnd_vendor = gbm_backend_name;
|
||||||
xwl_gbm->glamor_gles = !epoxy_is_desktop_gl();
|
xwl_gbm->glamor_gles = !epoxy_is_desktop_gl();
|
||||||
|
|
||||||
|
egl_vendor = eglQueryString(xwl_screen->egl_display, EGL_VENDOR);
|
||||||
|
if (!egl_vendor) {
|
||||||
|
ErrorF("Could not determine EGL vendor\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
/* NVIDIA driver does not support implicit sync */
|
||||||
|
xwl_gbm->implicit_sync = !strstr(egl_vendor, "NVIDIA");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
error:
|
error:
|
||||||
if (xwl_screen->egl_display != EGL_NO_DISPLAY) {
|
if (xwl_screen->egl_display != EGL_NO_DISPLAY) {
|
||||||
|
|
|
@ -57,6 +57,7 @@ void xwl_glamor_init_wl_registry(struct xwl_screen *xwl_screen,
|
||||||
void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
|
void xwl_glamor_egl_make_current(struct xwl_screen *xwl_screen);
|
||||||
Bool xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap);
|
Bool xwl_glamor_check_flip(WindowPtr present_window, PixmapPtr pixmap);
|
||||||
PixmapPtr xwl_glamor_create_pixmap_for_window (struct xwl_window *xwl_window);
|
PixmapPtr xwl_glamor_create_pixmap_for_window (struct xwl_window *xwl_window);
|
||||||
|
Bool xwl_glamor_supports_implicit_sync(struct xwl_screen *xwl_screen);
|
||||||
|
|
||||||
#ifdef XV
|
#ifdef XV
|
||||||
/* glamor Xv Adaptor */
|
/* glamor Xv Adaptor */
|
||||||
|
|
Loading…
Reference in New Issue