Commit 18c05254 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

platforms/drm: fix modifiers detection

CCBUG: 437893


(cherry picked from commit 19f92d73)
parent c04b2aa3
......@@ -66,7 +66,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, const QString &devNode, int fd, dev_t device
}
if (!qEnvironmentVariableIsSet("KWIN_DRM_NO_MODIFIERS")) {
m_addFB2ModifiersSupported = drmGetCap(fd, DRM_CAP_ADDFB2_MODIFIERS, &capability) && capability == 1;
m_addFB2ModifiersSupported = drmGetCap(fd, DRM_CAP_ADDFB2_MODIFIERS, &capability) == 0 && capability == 1;
qCDebug(KWIN_DRM) << "drmModeAddFB2WithModifiers is" << (m_addFB2ModifiersSupported ? "supported" : "not supported");
}
......
......@@ -780,6 +780,9 @@ bool EglGbmBackend::scanout(int screenId, SurfaceItem *surfaceItem)
if (dmabuf->planes()[0].modifier != DRM_FORMAT_MOD_INVALID
|| dmabuf->planes()[0].offset > 0
|| dmabuf->planes().size() > 1) {
if (!m_gpu->addFB2ModifiersSupported()) {
return false;
}
gbm_import_fd_modifier_data data = {};
data.format = dmabuf->format();
data.width = (uint32_t) dmabuf->size().width();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment