From ac32664dc1356189d6a40923ecb2a6c392b0d9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 17 Jul 2013 15:44:42 +0200 Subject: [PATCH] keep buffer swap pref automatic until GPU detected enforce to "e" (cheap) when driver is still unknown after detection must be assumed to have run, so a sane value is available when the context is up BUG: 322355 FIXED-IN: 4.11 REVIEW: 111548 --- eglonxbackend.cpp | 3 +++ glxbackend.cpp | 3 +++ options.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 86c763eb08..9af3c0d507 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -74,6 +74,9 @@ void EglOnXBackend::init() glPlatform->detect(EglPlatformInterface); if (GLPlatform::instance()->driver() == Driver_Intel) options->setUnredirectFullscreen(false); // bug #252817 + options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // resolve autosetting + if (options->glPreferBufferSwap() == Options::AutoSwapStrategy) + options->setGlPreferBufferSwap('e'); // for unknown drivers - should not happen glPlatform->printResults(); initGL(EglPlatformInterface); if (!hasGLExtension("GL_OES_EGL_image")) { diff --git a/glxbackend.cpp b/glxbackend.cpp index 7f2449cfe4..11f7017bf5 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -97,6 +97,9 @@ void GlxBackend::init() glPlatform->detect(GlxPlatformInterface); if (GLPlatform::instance()->driver() == Driver_Intel) options->setUnredirectFullscreen(false); // bug #252817 + options->setGlPreferBufferSwap(options->glPreferBufferSwap()); // resolve autosetting + if (options->glPreferBufferSwap() == Options::AutoSwapStrategy) + options->setGlPreferBufferSwap('e'); // for unknown drivers - should not happen glPlatform->printResults(); initGL(GlxPlatformInterface); // Check whether certain features are supported diff --git a/options.cpp b/options.cpp index cd3931cd8d..8f6a21f474 100644 --- a/options.cpp +++ b/options.cpp @@ -767,7 +767,7 @@ void Options::setGlPreferBufferSwap(char glPreferBufferSwap) // see http://www.x.org/releases/X11R7.7/doc/dri2proto/dri2proto.txt, item 2.5 if (GLPlatform::instance()->driver() == Driver_NVidia) glPreferBufferSwap = CopyFrontBuffer; - else + else if (GLPlatform::instance()->driver() != Driver_Unknown) // undetected, finally resolved when context is initialized glPreferBufferSwap = ExtendDamage; } if (m_glPreferBufferSwap == (GlSwapStrategy)glPreferBufferSwap) {