[PATCH i-g-t] tests/kms_setmode: Fix clone mode mismatch by preferring eDP mode
Jeevan B
jeevan.b at intel.com
Thu Jul 10 07:05:27 UTC 2025
If an eDP connector is present, prefer selecting its default mode for
cloning. Some eDP panels support only high refresh rate (HRR) modes,
which may not be compatible with external displays. To avoid invalid
clone configurations and test failures, we choose the default mode
from the eDP connector when available.
Signed-off-by: Jeevan B <jeevan.b at intel.com>
---
tests/kms_setmode.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 484c3a95f..462313e5a 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -252,12 +252,28 @@ static void get_mode_for_crtc(struct crtc_config *crtc,
goto found;
}
+ /* If an eDP connector is present, prefer selecting its default mode
+ * for cloning, since internal panels typically dictate the clone mode
+ * and may have HRR support, making them incompatible with modes
+ * supported by external displays.
+ */
+ mode = &crtc->cconfs[0].default_mode;
+ for (i = 1; i < crtc->connector_count; i++) {
+ drmModeConnector *conn = crtc->cconfs[i].connector;
+
+ if (conn->connector_type == DRM_MODE_CONNECTOR_eDP) {
+ if (crtc->cconfs[i].default_mode.clock < mode->clock)
+ mode = &crtc->cconfs[i].default_mode;
+ }
+ goto found;
+ }
+
/*
* If none is found then just pick the default mode from all connectors
* with the smallest clock, hope the other connectors can support it by
* scaling etc.
*/
- mode = &crtc->cconfs[0].default_mode;
+
for (i = 1; i < crtc->connector_count; i++)
if (crtc->cconfs[i].default_mode.clock < mode->clock)
mode = &crtc->cconfs[i].default_mode;
--
2.43.0
More information about the igt-dev
mailing list