mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-25 17:21:54 -07:00
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.
This commit is contained in:
@@ -1312,7 +1312,7 @@ bool CMonitor::attemptDirectScanout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto explicitOptions = g_pHyprRenderer->getExplicitSyncSettings();
|
||||
auto explicitOptions = g_pHyprRenderer->getExplicitSyncSettings(output);
|
||||
|
||||
// wait for the explicit fence if present, and if kms explicit is allowed
|
||||
bool DOEXPLICIT = PSURFACE->syncobj && PSURFACE->syncobj->current.acquireTimeline && PSURFACE->syncobj->current.acquireTimeline->timeline && explicitOptions.explicitKMSEnabled;
|
||||
|
@@ -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 */) {
|
||||
|
@@ -75,7 +75,7 @@ class CHyprRenderer {
|
||||
bool isNvidia();
|
||||
void makeEGLCurrent();
|
||||
void unsetEGL();
|
||||
SExplicitSyncSettings getExplicitSyncSettings();
|
||||
SExplicitSyncSettings getExplicitSyncSettings(SP<Aquamarine::IOutput> output);
|
||||
void addWindowToRenderUnfocused(PHLWINDOW window);
|
||||
void makeWindowSnapshot(PHLWINDOW);
|
||||
void makeRawWindowSnapshot(PHLWINDOW, CFramebuffer*);
|
||||
|
Reference in New Issue
Block a user