[PATCH i-g-t] tests/kms_setmode: Fix clone mode mismatch by preferring eDP mode
Kamil Konieczny
kamil.konieczny at linux.intel.com
Mon Jul 14 10:41:30 UTC 2025
Hi Jeevan,
On 2025-07-10 at 12:35:27 +0530, Jeevan B wrote:
> 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;
Remove above change.
> + 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;
> + }
Looks good, let the KMS devs look into this, so
+cc Swati and Karthik
Cc: Karthik B S <karthik.b.s at intel.com>
Cc: Swati Sharma <swati2.sharma at intel.com>
> +
> /*
> * 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;
Do not remove this as this is documented here.
Regards,
Kamil
> +
> 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