Skip to content

Commit fcdcf4f

Browse files
committed
gbm: Set max bpc for high bit depth videos
1 parent 991a13c commit fcdcf4f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ void CVideoLayerBridgeDRMPRIME::Disable()
4646
m_DRM->AddProperty(connector, "Colorspace", value);
4747
}
4848

49+
CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to 8", __FUNCTION__);
50+
result = m_DRM->AddProperty(connector, "max bpc", 8);
51+
if (!result)
52+
{
53+
CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - failed to reset max bpc to 8", __FUNCTION__);
54+
}
55+
4956
// disable HDR metadata
5057
if (connector->SupportsProperty("HDR_OUTPUT_METADATA"))
5158
{
@@ -185,6 +192,11 @@ void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer)
185192

186193
auto connector = m_DRM->GetConnector();
187194

195+
int bpc = 8;
196+
197+
if (picture.colorBits > 8)
198+
bpc = 12;
199+
188200
std::tie(result, value) = connector->GetPropertyValue("Colorspace", GetColorimetry(picture));
189201
if (result)
190202
{
@@ -194,6 +206,10 @@ void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer)
194206
m_DRM->SetActive(true);
195207
}
196208

209+
CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to {} ({})", __FUNCTION__,
210+
bpc, result);
211+
result = m_DRM->AddProperty(connector, "max bpc", bpc);
212+
197213
if (connector->SupportsProperty("HDR_OUTPUT_METADATA"))
198214
{
199215
m_hdr_metadata.metadata_type = HDMI_STATIC_METADATA_TYPE1;

0 commit comments

Comments
 (0)