summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2024-03-04 17:53:23 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-06 06:35:20 +0000
commitbdf324871a7f1d924cf23e7311390db64aa6b99d (patch)
treeec7ba11412728c7e5f4a9ee5e4ac74438044f5b0
parente3b2386dd7d3078b398c76a2715e3ff318223982 (diff)
drm: Fix having more than window over the screen's lifetime
...when not using atomic. On the non-atmic path the fb is passed in to drmModeSetCrtc. Here we need a new call to it if a new QWindow gets created after the previous one is destroyed. Previously this was not done, so it ended up with Device busy errors. Atomic does not need this since there the flip commit always contains framebufferPropertyId. Change-Id: Ie68152cad50438807ef45adfba65e74c8f30c956 Fixes: QTBUG-122663 Pick-to: 6.6 6.5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 818f8de64a2b1a7371ecb4bdd527b05343190582) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp8
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen_p.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index 336ee9c312..073ba3bdcc 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -184,6 +184,11 @@ void QEglFSKmsGbmScreen::resetSurface()
// still do its work, when called. Otherwise we end up
// in device-is-busy errors if there is a new QWindow
// created afterwards. (QTBUG-122663)
+
+ // If not using atomic, will need a new drmModeSetCrtc if a new window
+ // gets created later on (and so there's a new fb).
+ if (!device()->hasAtomicSupport())
+ needsNewModeSetForNextFb = true;
}
void QEglFSKmsGbmScreen::initCloning(QPlatformScreen *screenThisScreenClones,
@@ -213,8 +218,9 @@ void QEglFSKmsGbmScreen::ensureModeSet(uint32_t fb)
QKmsOutput &op(output());
const int fd = device()->fd();
- if (!op.mode_set) {
+ if (!op.mode_set || needsNewModeSetForNextFb) {
op.mode_set = true;
+ needsNewModeSetForNextFb = false;
bool doModeSet = true;
drmModeCrtcPtr currentMode = drmModeGetCrtc(fd, op.crtc_id);
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen_p.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen_p.h
index 3660f094d2..aca34fcae2 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen_p.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen_p.h
@@ -83,6 +83,8 @@ protected:
bool cloneFlipPending = false;
};
QList<CloneDestination> m_cloneDests;
+
+ bool needsNewModeSetForNextFb = false;
};
QT_END_NAMESPACE