[platforms/drm] Refactor updateTransform

Summary:
Small intermediate refactor. For now just do the normal rotation when a flipped
transform is requested. In the future we might want to provide the possibility
to flip the output image.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25649
remotes/origin/apol/tablet-unstable-v2
Roman Gilg 6 years ago
parent f21f61db38
commit 47306865a7
  1. 41
      plugins/platforms/drm/drm_output.cpp

@ -651,41 +651,36 @@ bool DrmOutput::dpmsLegacyApply()
void DrmOutput::updateTransform(Transform transform)
{
DrmPlane::Transformation planeTransform;
// TODO: Do we want to support reflections (flips)?
switch (transform) {
case Transform::Normal:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate0);
}
break;
case Transform::Rotated90:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate90);
}
break;
case Transform::Rotated180:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate180);
}
break;
case Transform::Rotated270:
if (m_primaryPlane) {
m_primaryPlane->setTransformation(DrmPlane::Transformation::Rotate270);
}
break;
case Transform::Flipped:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate0;
break;
case Transform::Rotated90:
case Transform::Flipped90:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate90;
break;
case Transform::Rotated180:
case Transform::Flipped180:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate180;
break;
case Transform::Rotated270:
case Transform::Flipped270:
// TODO: what is this exactly?
planeTransform = DrmPlane::Transformation::Rotate270;
break;
default:
Q_UNREACHABLE();
}
if (m_primaryPlane) {
m_primaryPlane->setTransformation(planeTransform);
}
m_modesetRequested = true;
// the cursor might need to get rotated
updateCursor();
showCursor();

Loading…
Cancel
Save