[i-g-t,1/2] test/kms_cursor_crc: release old pipe_crc before create a new one
diff mbox series

Message ID 0cef6a7b7dbd8510de62f0c17e8cd952cfa84678.1592840756.git.melissa.srw@gmail.com
State New
Headers show
Series
  • test/kms_cursor_crc: tie some loose ends in the prepare_crtc
Related show

Commit Message

Melissa Wen June 22, 2020, 4:37 p.m. UTC
When a subtest fails, it skips the cleanup, and its pipe_crc remains allocated.
As a consequence, the following subtest also fails (timeout) when trying to
create a new one. This patch releases any remaining pipe_crc to enable the
creation of a new one for the next subtest.

Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
---
 tests/kms_cursor_crc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Arkadiusz Hiler July 15, 2020, 12:47 p.m. UTC | #1
On Mon, Jun 22, 2020 at 01:37:55PM -0300, Melissa Wen wrote:
> When a subtest fails, it skips the cleanup, and its pipe_crc remains allocated.
> As a consequence, the following subtest also fails (timeout) when trying to
> create a new one. This patch releases any remaining pipe_crc to enable the
> creation of a new one for the next subtest.
> 
> Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
> ---
>  tests/kms_cursor_crc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index f105e295..5976df5f 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -423,6 +423,8 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
>  	igt_display_commit(display);
>  
>  	/* create the pipe_crc object for this pipe */
> +	if (data->pipe_crc)
> +		igt_pipe_crc_free(data->pipe_crc);

That's a welcome improvement, but you may want to also look at
06333955bf3d ("tests/kms_cursor_crc: start crc only once per test")
for some extra inspiration for future work on this.

It should be possible to initiate pipe crc to be initalized only once
per each tested pipe in run_tests_on_pipe() - igt_pipe_crc_new() can be
costly on some real panels.

Anyway,
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>


>  	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
>  					  INTEL_PIPE_CRC_SOURCE_AUTO);
>  
> -- 
> 2.27.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index f105e295..5976df5f 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -423,6 +423,8 @@  static void prepare_crtc(data_t *data, igt_output_t *output,
 	igt_display_commit(display);
 
 	/* create the pipe_crc object for this pipe */
+	if (data->pipe_crc)
+		igt_pipe_crc_free(data->pipe_crc);
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
 					  INTEL_PIPE_CRC_SOURCE_AUTO);