From a23d23593ba28152a4484e1341b469d2f7f231b8 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Sat, 2 Apr 2022 02:45:01 +0200 Subject: [PATCH] backends/drm: check egl config before creating gbm surface --- src/backends/drm/egl_gbm_backend.cpp | 2 +- src/backends/drm/egl_gbm_layer.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/egl_gbm_backend.cpp b/src/backends/drm/egl_gbm_backend.cpp index a4b40f748e..bdeaa60cc2 100644 --- a/src/backends/drm/egl_gbm_backend.cpp +++ b/src/backends/drm/egl_gbm_backend.cpp @@ -291,7 +291,7 @@ bool EglGbmBackend::prefer10bpc() const EGLConfig EglGbmBackend::config(uint32_t format) const { - return m_configs[format]; + return m_configs.value(format, EGL_NO_CONFIG_KHR); } QSharedPointer EglGbmBackend::createDrmPipelineLayer(DrmPipeline *pipeline) diff --git a/src/backends/drm/egl_gbm_layer.cpp b/src/backends/drm/egl_gbm_layer.cpp index 38f86e3578..37ddeb435c 100644 --- a/src/backends/drm/egl_gbm_layer.cpp +++ b/src/backends/drm/egl_gbm_layer.cpp @@ -200,6 +200,9 @@ bool EglGbmLayer::createGbmSurface(uint32_t format, const QVector &mod const auto size = m_pipeline->bufferSize(); const auto config = m_eglBackend->config(format); + if (config == EGL_NO_CONFIG_KHR) { + return false; + } QSharedPointer gbmSurface; #if HAVE_GBM_BO_GET_FD_FOR_PLANE