Skip to content

Commit 5d2b008

Browse files
authored
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.
1 parent 208f94f commit 5d2b008

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/helpers/Monitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,7 @@ bool CMonitor::attemptDirectScanout() {
13121312
return false;
13131313
}
13141314

1315-
auto explicitOptions = g_pHyprRenderer->getExplicitSyncSettings();
1315+
auto explicitOptions = g_pHyprRenderer->getExplicitSyncSettings(output);
13161316

13171317
// wait for the explicit fence if present, and if kms explicit is allowed
13181318
bool DOEXPLICIT = PSURFACE->syncobj && PSURFACE->syncobj->current.acquireTimeline && PSURFACE->syncobj->current.acquireTimeline->timeline && explicitOptions.explicitKMSEnabled;

src/render/Renderer.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ bool CHyprRenderer::commitPendingAndDoExplicitSync(PHLMONITOR pMonitor) {
15571557
}
15581558
}
15591559

1560-
auto explicitOptions = getExplicitSyncSettings();
1560+
auto explicitOptions = getExplicitSyncSettings(pMonitor->output);
15611561
if (!explicitOptions.explicitEnabled)
15621562
return ok;
15631563

@@ -2293,7 +2293,7 @@ void CHyprRenderer::endRender() {
22932293
if (m_eRenderMode == RENDER_MODE_NORMAL) {
22942294
PMONITOR->output->state->setBuffer(m_pCurrentBuffer);
22952295

2296-
auto explicitOptions = getExplicitSyncSettings();
2296+
auto explicitOptions = getExplicitSyncSettings(PMONITOR->output);
22972297

22982298
if (PMONITOR->inTimeline && explicitOptions.explicitEnabled && explicitOptions.explicitKMSEnabled) {
22992299
auto sync = g_pHyprOpenGL->createEGLSync({});
@@ -2336,14 +2336,22 @@ bool CHyprRenderer::isNvidia() {
23362336
return m_bNvidia;
23372337
}
23382338

2339-
SExplicitSyncSettings CHyprRenderer::getExplicitSyncSettings() {
2339+
SExplicitSyncSettings CHyprRenderer::getExplicitSyncSettings(SP<Aquamarine::IOutput> output) {
23402340
static auto PENABLEEXPLICIT = CConfigValue<Hyprlang::INT>("render:explicit_sync");
23412341
static auto PENABLEEXPLICITKMS = CConfigValue<Hyprlang::INT>("render:explicit_sync_kms");
23422342

23432343
SExplicitSyncSettings settings;
23442344
settings.explicitEnabled = *PENABLEEXPLICIT;
23452345
settings.explicitKMSEnabled = *PENABLEEXPLICITKMS;
23462346

2347+
if (!output->supportsExplicit) {
2348+
Debug::log(LOG, "Renderer: the aquamarine output does not support explicit, explicit settings are disabled.");
2349+
settings.explicitEnabled = false;
2350+
settings.explicitKMSEnabled = false;
2351+
2352+
return settings;
2353+
}
2354+
23472355
if (*PENABLEEXPLICIT == 2 /* auto */)
23482356
settings.explicitEnabled = true;
23492357
if (*PENABLEEXPLICITKMS == 2 /* auto */) {

src/render/Renderer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class CHyprRenderer {
7575
bool isNvidia();
7676
void makeEGLCurrent();
7777
void unsetEGL();
78-
SExplicitSyncSettings getExplicitSyncSettings();
78+
SExplicitSyncSettings getExplicitSyncSettings(SP<Aquamarine::IOutput> output);
7979
void addWindowToRenderUnfocused(PHLWINDOW window);
8080
void makeWindowSnapshot(PHLWINDOW);
8181
void makeRawWindowSnapshot(PHLWINDOW, CFramebuffer*);

0 commit comments

Comments
 (0)