[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/D8582icc-effect-5.14.5
parent
48590783fa
commit
77b5c3caa9
|
@ -75,6 +75,7 @@ bool DrmPlane::initProps()
|
||||||
QByteArrayLiteral("CRTC_H"),
|
QByteArrayLiteral("CRTC_H"),
|
||||||
QByteArrayLiteral("FB_ID"),
|
QByteArrayLiteral("FB_ID"),
|
||||||
QByteArrayLiteral("CRTC_ID"),
|
QByteArrayLiteral("CRTC_ID"),
|
||||||
|
QByteArrayLiteral("rotation")
|
||||||
};
|
};
|
||||||
|
|
||||||
QVector<QByteArray> typeNames = {
|
QVector<QByteArray> typeNames = {
|
||||||
|
@ -119,6 +120,11 @@ void DrmPlane::setNext(DrmBuffer *b){
|
||||||
m_next = b;
|
m_next = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrmPlane::setTransformation(Transformations t)
|
||||||
|
{
|
||||||
|
setValue(int(PropertyIndex::Rotation), int(t));
|
||||||
|
}
|
||||||
|
|
||||||
bool DrmPlane::atomicPopulate(drmModeAtomicReq *req)
|
bool DrmPlane::atomicPopulate(drmModeAtomicReq *req)
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
|
@ -48,6 +48,7 @@ public:
|
||||||
CrtcH,
|
CrtcH,
|
||||||
FbId,
|
FbId,
|
||||||
CrtcId,
|
CrtcId,
|
||||||
|
Rotation,
|
||||||
Count
|
Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,7 +58,17 @@ public:
|
||||||
Overlay,
|
Overlay,
|
||||||
Count
|
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 atomicInit();
|
||||||
bool initProps();
|
bool initProps();
|
||||||
TypeIndex type();
|
TypeIndex type();
|
||||||
|
@ -79,6 +90,7 @@ public:
|
||||||
m_current = b;
|
m_current = b;
|
||||||
}
|
}
|
||||||
void setNext(DrmBuffer *b);
|
void setNext(DrmBuffer *b);
|
||||||
|
void setTransformation(Transformations t);
|
||||||
|
|
||||||
bool atomicPopulate(drmModeAtomicReq *req);
|
bool atomicPopulate(drmModeAtomicReq *req);
|
||||||
void flipBuffer();
|
void flipBuffer();
|
||||||
|
@ -97,5 +109,7 @@ private:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::DrmPlane::Transformations)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue