summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-08-08 12:06:40 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2016-08-10 09:04:42 +0000
commite93042522817003f35402adea83b8a537dba7c87 (patch)
treeae339280b826f2574071a9afe33bcf9bbe47ff99 /src
parentaf7b4e3f5564f8a47c4ca14c543d74c5684238ee (diff)
eglfs: Fix QT_QPA_EGLFS_ROTATION with the KMS/DRM screeen
It overrides geometry(). Change-Id: I93c607567d7cb688221d200dcd47c1a6ba23b26b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
index addcb366eb..fb8233a875 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.cpp
@@ -101,9 +101,29 @@ QEglFSKmsScreen::~QEglFSKmsScreen()
QRect QEglFSKmsScreen::geometry() const
{
const int mode = m_output.mode;
- return QRect(m_pos.x(), m_pos.y(),
- m_output.modes[mode].hdisplay,
- m_output.modes[mode].vdisplay);
+ QRect r(m_pos.x(), m_pos.y(),
+ m_output.modes[mode].hdisplay,
+ m_output.modes[mode].vdisplay);
+
+ static int rotation = qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION");
+ switch (rotation) {
+ case 0:
+ case 180:
+ case -180:
+ break;
+ case 90:
+ case -90: {
+ int h = r.height();
+ r.setHeight(r.width());
+ r.setWidth(h);
+ break;
+ }
+ default:
+ qWarning("Invalid rotation %d specified in QT_QPA_EGLFS_ROTATION", rotation);
+ break;
+ }
+
+ return r;
}
int QEglFSKmsScreen::depth() const