eglfs: Fix screen cloning when atomic is enabled

The problem was introduced in the atomic code path only, the legacy
one has always specified the correct crtc id.

Amends 56149c0fbb19946050a3249acef4e86e511d3cd4.

Change-Id: Ie3a99ec4bc24901e1303631097a395fde8dbe110
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 61806a058a17e35f082dfbf59719a9216b2aebf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Laszlo Agocs 2022-07-14 10:58:37 +02:00 committed by Qt Cherry-pick Bot
parent 5aea02c72d
commit 2c2a69498b

View File

@ -324,20 +324,21 @@ void QEglFSKmsGbmScreen::flip()
if (d.screen != this) {
d.screen->ensureModeSet(fb->fb);
d.cloneFlipPending = true;
QKmsOutput &destOutput(d.screen->output());
if (device()->hasAtomicSupport()) {
#if QT_CONFIG(drm_atomic)
drmModeAtomicReq *request = device()->threadLocalAtomicRequest();
if (request) {
drmModeAtomicAddProperty(request, d.screen->output().eglfs_plane->id,
d.screen->output().eglfs_plane->framebufferPropertyId, fb->fb);
drmModeAtomicAddProperty(request, d.screen->output().eglfs_plane->id,
d.screen->output().eglfs_plane->crtcPropertyId, op.crtc_id);
drmModeAtomicAddProperty(request, destOutput.eglfs_plane->id,
destOutput.eglfs_plane->framebufferPropertyId, fb->fb);
drmModeAtomicAddProperty(request, destOutput.eglfs_plane->id,
destOutput.eglfs_plane->crtcPropertyId, destOutput.crtc_id);
}
#endif
} else {
int ret = drmModePageFlip(fd,
d.screen->output().crtc_id,
destOutput.crtc_id,
fb->fb,
DRM_MODE_PAGE_FLIP_EVENT,
d.screen);