summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel CHAZALLON <longchair@hotmail.com>2018-04-07 10:41:38 +0200
committerLionel CHAZALLON <longchair@hotmail.com>2018-05-03 18:40:42 +0000
commit93cf1cf2e59328f1d969ad1cda5ffd7531c66aef (patch)
tree6f37d232ba970c4ba7c7444e1f5f65fa67ff3d9a
parenteac736e0fbc7f11bbc82901cbf1058562df31f53 (diff)
eglfs/kms: Add drm atomic zpos property handling
This adds the ability to specify a ZPOS property for the eglfs plane ZPOS will allow to control the relative position between eglfs layer and the other layers. It is bound to using QT_QPA_EGLFS_KMS_ZPOS environment variable to determine its value. Change-Id: I51986ccb22a9dbaeef20165ac5feb7dbe8047373 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice.cpp2
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice_p.h1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp4
3 files changed, 7 insertions, 0 deletions
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
index d477d12d72..71422b469b 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp
+++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
@@ -824,6 +824,8 @@ void QKmsDevice::discoverPlanes()
plane.crtcXPropertyId = prop->prop_id;
} else if (!strcasecmp(prop->name, "crtc_y")) {
plane.crtcYPropertyId = prop->prop_id;
+ } else if (!strcasecmp(prop->name, "zpos")) {
+ plane.zposPropertyId = prop->prop_id;
}
});
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
index 5465cad941..403972fbb8 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h
+++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
@@ -177,6 +177,7 @@ struct QKmsPlane
uint32_t srcheightPropertyId = 0;
uint32_t crtcwidthPropertyId = 0;
uint32_t crtcheightPropertyId = 0;
+ uint32_t zposPropertyId = 0;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QKmsPlane::Rotations)
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index c3151e1fd0..0cbb494c2f 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -311,6 +311,10 @@ void QEglFSKmsGbmScreen::flip()
m_output.modes[m_output.mode].hdisplay);
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->crtcheightPropertyId,
m_output.modes[m_output.mode].vdisplay);
+
+ static int zpos = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_ZPOS");
+ if (zpos)
+ drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->zposPropertyId, zpos);
}
#endif
} else {