From: Jeevan B <jeevan.b@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, jani.nikula@intel.com,
Jeevan B <jeevan.b@intel.com>
Subject: [PATCH i-g-t] tests/kms_plane_cursor: limit simulation to first and last CRTC
Date: Tue, 24 Nov 2026 11:57:25 +0530 [thread overview]
Message-ID: <20261124062725.952438-1-jeevan.b@intel.com> (raw)
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.
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.
v4:
- Split the validity check and per-pipe run into helpers, and pick
the first/last valid CRTC while iterating, then run only those
after the loop in simulation.
Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
tests/kms_plane_cursor.c | 92 +++++++++++++++++++++++++++-------------
1 file changed, 62 insertions(+), 30 deletions(-)
diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index 4b69f1a17..f932cc775 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -284,14 +284,51 @@ static void test_cursor(data_t *data, int size, unsigned int flags)
test_cursor_spots(data, size, flags);
}
-int igt_main()
+static bool pipe_output_valid(data_t *data, igt_crtc_t *crtc,
+ igt_output_t *output, unsigned int flags)
+{
+ if ((flags & TEST_OVERLAY) &&
+ !igt_crtc_get_plane_type(crtc, DRM_PLANE_TYPE_OVERLAY))
+ return false;
+
+ igt_display_reset(&data->display);
+ igt_output_set_crtc(output, crtc);
+
+ return intel_pipe_output_combo_valid(&data->display);
+}
+
+static void run_pipe(data_t *data, igt_crtc_t *crtc, igt_output_t *output,
+ unsigned int flags)
{
static const int cursor_sizes[] = { 64, 128, 256 };
+ int j;
+
+ igt_display_reset(&data->display);
+ igt_output_set_crtc(output, crtc);
+
+ test_init(data, crtc, output, flags);
+
+ for (j = 0; j < ARRAY_SIZE(cursor_sizes); j++) {
+ int size = cursor_sizes[j];
+
+ igt_dynamic_f("pipe-%s-%s-size-%d", igt_crtc_name(crtc),
+ igt_output_name(output), size)
+ test_cursor(data, size, flags);
+
+ test_cleanup(data);
+ if (igt_run_in_simulation())
+ break;
+ }
+
+ test_fini(data);
+}
+
+int igt_main()
+{
data_t data = { .max_curw = 64, .max_curh = 64 };
igt_crtc_t *crtc;
igt_output_t *output;
- igt_display_t *display;
- int i, j;
+ int i;
struct {
const char *name;
unsigned int flags;
@@ -314,7 +351,6 @@ int igt_main()
igt_display_require(&data.display, data.drm_fd);
igt_require(data.display.is_atomic);
igt_display_require_output(&data.display);
- display = &data.display;
ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &data.max_curw);
igt_assert(ret == 0 || errno == EINVAL);
@@ -327,40 +363,36 @@ 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) {
+ igt_crtc_t *first_crtc = NULL, *last_crtc = NULL;
+ igt_output_t *first_output = NULL, *last_output = NULL;
+
for_each_crtc_with_single_output(&data.display, crtc,
output) {
- if ((tests[i].flags & TEST_OVERLAY) &&
- !igt_crtc_get_plane_type(crtc,
- DRM_PLANE_TYPE_OVERLAY))
+ if (!pipe_output_valid(&data, crtc, output,
+ tests[i].flags))
continue;
- igt_display_reset(display);
-
- igt_output_set_crtc(output,
- crtc);
- if (!intel_pipe_output_combo_valid(display))
+ if (!igt_run_in_simulation()) {
+ run_pipe(&data, crtc, output,
+ tests[i].flags);
continue;
+ }
- test_init(&data,
- crtc,
- output,
- tests[i].flags);
-
- for (j = 0; j < ARRAY_SIZE(cursor_sizes); j++) {
- int size = cursor_sizes[j];
-
- igt_dynamic_f("pipe-%s-%s-size-%d",
- igt_crtc_name(crtc),
- igt_output_name(output),
- size)
- test_cursor(&data, size, tests[i].flags);
-
- test_cleanup(&data);
- if (igt_run_in_simulation())
- break;
+ if (!first_crtc) {
+ first_crtc = crtc;
+ first_output = output;
}
+ last_crtc = crtc;
+ last_output = output;
+ }
- test_fini(&data);
+ if (first_crtc) {
+ run_pipe(&data, first_crtc, first_output,
+ tests[i].flags);
+ if (last_crtc->crtc_index -
+ first_crtc->crtc_index > 1)
+ run_pipe(&data, last_crtc, last_output,
+ tests[i].flags);
}
}
}
--
2.43.0
next reply other threads:[~2026-11-24 6:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 6:27 Jeevan B [this message]
-- strict thread matches above, loose matches on Subject: below --
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
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=20261124062725.952438-1-jeevan.b@intel.com \
--to=jeevan.b@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@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