Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Jeevan B <jeevan.b@intel.com>, igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, Jeevan B <jeevan.b@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC
Date: Mon, 23 Nov 2026 11:32:14 +0200	[thread overview]
Message-ID: <621c782368a8d45b97bddab30c05d49198838a2f@intel.com> (raw)
In-Reply-To: <20261123055604.724128-1-jeevan.b@intel.com>

On Mon, 23 Nov 2026, Jeevan B <jeevan.b@intel.com> wrote:
> Running on every CRTC makes the test hit the timeout on simulation.
> Restrict it to the first and last usable CRTC when running in
> simulation, which keeps coverage while avoiding the timeout.
>
> v2:
>  - Test the first and last usable CRTC instead of the first 2 pipes,
>    and drop SIM_MAX_PIPES.
> v3:
>  - Skip non-first/non-last CRTCs inside the existing loop.
>
> Signed-off-by: Jeevan B <jeevan.b@intel.com>
> ---
>  tests/kms_plane_cursor.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
> index 4b69f1a17..dfe1f2418 100644
> --- a/tests/kms_plane_cursor.c
> +++ b/tests/kms_plane_cursor.c
> @@ -288,7 +288,7 @@ int igt_main()
>  {
>  	static const int cursor_sizes[] = { 64, 128, 256 };
>  	data_t data = { .max_curw = 64, .max_curh = 64 };
> -	igt_crtc_t *crtc;
> +	igt_crtc_t *crtc, *last_crtc;
>  	igt_output_t *output;
>  	igt_display_t *display;
>  	int i, j;
> @@ -315,6 +315,8 @@ int igt_main()
>  		igt_require(data.display.is_atomic);
>  		igt_display_require_output(&data.display);
>  		display = &data.display;
> +		last_crtc = igt_crtc_for_pipe(display,
> +					      igt_display_n_crtcs(display) - 1);

That's just plain wrong in many different ways.

Basically there's no guarantee "igt_display_n_crtcs(display) - 1" is a
pipe that exists. Pipes aren't guaranteed to be consecutive, and they
may not have anything to do with the number of CRTCs or CRTC indexes or
anything.

Even if "igt_display_n_crtcs(display) - 1" exists, it may be any pipe,
first, last, or something in between. You just can't make any
assumptions about pipe numbering or how they correspond to CRTCs.

And, in general, do not use igt_crtc_for_pipe() at all if it can be
avoided. Everything should be CRTC based if possible.

---

Now, we've seen patches here that do stuff on first/last pipe only, or
first/last CRTC only, or whatever.

I've said it a few times in various contexts, but this sprinkling of
random checks within loops is really not the way to go.

What you want is a CRTC index mask that you initialize in the beginning,
and the test loop only uses CRTCs that are in the mask. The test loop
shouldn't need to do any of this "igt_run_in_simulation()" or whatever.


BR,
Jani.


>  
>  		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &data.max_curw);
>  		igt_assert(ret == 0 || errno == EINVAL);
> @@ -327,6 +329,8 @@ int igt_main()
>  	for (i = 0; i < ARRAY_SIZE(tests); i++) {
>  		igt_describe_f("%s", tests[i].desc);
>  		igt_subtest_with_dynamic_f("%s", tests[i].name) {
> +			bool tested_first = false;
> +
>  			for_each_crtc_with_single_output(&data.display, crtc,
>  							 output) {
>  				if ((tests[i].flags & TEST_OVERLAY) &&
> @@ -334,6 +338,15 @@ int igt_main()
>  							     DRM_PLANE_TYPE_OVERLAY))
>  					continue;
>  
> +				/*
> +				 * In simulation, only test the first usable
> +				 * CRTC and the last one to avoid timeouts
> +				 * while keeping coverage.
> +				 */
> +				if (igt_run_in_simulation() && tested_first &&
> +				    crtc != last_crtc)
> +					continue;
> +
>  				igt_display_reset(display);
>  
>  				igt_output_set_crtc(output,
> @@ -341,6 +354,8 @@ int igt_main()
>  				if (!intel_pipe_output_combo_valid(display))
>  					continue;
>  
> +				tested_first = true;
> +
>  				test_init(&data,
>  					  crtc,
>  					  output,

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-23  9:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  5:56 [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC Jeevan B
2026-11-23  9:32 ` Jani Nikula [this message]
2026-11-24  2:14 ` ✓ Xe.CI.BAT: success for tests/kms_plane_cursor: limit simulation to first and last CRTC (rev2) Patchwork
2026-11-24  2:35 ` ✓ i915.CI.BAT: " Patchwork
2026-11-24  4:26 ` ✗ Xe.CI.FULL: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-11-24  6:27 [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC Jeevan B
2026-11-16  4:01 Jeevan B
2026-11-16  9:35 ` Jani Nikula

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=621c782368a8d45b97bddab30c05d49198838a2f@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=karthik.b.s@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