diff --git a/projects/RPi/devices/RPi4/config/distroconfig.txt b/projects/RPi/devices/RPi4/config/distroconfig.txt index 489f1e20b6..201d53297e 100644 --- a/projects/RPi/devices/RPi4/config/distroconfig.txt +++ b/projects/RPi/devices/RPi4/config/distroconfig.txt @@ -2,7 +2,7 @@ # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) # WARNING: DO NOT EDIT THIS FILE - IT WILL BE OVERWRITTEN WHEN UPGRADING! -dtoverlay=vc4-kms-v3d-pi4,cma-384 +dtoverlay=vc4-kms-v3d,cma-384 dtoverlay=rpivid-v4l2 disable_overscan=1 disable_fw_kms_setup=1 diff --git a/projects/RPi/devices/RPi4/patches/kodi/0001-hack-try-to-hide-pixel-wrap-issues.patch b/projects/RPi/devices/RPi4/patches/kodi/0001-hack-try-to-hide-pixel-wrap-issues.patch new file mode 100644 index 0000000000..f2d4b7ff07 --- /dev/null +++ b/projects/RPi/devices/RPi4/patches/kodi/0001-hack-try-to-hide-pixel-wrap-issues.patch @@ -0,0 +1,71 @@ +From 8dc2c71f7b568733b7e6629013f05f67639a1938 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 8 Apr 2020 11:19:22 +0100 +Subject: [PATCH] pi4: hack: Try to hide pixel wrap issue + +--- + .../HwDecRender/VideoLayerBridgeDRMPRIME.cpp | 11 +++++++++-- + xbmc/windowing/gbm/drm/DRMAtomic.cpp | 10 ++++++++-- + 2 files changed, 17 insertions(+), 4 deletions(-) + +diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp +index c78636b68004..ee3bde3bfde5 100644 +--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp ++++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/VideoLayerBridgeDRMPRIME.cpp +@@ -264,13 +264,20 @@ void CVideoLayerBridgeDRMPRIME::SetVideoPlane(CVideoBufferDRMPRIME* buffer, cons + auto plane = m_DRM->GetVideoPlane(); + m_DRM->AddProperty(plane, "FB_ID", buffer->m_fb_id); + m_DRM->AddProperty(plane, "CRTC_ID", m_DRM->GetCrtc()->GetCrtcId()); ++ ++ uint32_t srcw = buffer->GetWidth() << 16; ++ uint32_t dstw = static_cast(destRect.Width()); ++ double scalex = (double)srcw / (double)dstw; ++ dstw -= 2; ++ srcw = (uint32_t)(srcw - 2.0 * scalex + 0.5); ++ + m_DRM->AddProperty(plane, "SRC_X", 0); + m_DRM->AddProperty(plane, "SRC_Y", 0); +- m_DRM->AddProperty(plane, "SRC_W", buffer->GetWidth() << 16); ++ m_DRM->AddProperty(plane, "SRC_W", srcw); + m_DRM->AddProperty(plane, "SRC_H", buffer->GetHeight() << 16); + m_DRM->AddProperty(plane, "CRTC_X", static_cast(destRect.x1) & ~1); + m_DRM->AddProperty(plane, "CRTC_Y", static_cast(destRect.y1) & ~1); +- m_DRM->AddProperty(plane, "CRTC_W", (static_cast(destRect.Width()) + 1) & ~1); ++ m_DRM->AddProperty(plane, "CRTC_W", (dstw + 1) & ~1); + m_DRM->AddProperty(plane, "CRTC_H", (static_cast(destRect.Height()) + 1) & ~1); + } + +diff --git a/xbmc/windowing/gbm/drm/DRMAtomic.cpp b/xbmc/windowing/gbm/drm/DRMAtomic.cpp +index 37166b8dcddc..803f22be831c 100644 +--- a/xbmc/windowing/gbm/drm/DRMAtomic.cpp ++++ b/xbmc/windowing/gbm/drm/DRMAtomic.cpp +@@ -92,13 +92,19 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video + return; + } + ++ uint32_t srcw = m_width << 16; ++ uint32_t dstw = m_mode->hdisplay; ++ double scalex = (double)srcw / (double)dstw; ++ dstw -= 2; ++ srcw = (uint32_t)(srcw - 2.0 * scalex + 0.5); ++ + if (rendered) + { + AddProperty(m_gui_plane, "FB_ID", fb_id); + AddProperty(m_gui_plane, "CRTC_ID", m_crtc->GetCrtcId()); + AddProperty(m_gui_plane, "SRC_X", 0); + AddProperty(m_gui_plane, "SRC_Y", 0); +- AddProperty(m_gui_plane, "SRC_W", m_width << 16); ++ AddProperty(m_gui_plane, "SRC_W", srcw); + AddProperty(m_gui_plane, "SRC_H", m_height << 16); + AddProperty(m_gui_plane, "CRTC_X", 0); + AddProperty(m_gui_plane, "CRTC_Y", 0); +@@ -109,7 +115,7 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video + // } + // else + { +- AddProperty(m_gui_plane, "CRTC_W", m_mode->hdisplay); ++ AddProperty(m_gui_plane, "CRTC_W", dstw); + AddProperty(m_gui_plane, "CRTC_H", m_mode->vdisplay); + } +