[igt-dev] [PATCH i-g-t 1/2] [i-g-t] tests/kms: IGT cleanup

Modem, Bhanuprakash bhanuprakash.modem at intel.com
Wed Apr 20 13:37:44 UTC 2022


Hi Thasleem,

Thanks for the patch. I think, commit subject shouldn't be the same for 
all commits in this series. Please try to follow: 
https://cbea.ms/git-commit/

Also commit subject should start with "tests/<test_name>:"
Ex: tests/kms_vrr: Introduce dynamic subtests

As you started to cleanup the IGT, please try to make sure below points:
- Convert to dynamic subtests
- Sanitize the state before starting the subtest. (igt_display_reset)
- Clear the states before exiting the subtest.
- Update existing libdrm APIs with IGT kms APIs.
- Other misc (Ex: update deprecated APIs/macros/enums, FB leaks etc..)

- Bhanu

On Tue-12-10-2021 04:22 pm, Mohammed Thasleem wrote:
> Before starting the subtest, clean up the states to default
> by igt_display_reset().
> 
> Replace newly defined function in particular test with existing
> library function.
> 
> Signed-off-by: Mohammed Thasleem <mohammed.thasleem at intel.com>
> ---
>   tests/i915/kms_mmap_write_crc.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
> index b17e5fdb..f8825284 100644
> --- a/tests/i915/kms_mmap_write_crc.c
> +++ b/tests/i915/kms_mmap_write_crc.c
> @@ -169,6 +169,8 @@ static void prepare_crtc(data_t *data)
>   	igt_output_t *output = data->output;
>   	drmModeModeInfo *mode;
>   
> +	igt_display_reset(&data->display);
> +
>   	/* select the pipe we want to use */
>   	igt_output_set_pipe(output, data->pipe);
>   
> @@ -204,8 +206,8 @@ static void cleanup_crtc(data_t *data)
>   
>   	igt_plane_set_fb(data->primary, NULL);
>   
> -	igt_output_set_pipe(output, PIPE_ANY);
> -	igt_display_commit(display);
> +	igt_output_set_pipe(output, PIPE_NONE);
> +	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>   
>   	igt_remove_fb(data->drm_fd, &data->fb[0]);
>   	igt_remove_fb(data->drm_fd, &data->fb[1]);



More information about the igt-dev mailing list