[plasma/kwin] /: backends/drm: only generate common modes on internal displays

Xaver Hugl <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 1940926696cdc932966dc5e0fdce039c194f803c by Xaver Hugl.
Committed on 30/07/2026 at 13:31.
Pushed by zamundaaa into branch 'master'.

backends/drm: only generate common modes on internal displays

On external displays, they might not work, and since we have custom modes, we
can just leave it up to the user to add a custom mode if they really need it.

M  +1    -0    autotests/drm/mockDrmTest.cpp
M  +3    -1    src/backends/drm/drm_connector.cpp

https://invent.kde.org/plasma/kwin/-/commit/1940926696cdc932966dc5e0fdce039c194f803c

diff --git a/autotests/drm/mockDrmTest.cpp b/autotests/drm/mockDrmTest.cpp
index 0df2a0f40a6..e7709e20107 100644
--- a/autotests/drm/mockDrmTest.cpp
+++ b/autotests/drm/mockDrmTest.cpp
@@ -364,6 +364,7 @@ void DrmTest::testModeGeneration()
     const auto mockGpu = findPrimaryDevice(5);
 
     const auto conn = std::make_shared<MockConnector>(mockGpu.get());
+    conn->type = DRM_MODE_CONNECTOR_eDP;
     mockGpu->connectors.push_back(conn);
 
     const auto session = Session::create(Session::Type::Noop);
diff --git a/src/backends/drm/drm_connector.cpp b/src/backends/drm/drm_connector.cpp
index bcd54d3cf95..59d7ee52ca9 100644
--- a/src/backends/drm/drm_connector.cpp
+++ b/src/backends/drm/drm_connector.cpp
@@ -329,7 +329,9 @@ bool DrmConnector::updateProperties()
         }
         m_modes.clear();
         m_modes.append(m_driverModes);
-        if (scalingMode.isValid() && scalingMode.hasEnum(ScalingMode::Full_Aspect)) {
+        // only generate common modes on internal panels, where we can be certain they will work.
+        // For external displays, users can manually add custom modes to get the same result.
+        if (scalingMode.isValid() && scalingMode.hasEnum(ScalingMode::Full_Aspect) && isInternal()) {
             m_modes.append(generateCommonModes());
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.