From 3160cb86aa9234ff78e11fe7a00f30bfb5cb8445 Mon Sep 17 00:00:00 2001 From: Louis-Francis Ratté-Boulianne Date: Fri, 6 Oct 2017 01:26:51 -0400 Subject: egl/x11: Re-allocate buffers if format is suboptimal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If PresentCompleteNotify event says the pixmap was presented with mode PresentCompleteModeSuboptimalCopy, it means the pixmap could possibly have been flipped instead if allocated with a different format/modifier. Signed-off-by: Louis-Francis Ratté-Boulianne Reviewed-by: Daniel Stone --- src/egl/drivers/dri2/egl_dri2.c | 2 ++ src/egl/drivers/dri2/egl_dri2.h | 2 ++ src/egl/drivers/dri2/platform_x11_dri3.c | 3 +++ 3 files changed, 7 insertions(+) (limited to 'src/egl/drivers') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 1bd57c9ea31..864f7eb0c68 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -885,6 +885,8 @@ dri2_setup_extensions(_EGLDisplay *disp) dri2_dpy->multibuffers_available = (dri2_dpy->dri3_major_version > 1 || (dri2_dpy->dri3_major_version == 1 && dri2_dpy->dri3_minor_version >= 2)) && + (dri2_dpy->present_major_version > 1 || (dri2_dpy->present_major_version == 1 && + dri2_dpy->present_minor_version >= 2)) && (dri2_dpy->image && dri2_dpy->image->base.version >= 15); #endif diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 00c4768d421..bd637f73c9d 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -202,6 +202,8 @@ struct dri2_egl_display bool multibuffers_available; int dri3_major_version; int dri3_minor_version; + int present_major_version; + int present_minor_version; struct loader_dri3_extensions loader_dri3_ext; #endif #endif diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c index c1efa930159..dce33561a6f 100644 --- a/src/egl/drivers/dri2/platform_x11_dri3.c +++ b/src/egl/drivers/dri2/platform_x11_dri3.c @@ -565,6 +565,9 @@ dri3_x11_connect(struct dri2_egl_display *dri2_dpy) free(error); return EGL_FALSE; } + + dri2_dpy->present_major_version = present_query->major_version; + dri2_dpy->present_minor_version = present_query->minor_version; free(present_query); dri2_dpy->fd = loader_dri3_open(dri2_dpy->conn, dri2_dpy->screen->root, 0); -- cgit v1.2.3