render: fixup format mismatch after leaving DS

fixes #7373
This commit is contained in:
vaxerski
2024-08-17 19:27:11 +02:00
parent 92744b5b9a
commit 912e7ba82d
4 changed files with 16 additions and 11 deletions

View File

@@ -1207,6 +1207,9 @@ void CHyprRenderer::renderMonitor(CMonitor* pMonitor) {
} else if (!pMonitor->lastScanout.expired()) {
Debug::log(LOG, "Left a direct scanout.");
pMonitor->lastScanout.reset();
// reset DRM format, make sure it's the one we want.
pMonitor->output->state->setFormat(pMonitor->drmFormat);
}
}
@@ -2155,6 +2158,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
for (auto& fmt : formats[(int)!RULE->enable10bit]) {
pMonitor->output->state->setFormat(fmt.second);
pMonitor->drmFormat = fmt.second;
if (!pMonitor->state.test()) {
Debug::log(ERR, "output {} failed basic test on format {}", pMonitor->szName, fmt.first);