From 35a7e30952c764a943a84a032715be8baee9d9ca Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 11 Jun 2024 12:49:53 +0200 Subject: [PATCH] backends/drm: set scaling mode to full aspect with generated modes on internal displays While the scaling mode has caused some issues with external displays, we've had several reports that using "unify outputs" has caused the internal display to no longer show anything, as it changes to an unsupported mode. This sets the scaling mode so that the driver handles the scaling internally, instead of leaving it up to the panel, and it only does so on internal displays with generated modes, to minimize the risk of further breakage. BUG: 488111 --- src/backends/drm/drm_pipeline.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index b89a9f57a9..957d115a52 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -321,8 +321,12 @@ bool DrmPipeline::prepareAtomicModeset(DrmAtomicCommit *commit) } else if (m_connector->colorspace.isValid()) { commit->addEnum(m_connector->colorspace, DrmConnector::Colorspace::Default); } - if (m_connector->scalingMode.isValid() && m_connector->scalingMode.hasEnum(DrmConnector::ScalingMode::None)) { - commit->addEnum(m_connector->scalingMode, DrmConnector::ScalingMode::None); + if (m_connector->scalingMode.isValid()) { + if (m_connector->isInternal() && m_connector->scalingMode.hasEnum(DrmConnector::ScalingMode::Full_Aspect) && (m_pending.mode->flags() & OutputMode::Flag::Generated)) { + commit->addEnum(m_connector->scalingMode, DrmConnector::ScalingMode::Full_Aspect); + } else if (m_connector->scalingMode.hasEnum(DrmConnector::ScalingMode::None)) { + commit->addEnum(m_connector->scalingMode, DrmConnector::ScalingMode::None); + } } commit->addProperty(m_pending.crtc->active, 1);