[igt-dev] [i-g-t] tests/kms_setmode: Handle unsupported modes for invalid crtc test

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Fri Aug 20 10:55:34 UTC 2021


Thanks for the patch. This indeed was missing for the invalid tests with 
multi-displays.

Patch looks good to me.

Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>


On 8/19/2021 1:12 PM, Tejas Upadhyay wrote:
> Unsupported modes in crtc need to return proper error in order
> to report back that applied config was failed or not. Thus added
> ENOENT error.
>
> Test affected (fail -> pass after change) :
> igt at kms_setmode@invalid-clone-single-[crtc|crtc-stealing]
>
> Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay at intel.com>
> ---
>   tests/kms_setmode.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
> index 89220b83..f322a373 100644
> --- a/tests/kms_setmode.c
> +++ b/tests/kms_setmode.c
> @@ -569,8 +569,10 @@ int __test_crtc_config(struct crtc_config *crtcs, int crtc_count,
>   	for (int i = 0; i < crtc->cconfs->connector->count_modes; i++) {
>   		uint32_t *ids;
>   
> -		if (!crtc_supports_mode(crtc, &crtc->cconfs->connector->modes[i]))
> +		if (!crtc_supports_mode(crtc, &crtc->cconfs->connector->modes[i])) {
> +			ret = -ENOENT;
>   			continue;
> +		}
>   
>   		crtc->mode = crtc->cconfs->connector->modes[i];
>   
> @@ -622,6 +624,9 @@ int __test_crtc_config(struct crtc_config *crtcs, int crtc_count,
>   		return ret;
>   	}
>   
> +	if (ret < 0)
> +		*config_failed = true;
> +
>   	/* When all crtcs[base].modes are tried & failed to fit into link BW. */
>   	return ret;
>   }


More information about the igt-dev mailing list