Commit 77b5c3ca authored by Martin Flöser's avatar Martin Flöser

[platforms/drm] Add support for rotation property on the Plane

Summary:
A preparation step to support rotation of outputs. The idea is to rotate
using DRM directly and not add it to the compositors. With this change
and a small hack to try it, I was able to rotate the screen.

Reviewers: #kwin, #plasma, subdiff

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8582
parent 48590783
......@@ -75,6 +75,7 @@ bool DrmPlane::initProps()
QByteArrayLiteral("CRTC_H"),
QByteArrayLiteral("FB_ID"),
QByteArrayLiteral("CRTC_ID"),
QByteArrayLiteral("rotation")
};
QVector<QByteArray> typeNames = {
......@@ -119,6 +120,11 @@ void DrmPlane::setNext(DrmBuffer *b){
m_next = b;
}
void DrmPlane::setTransformation(Transformations t)
{
setValue(int(PropertyIndex::Rotation), int(t));
}
bool DrmPlane::atomicPopulate(drmModeAtomicReq *req)
{
bool ret = true;
......
......@@ -48,6 +48,7 @@ public:
CrtcH,
FbId,
CrtcId,
Rotation,
Count
};
......@@ -57,7 +58,17 @@ public:
Overlay,
Count
};
enum class Transformation {
Rotate0 = 1 << 0,
Rotate90 = 1 << 1,
Rotate180 = 1 << 2,
Rotate270 = 1 << 3,
ReflectX = 1 << 4,
ReflectY = 1 << 5
};
Q_DECLARE_FLAGS(Transformations, Transformation);
bool atomicInit();
bool initProps();
TypeIndex type();
......@@ -79,6 +90,7 @@ public:
m_current = b;
}
void setNext(DrmBuffer *b);
void setTransformation(Transformations t);
bool atomicPopulate(drmModeAtomicReq *req);
void flipBuffer();
......@@ -97,5 +109,7 @@ private:
}
Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::DrmPlane::Transformations)
#endif
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