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 56149c0fbb.

Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie3a99ec4bc24901e1303631097a395fde8dbe110
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2022-07-14 10:58:37 +02:00
parent 5b334729d3
commit 61806a058a

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);