mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 06:18:05 +02:00
monitor: set format back after failing DS activation (#14168)
we do run m_lastScanout.reset(), but m_lastScanout might sometimes not be set. cache format from before attempting DS, and set back to it on activation failure.
This commit is contained in:
parent
d669ea7db2
commit
84d45bd13a
1 changed files with 10 additions and 1 deletions
|
|
@ -1991,7 +1991,8 @@ bool CMonitor::attemptDirectScanout() {
|
|||
if (m_lastScanout.expired())
|
||||
m_prevDrmFormat = m_drmFormat;
|
||||
|
||||
const bool NEEDS_TEST = !m_lastScanout || m_drmFormat != params.format; // do not retest while it's active
|
||||
const auto PREV_FORMAT = m_drmFormat;
|
||||
const bool NEEDS_TEST = !m_lastScanout || m_drmFormat != params.format; // do not retest while it's active
|
||||
if (m_drmFormat != params.format) {
|
||||
m_output->state->setFormat(params.format);
|
||||
m_drmFormat = params.format;
|
||||
|
|
@ -2004,6 +2005,10 @@ bool CMonitor::attemptDirectScanout() {
|
|||
|
||||
if (NEEDS_TEST && !m_state.test()) {
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed basic test");
|
||||
if (m_drmFormat != PREV_FORMAT) {
|
||||
m_output->state->setFormat(PREV_FORMAT);
|
||||
m_drmFormat = PREV_FORMAT;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2029,6 +2034,10 @@ bool CMonitor::attemptDirectScanout() {
|
|||
|
||||
if (!ok) {
|
||||
Log::logger->log(Log::TRACE, "attemptDirectScanout: failed to scanout surface");
|
||||
if (m_drmFormat != PREV_FORMAT) {
|
||||
m_output->state->setFormat(PREV_FORMAT);
|
||||
m_drmFormat = PREV_FORMAT;
|
||||
}
|
||||
m_lastScanout.reset();
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue