From e59f50e599c534671063cb0b05817fe2a121211c Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 2 Sep 2021 15:54:22 +0200 Subject: [PATCH] platforms/drm: adjust how transforms are set Instead of using setTransformInternal directly, have DrmOutput set it in updateTransform, like with the other setters. Also use updateTransform instead of setTransformInternal in DrmBackend, so that hardware rotation can be used where possible. --- src/abstract_wayland_output.cpp | 1 - src/plugins/platforms/drm/drm_backend.cpp | 4 ++-- src/plugins/platforms/drm/drm_output.cpp | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abstract_wayland_output.cpp b/src/abstract_wayland_output.cpp index 11b6996fe0..0e53bcd474 100644 --- a/src/abstract_wayland_output.cpp +++ b/src/abstract_wayland_output.cpp @@ -169,7 +169,6 @@ void AbstractWaylandOutput::applyChanges(const KWaylandServer::OutputChangeSetV2 if (changeSet->transformChanged()) { qCDebug(KWIN_CORE) << "Server setting transform: " << (int)(changeSet->transform()); auto transform = outputDeviceTransformToKWinTransform(changeSet->transform()); - setTransformInternal(transform); updateTransform(transform); emitModeChanged = true; } diff --git a/src/plugins/platforms/drm/drm_backend.cpp b/src/plugins/platforms/drm/drm_backend.cpp index 44759ee816..5d46e66f9a 100644 --- a/src/plugins/platforms/drm/drm_backend.cpp +++ b/src/plugins/platforms/drm/drm_backend.cpp @@ -502,7 +502,7 @@ void DrmBackend::readOutputsConfiguration() if (const QJsonValue scale = outputInfo["scale"]; !scale.isUndefined()) { (*it)->setScale(scale.toDouble(1.)); } - (*it)->setTransformInternal(KWinKScreenIntegration::toDrmTransform(outputInfo["rotation"].toInt())); + (*it)->updateTransform(KWinKScreenIntegration::toDrmTransform(outputInfo["rotation"].toInt())); if (const QJsonObject mode = outputInfo["mode"].toObject(); !mode.isEmpty()) { const QJsonObject size = mode["size"].toObject(); @@ -510,7 +510,7 @@ void DrmBackend::readOutputsConfiguration() } } else { (*it)->moveTo(pos); - (*it)->setTransformInternal(DrmOutput::Transform::Normal); + (*it)->updateTransform(DrmOutput::Transform::Normal); } pos.setX(pos.x() + (*it)->geometry().width()); } diff --git a/src/plugins/platforms/drm/drm_output.cpp b/src/plugins/platforms/drm/drm_output.cpp index 11867dcda1..a38dc8f92f 100644 --- a/src/plugins/platforms/drm/drm_output.cpp +++ b/src/plugins/platforms/drm/drm_output.cpp @@ -305,6 +305,7 @@ DrmPlane::Transformations outputToPlaneTransform(DrmOutput::Transform transform) void DrmOutput::updateTransform(Transform transform) { + setTransformInternal(transform); const auto planeTransform = outputToPlaneTransform(transform); if (!qEnvironmentVariableIsSet("KWIN_DRM_SW_ROTATIONS_ONLY") && !m_pipeline->setTransformation(planeTransform)) {