platforms/drm: fix modifiers detection
CCBUG: 437893
This commit is contained in:
parent
471d635f0c
commit
19f92d731a
2 changed files with 4 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -783,6 +783,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();
|
||||
|
|
Loading…
Reference in a new issue