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 08:39:03 +0000
commit39332321189191cf1c2450bfc762c91a54c8e6de (patch)
tree1aaa529783272fb21b1a30ec0be2e002582424d1
parent7d1186d507e237d4c19b0ac60a5fa55231e07ff4 (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.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> (cherry picked from commit bdf324871a7f1d924cf23e7311390db64aa6b99d)
-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