Merge pull request #5993 from HiassofT/le11-kodi-rpi-max-bpc

RPi: add kodi patch to enable 10/12bit video output
This commit is contained in:
Christian Hewitt 2021-12-18 19:54:17 +00:00 committed by GitHub
commit 7a516de2a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 23 deletions

View File

@ -0,0 +1,47 @@
From 19a82e838a91fcaa122f3993a08e3036ca7786cc Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Fri, 3 Dec 2021 16:00:50 +0000
Subject: [PATCH] gbm: Set max bpc for high bit depth videos
---
.../HwDecRender/VideoLayerBridgeDRMPRIME.cpp | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
index a82da2225b..def417d366 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
@@ -35,8 +35,15 @@ void CVideoLayerBridgeDRMPRIME::Disable()
m_DRM->AddProperty(plane, "FB_ID", 0);
m_DRM->AddProperty(plane, "CRTC_ID", 0);
- // disable HDR metadata
auto connector = m_DRM->GetConnector();
+
+ // reset max bpc back to default of 8
+ int bpc = 8;
+ bool result = m_DRM->AddProperty(connector, "max bpc", bpc);
+ CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to {} ({})", __FUNCTION__,
+ bpc, result);
+
+ // disable HDR metadata
if (connector->SupportsProperty("HDR_OUTPUT_METADATA"))
{
m_DRM->AddProperty(connector, "HDR_OUTPUT_METADATA", 0);
@@ -174,6 +181,13 @@ void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer)
m_DRM->AddProperty(plane, "COLOR_RANGE", value);
auto connector = m_DRM->GetConnector();
+
+ // set max bpc to allow the drm driver to choose a deep colour mode
+ int bpc = picture.colorBits > 8 ? 12 : 8;
+ result = m_DRM->AddProperty(connector, "max bpc", bpc);
+ CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to {} ({})", __FUNCTION__,
+ bpc, result);
+
if (connector->SupportsProperty("HDR_OUTPUT_METADATA"))
{
m_hdr_metadata.metadata_type = HDMI_STATIC_METADATA_TYPE1;
--
2.30.2

View File

@ -1,13 +1,13 @@
From a6834e2b37fa968c2cb7f57c6198d7ecb03f8583 Mon Sep 17 00:00:00 2001 From 066f00577ab6fe258b5a59eb99e0839de1509988 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com> From: Lukas Rusak <lorusak@gmail.com>
Date: Mon, 29 Apr 2019 18:48:45 -0700 Date: Mon, 29 Apr 2019 18:48:45 -0700
Subject: [PATCH] CVideoLayerBridgeDRMPRIME add colourspace connector property Subject: [PATCH] CVideoLayerBridgeDRMPRIME add colourspace connector property
--- ---
.../Buffers/VideoBufferDRMPRIME.cpp | 12 ++++++++++ .../Buffers/VideoBufferDRMPRIME.cpp | 12 ++++++++++++
.../VideoPlayer/Buffers/VideoBufferDRMPRIME.h | 1 + .../VideoPlayer/Buffers/VideoBufferDRMPRIME.h | 1 +
.../HwDecRender/VideoLayerBridgeDRMPRIME.cpp | 22 ++++++++++++++++++- .../HwDecRender/VideoLayerBridgeDRMPRIME.cpp | 19 +++++++++++++++++++
3 files changed, 34 insertions(+), 1 deletion(-) 3 files changed, 32 insertions(+)
diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp diff --git a/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp b/xbmc/cores/VideoPlayer/Buffers/VideoBufferDRMPRIME.cpp
index b85097d37b..037f66db72 100644 index b85097d37b..037f66db72 100644
@ -45,39 +45,35 @@ index e77f75b58b..4de9732308 100644
std::string GetColorRange(const VideoPicture& picture); std::string GetColorRange(const VideoPicture& picture);
uint8_t GetEOTF(const VideoPicture& picture); uint8_t GetEOTF(const VideoPicture& picture);
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
index 4f07ffc0b8..c78636b680 100644 index def417d366..fadc6a7df5 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp
@@ -35,8 +35,18 @@ void CVideoLayerBridgeDRMPRIME::Disable() @@ -43,6 +43,16 @@ void CVideoLayerBridgeDRMPRIME::Disable()
m_DRM->AddProperty(plane, "FB_ID", 0); CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to {} ({})", __FUNCTION__,
m_DRM->AddProperty(plane, "CRTC_ID", 0); bpc, result);
- // disable HDR metadata
auto connector = m_DRM->GetConnector();
+
+ bool result;
+ uint64_t value; + uint64_t value;
+ std::tie(result, value) = connector->GetPropertyValue("Colorspace", "Default"); + std::tie(result, value) = connector->GetPropertyValue("Colorspace", "Default");
+ if (result) + if (result)
+ { + {
+ CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting connector colorspace to Default", __FUNCTION__); + CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting connector colorspace to Default",
+ __FUNCTION__);
+ m_DRM->AddProperty(connector, "Colorspace", value); + m_DRM->AddProperty(connector, "Colorspace", value);
+ m_DRM->SetActive(true);
+ } + }
+ +
+ // disable HDR metadata // disable HDR metadata
if (connector->SupportsProperty("HDR_OUTPUT_METADATA")) if (connector->SupportsProperty("HDR_OUTPUT_METADATA"))
{ {
m_DRM->AddProperty(connector, "HDR_OUTPUT_METADATA", 0); @@ -188,6 +198,15 @@ void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer)
@@ -173,6 +183,16 @@ void CVideoLayerBridgeDRMPRIME::Configure(CVideoBufferDRMPRIME* buffer) CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting max bpc to {} ({})", __FUNCTION__,
m_DRM->AddProperty(plane, "COLOR_RANGE", value); bpc, result);
auto connector = m_DRM->GetConnector(); + std::tie(result, value) = connector->GetPropertyValue("Colorspace", GetColorimetry(picture));
+
+ std::tie(result, value) = connector->GetPropertyValue("Colorspace", GetColorimetry(picture));
+ if (result) + if (result)
+ { + {
+ CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting connector colorspace to {}", __FUNCTION__, + CLog::Log(LOGDEBUG, "CVideoLayerBridgeDRMPRIME::{} - setting connector colorspace to {}",
+ GetColorimetry(picture)); + __FUNCTION__, GetColorimetry(picture));
+ m_DRM->AddProperty(connector, "Colorspace", value); + m_DRM->AddProperty(connector, "Colorspace", value);
+ m_DRM->SetActive(true); + m_DRM->SetActive(true);
+ } + }
@ -86,5 +82,5 @@ index 4f07ffc0b8..c78636b680 100644
{ {
m_hdr_metadata.metadata_type = HDMI_STATIC_METADATA_TYPE1; m_hdr_metadata.metadata_type = HDMI_STATIC_METADATA_TYPE1;
-- --
2.20.1 2.30.2