From 0395c0cc9533067dc49287a922cfb8060d2bb81c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 4 Jan 2022 21:59:02 -0600 Subject: [PATCH] Revert "Revert "Don't attempt to use direct rendering without DRM master"" The correct fix was 154b5b6ded4461b241b60ce00b75fa779ecdaf3e. This reverts commit 8219dbef6f4b4884f99f8159efc78d8d4d8e129c. --- app/streaming/video/ffmpeg-renderers/drm.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 04c0d816..284ba31f 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -137,6 +137,15 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params) // handle the case where those also fail to render the test frame. const bool DIRECT_RENDERING_INIT_FAILED = true; + // If we're not sharing the DRM FD with SDL, that means we don't + // have DRM master, so we can't call drmModeSetPlane(). We can + // only use EGL to render in this situation. + if (!m_SdlOwnsDrmFd) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Direct rendering via DRM is disabled"); + return DIRECT_RENDERING_INIT_FAILED; + } + drmModeRes* resources = drmModeGetResources(m_DrmFd); if (resources == nullptr) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,