From 2d29c86d69971ea1a092659e9d8e3e0f75223766 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 18 Aug 2024 20:15:34 +0200 Subject: [PATCH] drm: use modelines in vt restore --- src/backend/drm/DRM.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/drm/DRM.cpp b/src/backend/drm/DRM.cpp index aa51487..89aaa6a 100644 --- a/src/backend/drm/DRM.cpp +++ b/src/backend/drm/DRM.cpp @@ -302,15 +302,16 @@ void Aquamarine::CDRMBackend::restoreAfterVT() { }; auto& STATE = c->output->state->state(); + auto& MODE = STATE.customMode ? STATE.customMode : STATE.mode; - if (!STATE.customMode && !STATE.mode) { + if (!MODE) { backend->log(AQ_LOG_WARNING, "drm: Connector {} has output but state has no mode, will send a reset state event later."); noMode.emplace_back(c); continue; } - if (STATE.mode && STATE.mode->modeInfo.has_value()) - data.modeInfo = *STATE.mode->modeInfo; + if (MODE->modeInfo.has_value()) + data.modeInfo = *MODE->modeInfo; else data.calculateMode(c);