From a3d1e9a11732c969383c391926b98f3e94585722 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 27 Mar 2023 01:02:50 -0500 Subject: [PATCH] Allow negotation of 36 and 48 bit deep color modes --- app/streaming/video/ffmpeg-renderers/drm.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index 1a8bd4f1..57e751a3 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -447,9 +447,15 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params) m_HdrOutputMetadataProp = prop; } else if (!strcmp(prop->name, "max bpc") && m_Main10Hdr) { - int err = drmModeObjectSetProperty(m_DrmFd, m_ConnectorId, DRM_MODE_OBJECT_CONNECTOR, - prop->prop_id, 10); - if (err == 0) { + if (drmModeObjectSetProperty(m_DrmFd, m_ConnectorId, DRM_MODE_OBJECT_CONNECTOR, prop->prop_id, 16) == 0) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Enabled 48-bit HDMI Deep Color"); + } + else if (drmModeObjectSetProperty(m_DrmFd, m_ConnectorId, DRM_MODE_OBJECT_CONNECTOR, prop->prop_id, 12) == 0) { + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Enabled 36-bit HDMI Deep Color"); + } + else if (drmModeObjectSetProperty(m_DrmFd, m_ConnectorId, DRM_MODE_OBJECT_CONNECTOR, prop->prop_id, 10) == 0) { SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Enabled 30-bit HDMI Deep Color"); }