Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kodi: backport PR25981 to temp-fix GUI with lima/panfrost devices #9526

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 67415370fd17eea05e5d93c3e4562c13145d9cee Mon Sep 17 00:00:00 2001
From: sarbes <[email protected]>
Date: Sun, 17 Nov 2024 22:47:32 +0100
Subject: [PATCH] Fix rendering for EGL_KHR_partial_update enabled platforms

---
xbmc/guilib/GUIWindowManager.cpp | 5 ++++-
xbmc/utils/EGLUtils.cpp | 9 ++++++---
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index 8d7802e4b672e..4f893c4dd3577 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -43,6 +43,7 @@
#include "settings/windows/GUIWindowSettingsCategory.h"
#include "settings/windows/GUIWindowSettingsScreenCalibration.h"
#include "threads/SingleLock.h"
+#include "utils/Geometry.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/Variant.h"
@@ -1367,7 +1368,6 @@ bool CGUIWindowManager::Render()
m_tracker.CleanMarkedRegions(10);

CDirtyRegionList dirtyRegions = m_tracker.GetDirtyRegions();
- CServiceBroker::GetWinSystem()->SetDirtyRegions(dirtyRegions);

bool hasRendered = false;
// If we visualize the regions we will always render the entire viewport
@@ -1394,6 +1394,9 @@ bool CGUIWindowManager::Render()
if (i.IsEmpty())
continue;

+ if (!hasRendered)
+ CServiceBroker::GetWinSystem()->SetDirtyRegions(dirtyRegions);
+
CServiceBroker::GetWinSystem()->GetGfxContext().SetScissors(i);
RenderPass();
hasRendered = true;
diff --git a/xbmc/utils/EGLUtils.cpp b/xbmc/utils/EGLUtils.cpp
index 01867354cf363..a7cf808043694 100644
--- a/xbmc/utils/EGLUtils.cpp
+++ b/xbmc/utils/EGLUtils.cpp
@@ -667,13 +667,16 @@ void CEGLContextUtils::SetDamagedRegions(const CDirtyRegionList& dirtyRegions)
}
else
{
- EGLint height = eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_HEIGHT, &height);
+ EGLint height;
+ eglQuerySurface(m_eglDisplay, m_eglSurface, EGL_HEIGHT, &height);
std::vector<Rect> rects;
rects.reserve(dirtyRegions.size());
for (const auto& region : dirtyRegions)
{
- rects.push_back({static_cast<EGLint>(region.x1), static_cast<EGLint>(height - region.y2),
- static_cast<EGLint>(region.Width()), static_cast<EGLint>(region.Height())});
+ rects.push_back({static_cast<EGLint>(std::round(region.x1)),
+ static_cast<EGLint>(std::round(height - region.y2)),
+ static_cast<EGLint>(std::round(region.Width())),
+ static_cast<EGLint>(std::round(region.Height()))});
}
m_eglSetDamageRegionKHR(m_eglDisplay, m_eglSurface, reinterpret_cast<EGLint*>(rects.data()),
rects.size());