diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-12-02 10:39:35 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-12-03 00:06:21 +0000 |
commit | f30b88846566bc1254e5e6d61077092cdaeba409 (patch) | |
tree | 2b5041bbf2fd7913617b60e2cd5ecfc9955006ff /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp | |
parent | 8d0854c2bd7cf371883726cacb3f8c8549a11eac (diff) |
eglfs: allow forcing an overlay plane
Add a QT_QPA_EGLFS_KMS_PLANE_INDEX environment variable that applies
both to the GBM and EGLDevice backends. When set to a value between 0 and
the number of planes on the connector - 1, the chosen overlay plane will
be used for output, meaning there will be a drmModeSetPlane to configure,
and, in case of EGLDevice, the plane's corresponding EGL layer will get
chosen instead of the CRTC's.
Task-number: QTBUG-57386
Change-Id: I12c89472ea5730987052f39211fadc597d1302ef
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp index b443a724ec..cf1de71831 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp @@ -39,11 +39,11 @@ ****************************************************************************/ #include "qeglfskmsegldeviceintegration.h" +#include "qeglfskmsegldevice.h" +#include "qeglfskmsegldevicescreen.h" #include <QtEglSupport/private/qeglconvenience_p.h> #include "private/qeglfswindow_p.h" #include "private/qeglfscursor_p.h" -#include "qeglfskmsegldevice.h" -#include "qeglfskmsscreen.h" #include <QLoggingCategory> #include <private/qmath_p.h> @@ -171,20 +171,23 @@ void QEglJetsonTK1Window::resetSurface() return; } - QEglFSKmsScreen *cur_screen = static_cast<QEglFSKmsScreen*>(screen()); + QEglFSKmsEglDeviceScreen *cur_screen = static_cast<QEglFSKmsEglDeviceScreen *>(screen()); Q_ASSERT(cur_screen); - qCDebug(qLcEglfsKmsDebug, "Searching for id: %d", cur_screen->output().crtc_id); + QEglFSKmsOutput &output(cur_screen->output()); + const uint32_t wantedId = !output.wants_plane ? output.crtc_id : output.plane_id; + qCDebug(qLcEglfsKmsDebug, "Searching for id: %d", wantedId); EGLOutputLayerEXT layer = EGL_NO_OUTPUT_LAYER_EXT; for (int i = 0; i < actualCount; ++i) { EGLAttrib id; if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_CRTC_EXT, &id)) { qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - crtc %d", i, layers[i], (int) id); - if (id == EGLAttrib(cur_screen->output().crtc_id)) + if (id == EGLAttrib(wantedId)) layer = layers[i]; } else if (m_integration->m_funcs->query_output_layer_attrib(display, layers[i], EGL_DRM_PLANE_EXT, &id)) { - // Not used yet, just for debugging. qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - plane %d", i, layers[i], (int) id); + if (id == EGLAttrib(wantedId)) + layer = layers[i]; } else { qCDebug(qLcEglfsKmsDebug, " [%d] layer %p - unknown", i, layers[i]); } |