Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Juha-Pekka Heikkilä" <juhapekka.heikkila@gmail.com>
To: Luca Coelho <luciano.coelho@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/3] tests/kms_cursor_crc: clean up after a failed subtest
Date: Fri, 27 Nov 2026 17:03:50 +0200	[thread overview]
Message-ID: <acf5a98e-a45d-4fe1-920f-285620f53a20@gmail.com> (raw)
In-Reply-To: <20261126093003.492469-3-luciano.coelho@intel.com>

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

On 26/11/2026 10.48, Luca Coelho wrote:
> When a subtest fails, for instance on a CRC mismatch, it exits
> before calling cleanup_crtc().  The cursor and its FB are then still
> on screen when the test ends, so the next test that counts
> framebuffers, such as kms_universal_plane@cursor-fb-leak, finds one
> FB more at the start than at the end.
> 
> To fix this, call cleanup_crtc() from prepare_crtc() and at the end of
> the test if pipe_crc is still set, because that means the previous
> subtest didn't clean up.  Also use igt_display_reset() in
> cleanup_crtc(), so the cursor plane is reset as well and not only the
> output and the primary plane.  The igt_pipe_crc_free() in
> prepare_crtc() is unnecessary now, since cleanup_crtc() already frees
> the CRC.
> 
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
>   tests/kms_cursor_crc.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 6334f8f775c8..a060f8e24f6d 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -565,8 +565,8 @@ static void cleanup_crtc(data_t *data)
>   	cairo_surface_destroy(data->surface);
>   	data->surface = NULL;
>   
> -	igt_output_set_crtc(data->output, NULL);
> -	igt_plane_set_fb(data->primary, NULL);
> +	/* Reset all planes, so the cursor FB doesn't stay attached */
> +	igt_display_reset(display);
>   	igt_display_commit(display);
>   
>   	igt_remove_fb(data->drm_fd, &data->primary_fb[HWCURSORBUFFER]);
> @@ -581,6 +581,10 @@ static void prepare_crtc(data_t *data, int cursor_w, int cursor_h)
>   	cairo_t *cr;
>   	igt_output_t *output = data->output;
>   
> +	/* Clean up after a failed subtest */
> +	if (data->pipe_crc)
> +		cleanup_crtc(data);
> +
>   	igt_display_reset(display);
>   
>   	/* select the pipe we want to use */
> @@ -609,8 +613,6 @@ static void prepare_crtc(data_t *data, int cursor_w, int cursor_h)
>   	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_crtc_crc_new(data->crtc,
>   					  IGT_PIPE_CRC_SOURCE_AUTO);
>   
> @@ -1321,10 +1323,8 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)
>   		run_tests_on_pipe(&data);
>   
>   	igt_fixture() {
> -		if (data.pipe_crc != NULL) {
> -			igt_pipe_crc_stop(data.pipe_crc);
> -			igt_pipe_crc_free(data.pipe_crc);
> -		}
> +		if (data.pipe_crc)
> +			cleanup_crtc(&data);
>   
>   		igt_display_fini(&data.display);
>   		drm_close_driver(data.drm_fd);


  reply	other threads:[~2026-11-27 15:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  8:48 [PATCH i-g-t 0/3] tests/kms: don't fail cursor-fb-leak because of leftover FBs Luca Coelho
2026-11-26  8:48 ` [PATCH i-g-t 1/3] tests/kms_universal_plane: remove redundant is_intel_device() check Luca Coelho
2026-11-27 15:03   ` Juha-Pekka Heikkilä
2026-11-26  8:48 ` [PATCH i-g-t 2/3] tests/kms_cursor_crc: clean up after a failed subtest Luca Coelho
2026-11-27 15:03   ` Juha-Pekka Heikkilä [this message]
2026-11-26  8:48 ` [PATCH i-g-t 3/3] tests/kms_universal_plane: count FBs after the first commit Luca Coelho
2026-11-27 15:04   ` Juha-Pekka Heikkilä
2026-11-27  1:41 ` ✓ Xe.CI.BAT: success for tests/kms: don't fail cursor-fb-leak because of leftover FBs Patchwork
2026-11-27  1:56 ` ✗ i915.CI.BAT: failure " Patchwork
2026-11-27 14:34 ` ✓ Xe.CI.FULL: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acf5a98e-a45d-4fe1-920f-285620f53a20@gmail.com \
    --to=juhapekka.heikkila@gmail.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox