kodi: update Rockchip patches for testing

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
This commit is contained in:
Christian Hewitt
2025-07-15 08:13:21 +00:00
parent 6fe05e1e2f
commit 0f42af2a8e
3 changed files with 66 additions and 571 deletions

View File

@@ -1,571 +0,0 @@
From ac0bbb9cb0c36175abfb6dc145d4af289315051d Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 25 Oct 2024 16:19:44 +0200
Subject: [PATCH 1/4] Revert "CEGLFence: Ignore improper atomic drmrequest when
async rendering and"
This reverts commit 54b9ccdb4fd8c6397846cd35887292dbb31cf3b1.
---
xbmc/utils/EGLFence.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/xbmc/utils/EGLFence.cpp b/xbmc/utils/EGLFence.cpp
index 58a9ec1683be..9d0065bdaf07 100644
--- a/xbmc/utils/EGLFence.cpp
+++ b/xbmc/utils/EGLFence.cpp
@@ -133,7 +133,11 @@ void CEGLFence::WaitSyncCPU()
if (!m_kmsFence)
return;
- if (m_eglClientWaitSyncKHR(m_display, m_kmsFence, 0, EGL_FOREVER_KHR) != EGL_FALSE)
- m_eglDestroySyncKHR(m_display, m_kmsFence);
+ EGLint status{EGL_FALSE};
+
+ while (status != EGL_CONDITION_SATISFIED_KHR)
+ status = m_eglClientWaitSyncKHR(m_display, m_kmsFence, 0, EGL_FOREVER_KHR);
+
+ m_eglDestroySyncKHR(m_display, m_kmsFence);
}
#endif
--
2.39.5
From 0939d854f2b0746b6ad989ef0e655b6f216a0070 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 25 Oct 2024 16:20:19 +0200
Subject: [PATCH 2/4] Revert "CDRMAtomic: Backlog only the last known good
drmrequest"
This reverts commit 6c49df769b7a21a3857b25ea12dc8ba0302051aa.
---
xbmc/windowing/gbm/drm/DRMAtomic.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/xbmc/windowing/gbm/drm/DRMAtomic.cpp b/xbmc/windowing/gbm/drm/DRMAtomic.cpp
index a197adbcb409..bb8776fb0db3 100644
--- a/xbmc/windowing/gbm/drm/DRMAtomic.cpp
+++ b/xbmc/windowing/gbm/drm/DRMAtomic.cpp
@@ -148,11 +148,6 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
if (ret < 0)
{
CLog::Log(LOGERROR, "CDRMAtomic::{} - atomic commit failed: {}", __FUNCTION__, strerror(errno));
- m_atomicRequestQueue.pop_back();
- }
- else if (m_atomicRequestQueue.size() > 1)
- {
- m_atomicRequestQueue.pop_front();
}
if (m_inFenceFd != -1)
@@ -168,6 +163,9 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
strerror(errno));
}
+ if (m_atomicRequestQueue.size() > 1)
+ m_atomicRequestQueue.pop_back();
+
m_atomicRequestQueue.emplace_back(std::make_unique<CDRMAtomicRequest>());
m_req = m_atomicRequestQueue.back().get();
}
--
2.39.5
From edfde4bf9a6be9177b57765d3d69ce9e67769d05 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 25 Oct 2024 16:27:00 +0200
Subject: [PATCH 3/4] Revert "CDRMAtomic: add support for using
DRM_MODE_ATOMIC_NONBLOCK"
This reverts commit e9710033029d86efa0c18a6121d2c6376f74ef10.
---
xbmc/windowing/gbm/WinSystemGbm.cpp | 8 +++---
xbmc/windowing/gbm/WinSystemGbm.h | 2 +-
xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp | 11 --------
xbmc/windowing/gbm/WinSystemGbmEGLContext.h | 3 ---
xbmc/windowing/gbm/WinSystemGbmGLContext.cpp | 26 +-----------------
.../windowing/gbm/WinSystemGbmGLESContext.cpp | 27 +------------------
xbmc/windowing/gbm/drm/DRMAtomic.cpp | 19 +++----------
xbmc/windowing/gbm/drm/DRMAtomic.h | 2 +-
xbmc/windowing/gbm/drm/DRMLegacy.cpp | 2 +-
xbmc/windowing/gbm/drm/DRMLegacy.h | 2 +-
xbmc/windowing/gbm/drm/DRMUtils.h | 13 +--------
xbmc/windowing/gbm/drm/OffScreenModeSetting.h | 2 +-
12 files changed, 15 insertions(+), 102 deletions(-)
diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp
index d7ea32f6cb46..242c553c223a 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbm.cpp
@@ -273,7 +273,7 @@ void CWinSystemGbm::UpdateDisplayHardwareScaling(const RESOLUTION_INFO& resInfo)
SetFullScreen(true, resMutable, false);
}
-void CWinSystemGbm::FlipPage(bool rendered, bool videoLayer, bool async)
+void CWinSystemGbm::FlipPage(bool rendered, bool videoLayer)
{
if (m_videoLayerBridge && !videoLayer)
{
@@ -288,7 +288,7 @@ void CWinSystemGbm::FlipPage(bool rendered, bool videoLayer, bool async)
bo = m_GBM->GetDevice().GetSurface().LockFrontBuffer().Get();
}
- m_DRM->FlipPage(bo, rendered, videoLayer, async);
+ m_DRM->FlipPage(bo, rendered, videoLayer);
if (m_videoLayerBridge && !videoLayer)
{
@@ -306,14 +306,14 @@ bool CWinSystemGbm::UseLimitedColor()
bool CWinSystemGbm::Hide()
{
bool ret = m_DRM->SetActive(false);
- FlipPage(false, false, false);
+ FlipPage(false, false);
return ret;
}
bool CWinSystemGbm::Show(bool raise)
{
bool ret = m_DRM->SetActive(true);
- FlipPage(false, false, false);
+ FlipPage(false, false);
return ret;
}
diff --git a/xbmc/windowing/gbm/WinSystemGbm.h b/xbmc/windowing/gbm/WinSystemGbm.h
index d6680e8c1848..feac645536b3 100644
--- a/xbmc/windowing/gbm/WinSystemGbm.h
+++ b/xbmc/windowing/gbm/WinSystemGbm.h
@@ -49,7 +49,7 @@ public:
bool DisplayHardwareScalingEnabled() override;
void UpdateDisplayHardwareScaling(const RESOLUTION_INFO& resInfo) override;
- void FlipPage(bool rendered, bool videoLayer, bool async);
+ void FlipPage(bool rendered, bool videoLayer);
bool CanDoWindowed() override { return false; }
void UpdateResolutions() override;
diff --git a/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp b/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
index ae015d225252..83509f94c8ef 100644
--- a/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp
@@ -58,17 +58,6 @@ bool CWinSystemGbmEGLContext::InitWindowSystemEGL(EGLint renderableType, EGLint
return false;
}
- if (CEGLUtils::HasExtension(m_eglContext.GetEGLDisplay(), "EGL_ANDROID_native_fence_sync") &&
- CEGLUtils::HasExtension(m_eglContext.GetEGLDisplay(), "EGL_KHR_fence_sync"))
- {
- m_eglFence = std::make_unique<KODI::UTILS::EGL::CEGLFence>(m_eglContext.GetEGLDisplay());
- }
- else
- {
- CLog::Log(LOGWARNING, "[GBM] missing support for EGL_KHR_fence_sync and "
- "EGL_ANDROID_native_fence_sync - performance may be impacted");
- }
-
return true;
}
diff --git a/xbmc/windowing/gbm/WinSystemGbmEGLContext.h b/xbmc/windowing/gbm/WinSystemGbmEGLContext.h
index 387beb210a20..5c2b5a34aebf 100644
--- a/xbmc/windowing/gbm/WinSystemGbmEGLContext.h
+++ b/xbmc/windowing/gbm/WinSystemGbmEGLContext.h
@@ -9,7 +9,6 @@
#pragma once
#include "WinSystemGbm.h"
-#include "utils/EGLFence.h"
#include "utils/EGLUtils.h"
#include "windowing/linux/WinSystemEGL.h"
@@ -55,8 +54,6 @@ protected:
bool InitWindowSystemEGL(EGLint renderableType, EGLint apiType);
virtual bool CreateContext() = 0;
- std::unique_ptr<KODI::UTILS::EGL::CEGLFence> m_eglFence;
-
struct delete_CVaapiProxy
{
void operator()(CVaapiProxy* p) const;
diff --git a/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
index 65878a7e221d..063b6a213bd4 100644
--- a/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp
@@ -121,37 +121,13 @@ void CWinSystemGbmGLContext::PresentRender(bool rendered, bool videoLayer)
{
if (rendered)
{
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- if (m_eglFence)
- {
- int fd = m_DRM->TakeOutFenceFd();
- if (fd != -1)
- {
- m_eglFence->CreateKMSFence(fd);
- m_eglFence->WaitSyncGPU();
- }
-
- m_eglFence->CreateGPUFence();
- }
-#endif
-
if (!m_eglContext.TrySwapBuffers())
{
CEGLUtils::Log(LOGERROR, "eglSwapBuffers failed");
throw std::runtime_error("eglSwapBuffers failed");
}
-
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- if (m_eglFence)
- {
- int fd = m_eglFence->FlushFence();
- m_DRM->SetInFenceFd(fd);
-
- m_eglFence->WaitSyncCPU();
- }
-#endif
}
- CWinSystemGbm::FlipPage(rendered, videoLayer, static_cast<bool>(m_eglFence));
+ CWinSystemGbm::FlipPage(rendered, videoLayer);
if (m_dispReset && m_dispResetTimer.IsTimePast())
{
diff --git a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
index 7538a6a69473..f26d0f9c5d32 100644
--- a/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
+++ b/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp
@@ -130,38 +130,13 @@ void CWinSystemGbmGLESContext::PresentRender(bool rendered, bool videoLayer)
{
if (rendered)
{
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- if (m_eglFence)
- {
- int fd = m_DRM->TakeOutFenceFd();
- if (fd != -1)
- {
- m_eglFence->CreateKMSFence(fd);
- m_eglFence->WaitSyncGPU();
- }
-
- m_eglFence->CreateGPUFence();
- }
-#endif
-
if (!m_eglContext.TrySwapBuffers())
{
CEGLUtils::Log(LOGERROR, "eglSwapBuffers failed");
throw std::runtime_error("eglSwapBuffers failed");
}
-
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- if (m_eglFence)
- {
- int fd = m_eglFence->FlushFence();
- m_DRM->SetInFenceFd(fd);
-
- m_eglFence->WaitSyncCPU();
- }
-#endif
}
-
- CWinSystemGbm::FlipPage(rendered, videoLayer, static_cast<bool>(m_eglFence));
+ CWinSystemGbm::FlipPage(rendered, videoLayer);
if (m_dispReset && m_dispResetTimer.IsTimePast())
{
diff --git a/xbmc/windowing/gbm/drm/DRMAtomic.cpp b/xbmc/windowing/gbm/drm/DRMAtomic.cpp
index bb8776fb0db3..7a72e22646cc 100644
--- a/xbmc/windowing/gbm/drm/DRMAtomic.cpp
+++ b/xbmc/windowing/gbm/drm/DRMAtomic.cpp
@@ -111,11 +111,6 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
AddProperty(m_gui_plane, "CRTC_H", m_mode->vdisplay);
}
- if (m_inFenceFd != -1)
- {
- AddProperty(m_crtc, "OUT_FENCE_PTR", reinterpret_cast<uint64_t>(&m_outFenceFd));
- AddProperty(m_gui_plane, "IN_FENCE_FD", m_inFenceFd);
- }
}
else if (videoLayer && !CServiceBroker::GetGUI()->GetWindowManager().HasVisibleControls())
{
@@ -150,12 +145,6 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
CLog::Log(LOGERROR, "CDRMAtomic::{} - atomic commit failed: {}", __FUNCTION__, strerror(errno));
}
- if (m_inFenceFd != -1)
- {
- close(m_inFenceFd);
- m_inFenceFd = -1;
- }
-
if (flags & DRM_MODE_ATOMIC_ALLOW_MODESET)
{
if (drmModeDestroyPropertyBlob(m_fd, blob_id) != 0)
@@ -170,10 +159,9 @@ void CDRMAtomic::DrmAtomicCommit(int fb_id, int flags, bool rendered, bool video
m_req = m_atomicRequestQueue.back().get();
}
-void CDRMAtomic::FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async)
+void CDRMAtomic::FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer)
{
struct drm_fb* drm_fb = nullptr;
- uint32_t flags = 0;
if (rendered)
{
@@ -188,11 +176,10 @@ void CDRMAtomic::FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, boo
CLog::Log(LOGERROR, "CDRMAtomic::{} - Failed to get a new FBO", __FUNCTION__);
return;
}
-
- if (async && !m_need_modeset)
- flags |= DRM_MODE_ATOMIC_NONBLOCK;
}
+ uint32_t flags = 0;
+
if (m_need_modeset)
{
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
diff --git a/xbmc/windowing/gbm/drm/DRMAtomic.h b/xbmc/windowing/gbm/drm/DRMAtomic.h
index 1c4faf208724..8ea83068cf02 100644
--- a/xbmc/windowing/gbm/drm/DRMAtomic.h
+++ b/xbmc/windowing/gbm/drm/DRMAtomic.h
@@ -27,7 +27,7 @@ class CDRMAtomic : public CDRMUtils
public:
CDRMAtomic() = default;
~CDRMAtomic() override = default;
- void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async) override;
+ void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer) override;
bool SetVideoMode(const RESOLUTION_INFO& res, struct gbm_bo* bo) override;
bool SetActive(bool active) override;
bool InitDrm() override;
diff --git a/xbmc/windowing/gbm/drm/DRMLegacy.cpp b/xbmc/windowing/gbm/drm/DRMLegacy.cpp
index 9b2b052ff40a..d3c196fc5007 100644
--- a/xbmc/windowing/gbm/drm/DRMLegacy.cpp
+++ b/xbmc/windowing/gbm/drm/DRMLegacy.cpp
@@ -107,7 +107,7 @@ bool CDRMLegacy::QueueFlip(struct gbm_bo* bo)
return true;
}
-void CDRMLegacy::FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async)
+void CDRMLegacy::FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer)
{
if (rendered || videoLayer)
{
diff --git a/xbmc/windowing/gbm/drm/DRMLegacy.h b/xbmc/windowing/gbm/drm/DRMLegacy.h
index 322a99bed8f7..4e7d1b03addf 100644
--- a/xbmc/windowing/gbm/drm/DRMLegacy.h
+++ b/xbmc/windowing/gbm/drm/DRMLegacy.h
@@ -22,7 +22,7 @@ class CDRMLegacy : public CDRMUtils
public:
CDRMLegacy() = default;
~CDRMLegacy() override = default;
- void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async) override;
+ void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer) override;
bool SetVideoMode(const RESOLUTION_INFO& res, struct gbm_bo* bo) override;
bool SetActive(bool active) override;
bool InitDrm() override;
diff --git a/xbmc/windowing/gbm/drm/DRMUtils.h b/xbmc/windowing/gbm/drm/DRMUtils.h
index 6df248104b14..315beb5932aa 100644
--- a/xbmc/windowing/gbm/drm/DRMUtils.h
+++ b/xbmc/windowing/gbm/drm/DRMUtils.h
@@ -15,7 +15,6 @@
#include "windowing/Resolution.h"
#include "windowing/gbm/GBMUtils.h"
-#include <utility>
#include <vector>
#include <gbm.h>
@@ -40,7 +39,7 @@ class CDRMUtils
public:
CDRMUtils() = default;
virtual ~CDRMUtils();
- virtual void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async) {}
+ virtual void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer) {}
virtual bool SetVideoMode(const RESOLUTION_INFO& res, struct gbm_bo* bo) { return false; }
virtual bool SetActive(bool active) { return false; }
virtual bool InitDrm();
@@ -63,13 +62,6 @@ public:
static uint32_t FourCCWithAlpha(uint32_t fourcc);
static uint32_t FourCCWithoutAlpha(uint32_t fourcc);
- void SetInFenceFd(int fd) { m_inFenceFd = fd; }
- int TakeOutFenceFd()
- {
- int fd{-1};
- return std::exchange(m_outFenceFd, fd);
- }
-
protected:
bool OpenDrm(bool needConnector);
drm_fb* DrmFbGetFromBo(struct gbm_bo* bo);
@@ -86,9 +78,6 @@ protected:
int m_width = 0;
int m_height = 0;
- int m_inFenceFd{-1};
- int m_outFenceFd{-1};
-
std::vector<std::unique_ptr<CDRMPlane>> m_planes;
private:
diff --git a/xbmc/windowing/gbm/drm/OffScreenModeSetting.h b/xbmc/windowing/gbm/drm/OffScreenModeSetting.h
index aea436f867b4..606935cc021f 100644
--- a/xbmc/windowing/gbm/drm/OffScreenModeSetting.h
+++ b/xbmc/windowing/gbm/drm/OffScreenModeSetting.h
@@ -22,7 +22,7 @@ class COffScreenModeSetting : public CDRMUtils
public:
COffScreenModeSetting() = default;
~COffScreenModeSetting() override = default;
- void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer, bool async) override {}
+ void FlipPage(struct gbm_bo* bo, bool rendered, bool videoLayer) override {}
bool SetVideoMode(const RESOLUTION_INFO& res, struct gbm_bo* bo) override { return false; }
bool SetActive(bool active) override { return false; }
bool InitDrm() override;
--
2.39.5
From 665787525e8f502c974be55e70036b73c7d9b1ad Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Fri, 25 Oct 2024 16:27:09 +0200
Subject: [PATCH 4/4] Revert "CEGLFence: add support for using
EGL_KHR_fence_sync and EGL_ANDROID_native_fence_sync"
This reverts commit ba17e5b45c5bd36ef65089f35049da82a290bb01.
---
xbmc/utils/EGLFence.cpp | 70 -----------------------------------------
xbmc/utils/EGLFence.h | 19 -----------
2 files changed, 89 deletions(-)
diff --git a/xbmc/utils/EGLFence.cpp b/xbmc/utils/EGLFence.cpp
index 9d0065bdaf07..535e3bce3197 100644
--- a/xbmc/utils/EGLFence.cpp
+++ b/xbmc/utils/EGLFence.cpp
@@ -22,14 +22,6 @@ CEGLFence::CEGLFence(EGLDisplay display)
m_eglGetSyncAttribKHR(
CEGLUtils::GetRequiredProcAddress<PFNEGLGETSYNCATTRIBKHRPROC>("eglGetSyncAttribKHR"))
{
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- m_eglDupNativeFenceFDANDROID =
- CEGLUtils::GetRequiredProcAddress<PFNEGLDUPNATIVEFENCEFDANDROIDPROC>(
- "eglDupNativeFenceFDANDROID");
- m_eglClientWaitSyncKHR =
- CEGLUtils::GetRequiredProcAddress<PFNEGLCLIENTWAITSYNCKHRPROC>("eglClientWaitSyncKHR");
- m_eglWaitSyncKHR = CEGLUtils::GetRequiredProcAddress<PFNEGLWAITSYNCKHRPROC>("eglWaitSyncKHR");
-#endif
}
void CEGLFence::CreateFence()
@@ -79,65 +71,3 @@ bool CEGLFence::IsSignaled()
return false;
}
-
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
-EGLSyncKHR CEGLFence::CreateFence(int fd)
-{
- CEGLAttributes<1> attributeList;
- attributeList.Add({{EGL_SYNC_NATIVE_FENCE_FD_ANDROID, fd}});
-
- EGLSyncKHR fence =
- m_eglCreateSyncKHR(m_display, EGL_SYNC_NATIVE_FENCE_ANDROID, attributeList.Get());
-
- if (fence == EGL_NO_SYNC_KHR)
- {
- CEGLUtils::Log(LOGERROR, "failed to create EGL sync object");
- return nullptr;
- }
-
- return fence;
-}
-
-void CEGLFence::CreateGPUFence()
-{
- m_gpuFence = CreateFence(EGL_NO_NATIVE_FENCE_FD_ANDROID);
-}
-
-void CEGLFence::CreateKMSFence(int fd)
-{
- m_kmsFence = CreateFence(fd);
-}
-
-EGLint CEGLFence::FlushFence()
-{
- EGLint fd = m_eglDupNativeFenceFDANDROID(m_display, m_gpuFence);
- if (fd == EGL_NO_NATIVE_FENCE_FD_ANDROID)
- CEGLUtils::Log(LOGERROR, "failed to duplicate EGL fence fd");
-
- m_eglDestroySyncKHR(m_display, m_gpuFence);
-
- return fd;
-}
-
-void CEGLFence::WaitSyncGPU()
-{
- if (!m_kmsFence)
- return;
-
- if (m_eglWaitSyncKHR(m_display, m_kmsFence, 0) != EGL_TRUE)
- CEGLUtils::Log(LOGERROR, "failed to create EGL sync point");
-}
-
-void CEGLFence::WaitSyncCPU()
-{
- if (!m_kmsFence)
- return;
-
- EGLint status{EGL_FALSE};
-
- while (status != EGL_CONDITION_SATISFIED_KHR)
- status = m_eglClientWaitSyncKHR(m_display, m_kmsFence, 0, EGL_FOREVER_KHR);
-
- m_eglDestroySyncKHR(m_display, m_kmsFence);
-}
-#endif
diff --git a/xbmc/utils/EGLFence.h b/xbmc/utils/EGLFence.h
index 03c246b60b67..bd96444e47e5 100644
--- a/xbmc/utils/EGLFence.h
+++ b/xbmc/utils/EGLFence.h
@@ -30,14 +30,6 @@ public:
void DestroyFence();
bool IsSignaled();
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- void CreateKMSFence(int fd);
- void CreateGPUFence();
- EGLint FlushFence();
- void WaitSyncGPU();
- void WaitSyncCPU();
-#endif
-
private:
EGLDisplay m_display{nullptr};
EGLSyncKHR m_fence{nullptr};
@@ -45,17 +37,6 @@ private:
PFNEGLCREATESYNCKHRPROC m_eglCreateSyncKHR{nullptr};
PFNEGLDESTROYSYNCKHRPROC m_eglDestroySyncKHR{nullptr};
PFNEGLGETSYNCATTRIBKHRPROC m_eglGetSyncAttribKHR{nullptr};
-
-#if defined(EGL_ANDROID_native_fence_sync) && defined(EGL_KHR_fence_sync)
- EGLSyncKHR CreateFence(int fd);
-
- EGLSyncKHR m_gpuFence{EGL_NO_SYNC_KHR};
- EGLSyncKHR m_kmsFence{EGL_NO_SYNC_KHR};
-
- PFNEGLDUPNATIVEFENCEFDANDROIDPROC m_eglDupNativeFenceFDANDROID{nullptr};
- PFNEGLCLIENTWAITSYNCKHRPROC m_eglClientWaitSyncKHR{nullptr};
- PFNEGLWAITSYNCKHRPROC m_eglWaitSyncKHR{nullptr};
-#endif
};
}
--
2.39.5

View File

@@ -0,0 +1,34 @@
From c32ad4876d4936e256b7daf7d9e0f44545593212 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Tue, 15 Jul 2025 08:10:19 +0000
Subject: [PATCH 1/2] LOCAL: CEGLFence: Ignore improper atomic drmrequest when
async rendering and
This reverts commit 54b9ccdb4fd8c6397846cd35887292dbb31cf3b1.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
xbmc/utils/EGLFence.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/xbmc/utils/EGLFence.cpp b/xbmc/utils/EGLFence.cpp
index 58a9ec1683..9d0065bdaf 100644
--- a/xbmc/utils/EGLFence.cpp
+++ b/xbmc/utils/EGLFence.cpp
@@ -133,7 +133,11 @@ void CEGLFence::WaitSyncCPU()
if (!m_kmsFence)
return;
- if (m_eglClientWaitSyncKHR(m_display, m_kmsFence, 0, EGL_FOREVER_KHR) != EGL_FALSE)
- m_eglDestroySyncKHR(m_display, m_kmsFence);
+ EGLint status{EGL_FALSE};
+
+ while (status != EGL_CONDITION_SATISFIED_KHR)
+ status = m_eglClientWaitSyncKHR(m_display, m_kmsFence, 0, EGL_FOREVER_KHR);
+
+ m_eglDestroySyncKHR(m_display, m_kmsFence);
}
#endif
--
2.34.1

View File

@@ -0,0 +1,32 @@
From c1847dba81f46631bdacb66e03b95216588a5180 Mon Sep 17 00:00:00 2001
From: Christian Hewitt <christianshewitt@gmail.com>
Date: Sat, 19 Jul 2025 11:24:30 +0000
Subject: [PATCH 2/2] LOCAL: DRMUtils: use DRM_FORMAT_XRGB2101010 for the GUI
plane
Kodi wrongly assumes that if DRM_FORMAT_XRGB2101010 is supported
that DRM_FORMAT_ARGB2101010 is also supported, which is not true
for RK3588.
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
xbmc/windowing/gbm/drm/DRMUtils.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xbmc/windowing/gbm/drm/DRMUtils.cpp b/xbmc/windowing/gbm/drm/DRMUtils.cpp
index be8e586ed2..4f42434827 100644
--- a/xbmc/windowing/gbm/drm/DRMUtils.cpp
+++ b/xbmc/windowing/gbm/drm/DRMUtils.cpp
@@ -225,7 +225,8 @@ bool CDRMUtils::FindPlanes()
CLog::Log(LOGDEBUG, "CDRMUtils::{} - using video plane {}", __FUNCTION__,
m_video_plane->GetPlaneId());
- if (m_gui_plane->SupportsFormat(DRM_FORMAT_XRGB2101010))
+ if (m_gui_plane->SupportsFormat(DRM_FORMAT_XRGB2101010) &&
+ (!m_video_plane || m_gui_plane->SupportsFormat(FourCCWithAlpha(DRM_FORMAT_XRGB2101010))))
{
m_gui_plane->SetFormat(DRM_FORMAT_XRGB2101010);
CLog::Log(LOGDEBUG, "CDRMUtils::{} - using 10bit gui plane {}", __FUNCTION__,
--
2.34.1