summaryrefslogtreecommitdiff
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authorAnthony Ruhier <aruhier@mailbox.org>2025-02-13 12:09:25 +0100
committerGitHub <noreply@github.com>2025-02-13 11:09:25 +0000
commit5d2b00829484684b619a8c0de6b1d2b1d18d31a9 (patch)
tree8f696e39be8f2f7be0699904b8f9baca9a6d989d /src/render/Renderer.cpp
parent208f94fe12a30474d6805262524da3da492a0990 (diff)
renderer: disable explicit if aquamarine output doesn't support it (#9396) (#9398)
The explicit settings ignore the aquamarine output.supportsExplicit attribute, which creates glitches on drivers not supporting explicit sync (example: freedreno). If the output has been set as not supporting explicit, disable the explicit settings.
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r--src/render/Renderer.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 6f0bbe44..531ceb33 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -1557,7 +1557,7 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
}
}
- auto explicitOptions = getExplicitSyncSettings();
+ auto explicitOptions = getExplicitSyncSettings(pMonitor->output);
if (!explicitOptions.explicitEnabled)
return ok;
@@ -2293,7 +2293,7 @@ void CHyprRenderer::endRender() {
if (m_eRenderMode == RENDER_MODE_NORMAL) {
PMONITOR->output->state->setBuffer(m_pCurrentBuffer);
- auto explicitOptions = getExplicitSyncSettings();
+ auto explicitOptions = getExplicitSyncSettings(PMONITOR->output);
if (PMONITOR->inTimeline && explicitOptions.explicitEnabled && explicitOptions.explicitKMSEnabled) {
auto sync = g_pHyprOpenGL->createEGLSync({});
@@ -2336,7 +2336,7 @@ bool CHyprRenderer::isNvidia() {
return m_bNvidia;
}
-SExplicitSyncSettings CHyprRenderer::getExplicitSyncSettings() {
+SExplicitSyncSettings CHyprRenderer::getExplicitSyncSettings(SP<Aquamarine::IOutput> output) {
static auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("render:explicit_sync");
static auto PENABLEEXPLICITKMS = CConfigValue<Hyprlang::INT>("render:explicit_sync_kms");
@@ -2344,6 +2344,14 @@ SExplicitSyncSettings CHyprRenderer::getExplicitSyncSettings() {
settings.explicitEnabled = *PENABLEEXPLICIT;
settings.explicitKMSEnabled = *PENABLEEXPLICITKMS;
+ if (!output->supportsExplicit) {
+ Debug::log(LOG, "Renderer: the aquamarine output does not support explicit, explicit settings are disabled.");
+ settings.explicitEnabled = false;
+ settings.explicitKMSEnabled = false;
+
+ return settings;
+ }
+
if (*PENABLEEXPLICIT == 2 /* auto */)
settings.explicitEnabled = true;
if (*PENABLEEXPLICITKMS == 2 /* auto */) {