From 40c485f2a6e3231f2398055987c5497270644e51 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 10 Jun 2021 00:15:03 +0200 Subject: [PATCH] platforms/drm: fix EglStreamBackend init BUG: 438363 --- src/plugins/platforms/drm/egl_stream_backend.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/drm/egl_stream_backend.cpp b/src/plugins/platforms/drm/egl_stream_backend.cpp index 5c3b29be40..6da75c0087 100644 --- a/src/plugins/platforms/drm/egl_stream_backend.cpp +++ b/src/plugins/platforms/drm/egl_stream_backend.cpp @@ -257,6 +257,10 @@ void EglStreamBackend::init() setFailed("Failed to initialize EGL api"); return; } + if (!supportsSurfacelessContext()) { + setFailed("EGL_KHR_surfaceless_context extension is unavailable!"); + return; + } if (!initRenderingContext()) { setFailed("Failed to initialize rendering context"); return; @@ -283,7 +287,7 @@ bool EglStreamBackend::initRenderingContext() { initBufferConfigs(); - if (!createContext()) { + if (!createContext() || !makeCurrent()) { return false; } @@ -291,14 +295,7 @@ bool EglStreamBackend::initRenderingContext() for (DrmOutput *drmOutput : outputs) { addOutput(drmOutput); } - if (m_outputs.isEmpty()) { - qCCritical(KWIN_DRM) << "Failed to create output surface"; - return false; - } - // set our first surface as the one for the abstract backend - setSurface(m_outputs.first().eglSurface); - - return makeContextCurrent(m_outputs.first()); + return true; } bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)