All of 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>,
	"Michał Grzelak" <michal.grzelak@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC
Date: Tue, 24 Nov 2026 13:02:33 +0200	[thread overview]
Message-ID: <6676344cae734db2fddb0783bdeb9712a4d0f963@intel.com> (raw)
In-Reply-To: <20261124062725.952438-1-jeevan.b@intel.com>

On Tue, 24 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.
>
> Move the per-pipe validity check and the per-pipe subtest body into
> pipe_output_valid() and run_pipe() so both the regular and the
> simulation paths can share them.

I think you're overcomplicating things for something that should be
simplified.

I don't know what to say. I don't think my review comments are being
understood.

Below is what I meant, maybe C is the lingua franca. Use the first and
last pipes on simulation, all otherwise. And keep the simulation
conditional stuff mostly out of the main test loops, because it
complicates everything.

Also Cc: Michał, this is what I meant in my comments to you too. There's
no need for those complicated arrays with bools.


BR,
Jani.


PS. It's untested.


diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index 4b69f1a17e24..a1111245fb0d 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -284,6 +284,27 @@ static void test_cursor(data_t *data, int size, unsigned int flags)
        test_cursor_spots(data, size, flags);
 }
 
+static uint32_t get_crtc_index_mask(igt_display_t *display)
+{
+       igt_crtc_t *crtc, *first_pipe_crtc = NULL, *last_pipe_crtc = NULL;
+       __maybe_unused igt_output_t *output;
+       uint32_t crtc_index_mask = 0;
+
+       for_each_crtc_with_single_output(display, crtc, output) {
+               if (!first_pipe_crtc || crtc->hardware_pipe < first_pipe_crtc->hardware_pipe)
+                       first_pipe_crtc = crtc;
+               if (!last_pipe_crtc || crtc->hardware_pipe > last_pipe_crtc->hardware_pipe)
+                       last_pipe_crtc = crtc;
+               crtc_index_mask |= 1 << crtc->crtc_index;
+       }
+
+       if (igt_run_in_simulation() && first_pipe_crtc && last_pipe_crtc)
+               crtc_index_mask = 1 << first_pipe_crtc->crtc_index |
+                       1 << last_pipe_crtc->crtc_index;
+
+       return crtc_index_mask;
+}
+
 int igt_main()
 {
        static const int cursor_sizes[] = { 64, 128, 256 };
@@ -291,6 +312,7 @@ int igt_main()
        igt_crtc_t *crtc;
        igt_output_t *output;
        igt_display_t *display;
+       uint32_t crtc_index_mask = 0;
        int i, j;
        struct {
                const char *name;
@@ -322,6 +344,8 @@ int igt_main()
                igt_assert(ret == 0 || errno == EINVAL);
 
                kmstest_set_vt_graphics_mode();
+
+               crtc_index_mask = get_crtc_index_mask(&data.display);
        }
 
        for (i = 0; i < ARRAY_SIZE(tests); i++) {
@@ -329,6 +353,9 @@ int igt_main()
                igt_subtest_with_dynamic_f("%s", tests[i].name) {
                        for_each_crtc_with_single_output(&data.display, crtc,
                                                         output) {
+                               if (!(crtc_index_mask & (1 << crtc->crtc_index)))
+                                       continue;
+
                                if ((tests[i].flags & TEST_OVERLAY) &&
                                    !igt_crtc_get_plane_type(crtc,
                                                             DRM_PLANE_TYPE_OVERLAY))


-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-24 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  6:27 [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC Jeevan B
2026-11-24 11:02 ` Jani Nikula [this message]
2026-11-24 22:43   ` Michał Grzelak
2026-11-25  9:38   ` B, Jeevan
  -- strict thread matches above, loose matches on Subject: below --
2026-11-25  9:41 Jeevan B
2026-11-23  5:56 Jeevan B
2026-11-23  9:32 ` Jani Nikula
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=6676344cae734db2fddb0783bdeb9712a4d0f963@intel.com \
    --to=jani.nikula@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=michal.grzelak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.