If glx is not available try to create egl backend

Summary:
So far the OpenGL is unsafe check functionality in Compositor disabled
OpenGL compositing if glx is not available and we are in standalone X11
mode.

This is technically no longer correct for quite some time. Just because
GLX is not available doesn't mean that OpenGL doesn't work. We have an
EGL backend. So let's try to use that if glx is not available.

This change removes the check completely from Compositor. Instead the
standalone x11 plugin checks whether glx is available prior to createing
the glx backend. If not available it falls through to the egl backend.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1581
This commit is contained in:
Martin Gräßlin 2016-05-10 10:14:53 +02:00
parent ea4de85553
commit 48e69b77d9
2 changed files with 7 additions and 7 deletions

View file

@ -210,12 +210,6 @@ void Compositor::slotCompositingOptionsInitialized()
else {
unsafeConfig.writeEntry(openGLIsUnsafe, true);
unsafeConfig.sync();
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL && !kwinApp()->shouldUseWaylandForCompositing() && !Xcb::Extensions::self()->hasGlx()) {
unsafeConfig.writeEntry(openGLIsUnsafe, false);
unsafeConfig.sync();
qCDebug(KWIN_CORE) << "No glx extensions available";
break;
}
m_scene = SceneOpenGL::createScene(this);

View file

@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "glxbackend.h"
#endif
#include "eglonxbackend.h"
#include "logging.h"
#include "screens_xrandr.h"
#include "options.h"
@ -63,7 +64,12 @@ OpenGLBackend *X11StandalonePlatform::createOpenGLBackend()
switch (options->glPlatformInterface()) {
#if HAVE_EPOXY_GLX
case GlxPlatformInterface:
return new GlxBackend();
if (hasGlx()) {
return new GlxBackend();
} else {
qCWarning(KWIN_X11STANDALONE) << "Glx not available, trying EGL instead.";
// no break, needs fall-through
}
#endif
case EglPlatformInterface:
return new EglOnXBackend();