From 8aec35a6507da9497e3c6ccadce126336f3f8dba Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 6 Jan 2026 02:12:32 -0600 Subject: [PATCH] Allow primary planes to be overlays for video underlays --- app/streaming/video/ffmpeg-renderers/drm.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 6d2e12f5..d19c43e8 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -806,10 +806,16 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params) } DrmPropertyMap props { m_DrmFd, planeRes->planes[i], DRM_MODE_OBJECT_PLANE }; - // Only consider overlay planes as valid targets - if (auto type = props.property("type"); type->initialValue() != DRM_PLANE_TYPE_OVERLAY) { - drmModeFreePlane(plane); - continue; + // Only consider overlay or primary planes as valid targets + // The latter might seem strange, but some DRM devices use + // underlays where the YUV-compatible overlay plane resides + // underneath the primary plane. In this case, we will use + // the primary plane as an overlay plane on top of the video. + if (auto type = props.property("type")) + if (type->initialValue() != DRM_PLANE_TYPE_OVERLAY && type->initialValue() != DRM_PLANE_TYPE_PRIMARY) { + drmModeFreePlane(plane); + continue; + } } // The overlay plane must support ARGB8888