[igt-dev] [PATCH i-g-t 2/2] tests/kms_invalid_mode: Test Cleanup

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Fri Jun 24 05:09:38 UTC 2022


On Fri-24-06-2022 05:27 am, Nidhi Gupta wrote:
> Sanitize the system state before starting the subtest.
> 
> Signed-off-by: Nidhi Gupta <nidhi1.gupta at intel.com>
> ---
>   tests/kms_invalid_mode.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_invalid_mode.c b/tests/kms_invalid_mode.c
> index 7e1f683b..423d360f 100644
> --- a/tests/kms_invalid_mode.c
> +++ b/tests/kms_invalid_mode.c
> @@ -184,9 +184,9 @@ test_output(data_t *data)
>   	igt_output_t *output = data->output;
>   	drmModeModeInfo mode;
>   	struct igt_fb fb;
> -	int ret;
> -	uint32_t crtc_id;
>   
> +	igt_display_reset(&data->display);
> +	igt_output_set_pipe(output, data->pipe);
>   	/*
>   	 * FIXME test every mode we have to be more
>   	 * sure everything is really getting rejected?

mode = *igt_output_get_mode(output);
igt_require(data->adjust_mode(data, &mode));

As we are adjusting the mode, I guess we must override with the updated one.

hmm, we are always trying with default mode. How about trying with few 
override modes?

> @@ -203,12 +203,7 @@ test_output(data_t *data)
>   
>   	kmstest_unset_all_crtcs(data->drm_fd, data->res);

This is redundant to igt_display_reset(), also it'll unset all crtcs 
before commit, so we'll endup to commit with out crtc. Please drop it.

Also, data->res is no more required as we are using IGT wrappers.

And please add igt_display_require_output() to igt_fixture.

>   
> -	crtc_id = data->display.pipes[data->pipe].crtc_id;
> -
> -	ret = drmModeSetCrtc(data->drm_fd, crtc_id,
> -			     fb.fb_id, 0, 0,
> -			     &output->id, 1, &mode);
> -	igt_assert_lt(ret, 0);
> +	igt_display_commit(&data->display);

Cleanup is required here.
igt_output_set_pipe(output, PIPE_NONE);

>   
>   	igt_remove_fb(data->drm_fd, &fb);
>   }



More information about the igt-dev mailing list