summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <[email protected]>2017-10-06 01:26:51 -0400
committerDaniel Stone <[email protected]>2018-03-09 17:47:14 +0000
commit3160cb86aa9234ff78e11fe7a00f30bfb5cb8445 (patch)
tree0fd309687b78213936bc5a5cd81efd021e25d162 /src/egl/drivers
parent069fdd5f9facbd72fb6a289696c7b74e3237e70f (diff)
egl/x11: Re-allocate buffers if format is suboptimal
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 <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl/drivers')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c2
-rw-r--r--src/egl/drivers/dri2/egl_dri2.h2
-rw-r--r--src/egl/drivers/dri2/platform_x11_dri3.c3
3 files changed, 7 insertions, 0 deletions
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);