[PATCH i-g-t] tests/kms_setmode: Fix clone mode mismatch by preferring eDP mode

Sokolowski, Jan jan.sokolowski at intel.com
Thu Jul 10 09:32:46 UTC 2025



> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Jeevan
> B
> Sent: Thursday, July 10, 2025 9:05 AM
> To: igt-dev at lists.freedesktop.org
> Cc: B, Jeevan <jeevan.b at intel.com>
> Subject: [PATCH i-g-t] tests/kms_setmode: Fix clone mode mismatch by
> preferring eDP mode
> 
> 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;
> +

Unnecessary newline.

>  	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