From 2c7727a225c3140cfe70369610a919b6f1c9bba8 Mon Sep 17 00:00:00 2001 From: Lionel CHAZALLON Date: Sun, 18 Mar 2018 10:04:55 +0100 Subject: eglfs/kms: make sure eglfs plane is always consistent We need to make sure we update the eglfs plane properly even when we are forcing the rendering plane index. Change-Id: I0cd19fbc53c34f28d55708ba2c8e84278e1d7e7d Reviewed-by: Laszlo Agocs --- src/platformsupport/kmsconvenience/qkmsdevice.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/platformsupport/kmsconvenience/qkmsdevice.cpp') diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index 22033f58d9..99297c8a3c 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -409,9 +409,6 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, qCDebug(qLcKmsDebug, "Output %s can use %d planes: %s", connectorName.constData(), output.available_planes.count(), qPrintable(planeListStr)); - if (output.eglfs_plane) - qCDebug(qLcKmsDebug, "Output eglfs plane is: %d", output.eglfs_plane->id); - // This is for the EGLDevice/EGLStream backend. On some of those devices one // may want to target a pre-configured plane. It is probably useless for // eglfs_kms and others. Do not confuse with generic plane support (available_planes). @@ -427,6 +424,12 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, output.forced_plane_id = plane->plane_id; qCDebug(qLcKmsDebug, "Forcing plane index %d, plane id %u (belongs to crtc id %u)", idx, plane->plane_id, plane->crtc_id); + + for (const QKmsPlane &kmsplane : qAsConst(m_planes)) { + if (kmsplane.id == output.forced_plane_id) + output.eglfs_plane = (QKmsPlane*)&kmsplane; + } + drmModeFreePlane(plane); } } else { @@ -435,6 +438,9 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, } } + if (output.eglfs_plane) + qCDebug(qLcKmsDebug, "Output eglfs plane is: %d", output.eglfs_plane->id); + m_crtc_allocator |= (1 << output.crtc_index); vinfo->output = output; -- cgit v1.2.3