From 5711e6064e75f7ef2cc13f9e4b062fa3b645b135 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 29 Sep 2023 17:19:44 -0500 Subject: [PATCH] Allow reuse of an active plane for devices with only one usable plane per CRTC --- app/streaming/video/ffmpeg-renderers/drm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 3353cd0e..31614bf6 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -422,7 +422,10 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params) continue; } - if ((plane->possible_crtcs & (1 << crtcIndex)) && plane->crtc_id == 0) { + // We don't check plane->crtc_id here because we want to be able to reuse the primary plane + // that may owned by Qt and in use on a CRTC prior to us taking over DRM master. When we give + // control back to Qt, it will repopulate the plane with the FB it owns and render as normal. + if ((plane->possible_crtcs & (1 << crtcIndex))) { drmModeObjectPropertiesPtr props = drmModeObjectGetProperties(m_DrmFd, planeRes->planes[i], DRM_MODE_OBJECT_PLANE); if (props != nullptr) { for (uint32_t j = 0; j < props->count_props; j++) {