From a14998b790cb3261cfb42d2f309412aa0c9e2e2d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 15 Dec 2022 18:08:32 +0200 Subject: [PATCH] backends/wayland: Port away from gbm_bo_create_with_modifiers2() gbm_bo_create_with_modifiers2() is quite new and there are still distros that ship 21.2 and older. --- src/backends/wayland/wayland_egl_backend.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/backends/wayland/wayland_egl_backend.cpp b/src/backends/wayland/wayland_egl_backend.cpp index 73cfd618e5..4b54674cd0 100644 --- a/src/backends/wayland/wayland_egl_backend.cpp +++ b/src/backends/wayland/wayland_egl_backend.cpp @@ -49,20 +49,21 @@ WaylandEglLayerBuffer::WaylandEglLayerBuffer(const QSize &size, uint32_t format, { gbm_device *gbmDevice = backend->backend()->gbmDevice(); - if (modifiers.isEmpty()) { + if (!modifiers.isEmpty()) { + m_bo = gbm_bo_create_with_modifiers(gbmDevice, + size.width(), + size.height(), + format, + modifiers.constData(), + modifiers.size()); + } + + if (!m_bo) { m_bo = gbm_bo_create(gbmDevice, size.width(), size.height(), format, GBM_BO_USE_RENDERING); - } else { - m_bo = gbm_bo_create_with_modifiers2(gbmDevice, - size.width(), - size.height(), - format, - modifiers.constData(), - modifiers.size(), - GBM_BO_USE_RENDERING); } if (!m_bo) {