backends/drm: check egl config before creating gbm surface

This commit is contained in:
Xaver Hugl 2022-04-02 02:45:01 +02:00
parent 9d3f77f6f4
commit a23d23593b
2 changed files with 4 additions and 1 deletions

View file

@ -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<DrmPipelineLayer> EglGbmBackend::createDrmPipelineLayer(DrmPipeline *pipeline)

View file

@ -200,6 +200,9 @@ bool EglGbmLayer::createGbmSurface(uint32_t format, const QVector<uint64_t> &mod
const auto size = m_pipeline->bufferSize();
const auto config = m_eglBackend->config(format);
if (config == EGL_NO_CONFIG_KHR) {
return false;
}
QSharedPointer<GbmSurface> gbmSurface;
#if HAVE_GBM_BO_GET_FD_FOR_PLANE