From 61459130684696509cba9aa67f5460ce5f6a8dc7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 19 Dec 2021 20:32:15 -0600 Subject: [PATCH] Don't attempt to use direct rendering without DRM master --- 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 2abe0645..71e764c0 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -140,6 +140,15 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params) const bool DIRECT_RENDERING_INIT_FAILED = false; #endif + // 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,