summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2016-10-26 13:54:51 +0300
committerEmil Velikov <emil.l.velikov@gmail.com>2016-10-27 11:30:54 +0100
commitd640b0d71b6910e0c8d0bdb7299fe1cb24b0890b (patch)
treeab6445e3252ce06938d7408e2606c89094a05ad1 /src/egl/main
parentd35c4d15121c9bd8d5d8ea4a10356e6be91798c4 (diff)
downloadexternal_mesa3d-d640b0d71b6910e0c8d0bdb7299fe1cb24b0890b.zip
external_mesa3d-d640b0d71b6910e0c8d0bdb7299fe1cb24b0890b.tar.gz
external_mesa3d-d640b0d71b6910e0c8d0bdb7299fe1cb24b0890b.tar.bz2
egl: set preserved behavior for surface only if config supports it
Otherwise we can end up with mismatching behavior between config and surface when client queries surface attributes. As example, configs for DRI3 do not support preserved behavior but here we were setting preserved behavior for pixmap and pbuffer. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326 Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Tested-by: Mark Janes <mark.a.janes@intel.com> (cherry picked from commit 2035930966b05a7c4dd1f6559d66b5a3b41e01a5)
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglsurface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c
index 231a5f0..3af337f 100644
--- a/src/egl/main/eglsurface.c
+++ b/src/egl/main/eglsurface.c
@@ -262,9 +262,13 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
{
const char *func;
EGLint renderBuffer = EGL_BACK_BUFFER;
- EGLint swapBehavior = EGL_BUFFER_PRESERVED;
+ EGLint swapBehavior = EGL_BUFFER_DESTROYED;
EGLint err;
+ /* Swap behavior can be preserved only if config supports this. */
+ if (conf->SurfaceType & EGL_SWAP_BEHAVIOR_PRESERVED_BIT)
+ swapBehavior = EGL_BUFFER_PRESERVED;
+
switch (type) {
case EGL_WINDOW_BIT:
func = "eglCreateWindowSurface";