* [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup
@ 2022-04-22 15:20 Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 1/2] tests/kms: sanitize the system state between subtests Nidhi Gupta
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-22 15:20 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
kms/tests : IGT cleanup & added dynamic subtests
Nidhi Gupta (2):
tests/kms: sanitize the system state between subtests
tests/kms : Added dynamic test cases
tests/kms_concurrent.c | 45 ++++++++------------
tests/kms_sequence.c | 94 +++++++++++++++++++++---------------------
2 files changed, 66 insertions(+), 73 deletions(-)
--
2.26.2
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 1/2] tests/kms: sanitize the system state between subtests
2022-04-22 15:20 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
@ 2022-04-22 15:20 ` Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
2022-04-22 17:46 ` [igt-dev] ✗ Fi.CI.BAT: failure for kms/tests : IGT cleanup (rev4) Patchwork
2 siblings, 0 replies; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-22 15:20 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
Before running the subtest we need to sanitize the system state
to default, since we can't trust the state of previous subtest, used
igt_display_reset() to sanitize the state.
Replace newly defined function in particular test with existing library
function.
Below tests are modified:
tests/kms_concurrent.c
tests/kms_sequence.c
Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
tests/kms_concurrent.c | 39 ++++++++++++++-------------------------
tests/kms_sequence.c | 6 ++++--
2 files changed, 18 insertions(+), 27 deletions(-)
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index dc1e36f2..622d3335 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -82,7 +82,8 @@ static void test_fini(data_t *data, enum pipe pipe, int n_planes,
}
/* reset the constraint on the pipe */
- igt_output_set_pipe(output, PIPE_ANY);
+ igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
free(data->plane);
data->plane = NULL;
@@ -289,35 +290,28 @@ test_resolution_with_output(data_t *data, enum pipe pipe, int max_planes, igt_ou
static void
run_test(data_t *data, enum pipe pipe, igt_output_t *output)
{
- int connected_outs;
int n_planes = data->display.pipes[pipe].n_planes;
+ igt_display_reset(&data->display);
if (!opt.user_seed)
opt.seed = time(NULL);
- connected_outs = 0;
- for_each_valid_output_on_pipe(&data->display, pipe, output) {
- igt_info("Testing resolution with connector %s using pipe %s with seed %d\n",
- igt_output_name(output), kmstest_pipe_name(pipe), opt.seed);
+ igt_info("Testing resolution with connector %s using pipe %s with seed %d\n",
+ igt_output_name(output), kmstest_pipe_name(pipe), opt.seed);
- srand(opt.seed);
+ srand(opt.seed);
- test_init(data, pipe, n_planes, output);
+ test_init(data, pipe, n_planes, output);
- igt_fork(child, 1) {
- test_plane_position_with_output(data, pipe, n_planes, output);
- }
-
- test_resolution_with_output(data, pipe, n_planes, output);
-
- igt_waitchildren();
+ igt_fork(child, 1) {
+ test_plane_position_with_output(data, pipe, n_planes, output);
+ }
- test_fini(data, pipe, n_planes, output);
+ test_resolution_with_output(data, pipe, n_planes, output);
- connected_outs++;
- }
+ igt_waitchildren();
- igt_skip_on(connected_outs == 0);
+ test_fini(data, pipe, n_planes, output);
}
static void
@@ -326,15 +320,10 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
igt_output_t *output;
igt_fixture {
- int valid_tests = 0;
-
igt_require_pipe(&data->display, pipe);
igt_require(data->display.pipes[pipe].n_planes > 0);
- for_each_valid_output_on_pipe(&data->display, pipe, output)
- valid_tests++;
-
- igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+ igt_display_require_output(&data->display);
}
igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
index 9c287480..ca25e041 100644
--- a/tests/kms_sequence.c
+++ b/tests/kms_sequence.c
@@ -77,6 +77,8 @@ static void prepare_crtc(data_t *data, int fd, igt_output_t *output)
igt_display_t *display = &data->display;
igt_plane_t *primary;
+ igt_display_reset(&data->display);
+
/* select the pipe we want to use */
igt_output_set_pipe(output, data->pipe);
@@ -109,8 +111,8 @@ static void cleanup_crtc(data_t *data, int fd, igt_output_t *output)
primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
igt_plane_set_fb(primary, NULL);
- igt_output_set_pipe(output, PIPE_ANY);
- igt_display_commit(display);
+ igt_output_set_pipe(output, PIPE_NONE);
+ igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
}
static int crtc_get_sequence(int fd, struct drm_crtc_get_sequence *cgs)
--
2.26.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-22 15:20 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 1/2] tests/kms: sanitize the system state between subtests Nidhi Gupta
@ 2022-04-22 15:20 ` Nidhi Gupta
2022-04-22 17:46 ` [igt-dev] ✗ Fi.CI.BAT: failure for kms/tests : IGT cleanup (rev4) Patchwork
2 siblings, 0 replies; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-22 15:20 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
Modified kms_sequence and kms_concurrent to include
dynamic test cases.
Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
tests/kms_concurrent.c | 6 ++-
tests/kms_sequence.c | 88 +++++++++++++++++++++---------------------
2 files changed, 48 insertions(+), 46 deletions(-)
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 622d3335..82b2021e 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
"resolution.");
- igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+ igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
for_each_valid_output_on_pipe(&data->display, pipe, output)
- run_test(data, pipe, output);
+ igt_dynamic_f("%s", igt_output_name(output))
+ run_test(data, pipe, output);
+ }
}
static int opt_handler(int option, int option_index, void *input)
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
index ca25e041..1655d7d1 100644
--- a/tests/kms_sequence.c
+++ b/tests/kms_sequence.c
@@ -140,54 +140,45 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
{
int nchildren =
data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
- igt_display_t *display = &data->display;
- igt_output_t *output;
- enum pipe p;
- unsigned int valid_tests = 0;
-
- for_each_pipe_with_valid_output(display, p, output) {
- data->pipe = p;
- prepare_crtc(data, fd, output);
-
- igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output),
- nchildren);
-
- if (data->flags & BUSY) {
- struct drm_crtc_queue_sequence cqs;
-
- memset(&cqs, 0, sizeof(cqs));
- cqs.crtc_id = data->crtc_id;
- cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
- cqs.sequence = 120 + 12;
- igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
- }
+ igt_output_t *output = data->output;
- igt_fork(child, nchildren)
- testfunc(data, fd, nchildren);
- igt_waitchildren();
+ prepare_crtc(data, fd, output);
- if (data->flags & BUSY) {
- struct drm_event_vblank buf;
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- }
+ igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output),
+ nchildren);
- igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+ if (data->flags & BUSY) {
+ struct drm_crtc_queue_sequence cqs;
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output));
+ memset(&cqs, 0, sizeof(cqs));
+ cqs.crtc_id = data->crtc_id;
+ cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
+ cqs.sequence = 120 + 12;
+ igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
+ }
+
+ igt_fork(child, nchildren)
+ testfunc(data, fd, nchildren);
+ igt_waitchildren();
- /* cleanup what prepare_crtc() has done */
- cleanup_crtc(data, fd, output);
- valid_tests++;
+ if (data->flags & BUSY) {
+ struct drm_event_vblank buf;
+
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
}
- igt_require_f(valid_tests,
- "no valid crtc/connector combinations found\n");
+ igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+
+ igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output));
+
+ /* cleanup what prepare_crtc() has done */
+ cleanup_crtc(data, fd, output);
}
static void sequence_get(data_t *data, int fd, int nchildren)
@@ -255,6 +246,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
igt_main
{
int fd;
+ igt_output_t *output;
+ enum pipe p;
data_t data;
const struct {
const char *name;
@@ -280,6 +273,7 @@ igt_main
fd = drm_open_driver_master(DRIVER_ANY);
kmstest_set_vt_graphics_mode();
igt_display_require(&data.display, fd);
+ igt_display_require_output(&data.display);
}
for (f = funcs; f->name; f++) {
@@ -289,9 +283,15 @@ igt_main
igt_describe("This is a test of drmCrtcGetSequence and "
"drmCrtcQueueSequence");
- igt_subtest_f("%s-%s", f->name, m->name) {
- data.flags = m->flags;
- run_test(&data, fd, f->func);
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_valid_output(&data.display, p, output) {
+ igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
+ data.pipe = p;
+ data.output = output;
+ data.flags = m->flags;
+ run_test(&data, fd, f->func);
+ }
+ }
}
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for kms/tests : IGT cleanup (rev4)
2022-04-22 15:20 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 1/2] tests/kms: sanitize the system state between subtests Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
@ 2022-04-22 17:46 ` Patchwork
2 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2022-04-22 17:46 UTC (permalink / raw)
To: Nidhi Gupta; +Cc: igt-dev
[-- Attachment #1: Type: text/plain, Size: 8004 bytes --]
== Series Details ==
Series: kms/tests : IGT cleanup (rev4)
URL : https://patchwork.freedesktop.org/series/102806/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11543 -> IGTPW_6985
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_6985 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in IGTPW_6985, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/index.html
Participating hosts (45 -> 44)
------------------------------
Additional (2): fi-hsw-4770 bat-adlm-1
Missing (3): bat-dg2-8 fi-bsw-cyan bat-adlp-4
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_6985:
### IGT changes ###
#### Possible regressions ####
* igt@prime_vgem@basic-fence-read:
- fi-kbl-soraka: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/fi-kbl-soraka/igt@prime_vgem@basic-fence-read.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-kbl-soraka/igt@prime_vgem@basic-fence-read.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* igt@i915_pm_rpm@module-reload:
- {bat-adlm-1}: NOTRUN -> [INCOMPLETE][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/bat-adlm-1/igt@i915_pm_rpm@module-reload.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- {bat-adlm-1}: NOTRUN -> [DMESG-WARN][4] +1 similar issue
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/bat-adlm-1/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a.html
Known issues
------------
Here are the changes found in IGTPW_6985 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3@smem:
- fi-bdw-5557u: [PASS][5] -> [INCOMPLETE][6] ([i915#146])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/fi-bdw-5557u/igt@gem_exec_suspend@basic-s3@smem.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-bdw-5557u/igt@gem_exec_suspend@basic-s3@smem.html
* igt@gem_huc_copy@huc-copy:
- fi-hsw-4770: NOTRUN -> [SKIP][7] ([fdo#109271]) +9 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-4770/igt@gem_huc_copy@huc-copy.html
* igt@i915_pm_backlight@basic-brightness:
- fi-hsw-4770: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#3012])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-4770/igt@i915_pm_backlight@basic-brightness.html
* igt@i915_selftest@live@hangcheck:
- fi-hsw-g3258: [PASS][9] -> [INCOMPLETE][10] ([i915#4785])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html
* igt@i915_selftest@live@requests:
- fi-pnv-d510: [PASS][11] -> [DMESG-FAIL][12] ([i915#4528])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/fi-pnv-d510/igt@i915_selftest@live@requests.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-pnv-d510/igt@i915_selftest@live@requests.html
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-4770: NOTRUN -> [SKIP][13] ([fdo#109271] / [fdo#111827]) +8 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-4770/igt@kms_chamelium@common-hpd-after-suspend.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d:
- fi-hsw-4770: NOTRUN -> [SKIP][14] ([fdo#109271] / [i915#533])
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-4770/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-d.html
* igt@kms_psr@primary_mmap_gtt:
- fi-hsw-4770: NOTRUN -> [SKIP][15] ([fdo#109271] / [i915#1072]) +3 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-4770/igt@kms_psr@primary_mmap_gtt.html
* igt@runner@aborted:
- fi-pnv-d510: NOTRUN -> [FAIL][16] ([fdo#109271] / [i915#2403] / [i915#4312])
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-pnv-d510/igt@runner@aborted.html
- fi-hsw-g3258: NOTRUN -> [FAIL][17] ([fdo#109271] / [i915#4312])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/fi-hsw-g3258/igt@runner@aborted.html
#### Possible fixes ####
* igt@core_hotunplug@unbind-rebind:
- {bat-rpls-2}: [DMESG-WARN][18] ([i915#4391]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/bat-rpls-2/igt@core_hotunplug@unbind-rebind.html
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/bat-rpls-2/igt@core_hotunplug@unbind-rebind.html
* igt@dmabuf@all@dma_fence_chain:
- bat-dg1-5: [INCOMPLETE][20] ([i915#4154]) -> [PASS][21]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/bat-dg1-5/igt@dmabuf@all@dma_fence_chain.html
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/bat-dg1-5/igt@dmabuf@all@dma_fence_chain.html
* igt@i915_selftest@live@reset:
- {bat-rpls-1}: [DMESG-FAIL][22] -> [PASS][23]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11543/bat-rpls-1/igt@i915_selftest@live@reset.html
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/bat-rpls-1/igt@i915_selftest@live@reset.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2403]: https://gitlab.freedesktop.org/drm/intel/issues/2403
[i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3576]: https://gitlab.freedesktop.org/drm/intel/issues/3576
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4154]: https://gitlab.freedesktop.org/drm/intel/issues/4154
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#5329]: https://gitlab.freedesktop.org/drm/intel/issues/5329
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5509]: https://gitlab.freedesktop.org/drm/intel/issues/5509
[i915#5537]: https://gitlab.freedesktop.org/drm/intel/issues/5537
[i915#5763]: https://gitlab.freedesktop.org/drm/intel/issues/5763
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6449 -> IGTPW_6985
CI-20190529: 20190529
CI_DRM_11543: df51a64607842dbdc675b82f3390deefef9e562f @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_6985: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/index.html
IGT_6449: 704da775abb83faa9324a665fe2992ab90f4ab03 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6985/index.html
[-- Attachment #2: Type: text/html, Size: 8615 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-22 14:47 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
@ 2022-04-22 14:47 ` Nidhi Gupta
0 siblings, 0 replies; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-22 14:47 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
Modified kms_sequence and kms_concurrent to include
dynamic test cases.
Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
tests/kms_concurrent.c | 6 ++-
tests/kms_sequence.c | 88 +++++++++++++++++++++---------------------
2 files changed, 48 insertions(+), 46 deletions(-)
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 622d3335..82b2021e 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
"resolution.");
- igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+ igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
for_each_valid_output_on_pipe(&data->display, pipe, output)
- run_test(data, pipe, output);
+ igt_dynamic_f("%s", igt_output_name(output))
+ run_test(data, pipe, output);
+ }
}
static int opt_handler(int option, int option_index, void *input)
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
index ca25e041..1655d7d1 100644
--- a/tests/kms_sequence.c
+++ b/tests/kms_sequence.c
@@ -140,54 +140,45 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
{
int nchildren =
data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
- igt_display_t *display = &data->display;
- igt_output_t *output;
- enum pipe p;
- unsigned int valid_tests = 0;
-
- for_each_pipe_with_valid_output(display, p, output) {
- data->pipe = p;
- prepare_crtc(data, fd, output);
-
- igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output),
- nchildren);
-
- if (data->flags & BUSY) {
- struct drm_crtc_queue_sequence cqs;
-
- memset(&cqs, 0, sizeof(cqs));
- cqs.crtc_id = data->crtc_id;
- cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
- cqs.sequence = 120 + 12;
- igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
- }
+ igt_output_t *output = data->output;
- igt_fork(child, nchildren)
- testfunc(data, fd, nchildren);
- igt_waitchildren();
+ prepare_crtc(data, fd, output);
- if (data->flags & BUSY) {
- struct drm_event_vblank buf;
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- }
+ igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output),
+ nchildren);
- igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+ if (data->flags & BUSY) {
+ struct drm_crtc_queue_sequence cqs;
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output));
+ memset(&cqs, 0, sizeof(cqs));
+ cqs.crtc_id = data->crtc_id;
+ cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
+ cqs.sequence = 120 + 12;
+ igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
+ }
+
+ igt_fork(child, nchildren)
+ testfunc(data, fd, nchildren);
+ igt_waitchildren();
- /* cleanup what prepare_crtc() has done */
- cleanup_crtc(data, fd, output);
- valid_tests++;
+ if (data->flags & BUSY) {
+ struct drm_event_vblank buf;
+
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
}
- igt_require_f(valid_tests,
- "no valid crtc/connector combinations found\n");
+ igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+
+ igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output));
+
+ /* cleanup what prepare_crtc() has done */
+ cleanup_crtc(data, fd, output);
}
static void sequence_get(data_t *data, int fd, int nchildren)
@@ -255,6 +246,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
igt_main
{
int fd;
+ igt_output_t *output;
+ enum pipe p;
data_t data;
const struct {
const char *name;
@@ -280,6 +273,7 @@ igt_main
fd = drm_open_driver_master(DRIVER_ANY);
kmstest_set_vt_graphics_mode();
igt_display_require(&data.display, fd);
+ igt_display_require_output(&data.display);
}
for (f = funcs; f->name; f++) {
@@ -289,9 +283,15 @@ igt_main
igt_describe("This is a test of drmCrtcGetSequence and "
"drmCrtcQueueSequence");
- igt_subtest_f("%s-%s", f->name, m->name) {
- data.flags = m->flags;
- run_test(&data, fd, f->func);
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_valid_output(&data.display, p, output) {
+ igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
+ data.pipe = p;
+ data.output = output;
+ data.flags = m->flags;
+ run_test(&data, fd, f->func);
+ }
+ }
}
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-22 10:45 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
@ 2022-04-22 13:03 ` Modem, Bhanuprakash
0 siblings, 0 replies; 9+ messages in thread
From: Modem, Bhanuprakash @ 2022-04-22 13:03 UTC (permalink / raw)
To: Nidhi Gupta, igt-dev
On Fri-22-04-2022 04:15 pm, Nidhi Gupta wrote:
> Modified kms_sequence and kms_concurrent to include
> dynamic test cases.
>
> Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
> ---
> tests/kms_concurrent.c | 6 ++-
> tests/kms_sequence.c | 87 +++++++++++++++++++++---------------------
> 2 files changed, 48 insertions(+), 45 deletions(-)
>
> diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
> index 622d3335..82b2021e 100644
> --- a/tests/kms_concurrent.c
> +++ b/tests/kms_concurrent.c
> @@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
>
> igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
> "resolution.");
> - igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
> + igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
> for_each_valid_output_on_pipe(&data->display, pipe, output)
> - run_test(data, pipe, output);
> + igt_dynamic_f("%s", igt_output_name(output))
> + run_test(data, pipe, output);
> + }
> }
>
> static int opt_handler(int option, int option_index, void *input)
> diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
> index ca25e041..5ec3e925 100644
> --- a/tests/kms_sequence.c
> +++ b/tests/kms_sequence.c
> @@ -140,54 +140,46 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
> {
> int nchildren =
> data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
> - igt_display_t *display = &data->display;
> igt_output_t *output;
> - enum pipe p;
> - unsigned int valid_tests = 0;
> -
> - for_each_pipe_with_valid_output(display, p, output) {
> - data->pipe = p;
> - prepare_crtc(data, fd, output);
> -
> - igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
> - igt_subtest_name(),
> - kmstest_pipe_name(data->pipe),
> - igt_output_name(output),
> - nchildren);
> -
> - if (data->flags & BUSY) {
> - struct drm_crtc_queue_sequence cqs;
> -
> - memset(&cqs, 0, sizeof(cqs));
> - cqs.crtc_id = data->crtc_id;
> - cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
> - cqs.sequence = 120 + 12;
> - igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
> - }
> + output = data->output;
Assignment can be done in definition directly.
igt_output_t *output = data->output;
With above change, this patch is
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
- Bhanu
>
> - igt_fork(child, nchildren)
> - testfunc(data, fd, nchildren);
> - igt_waitchildren();
> + prepare_crtc(data, fd, output);
>
> - if (data->flags & BUSY) {
> - struct drm_event_vblank buf;
> - igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> - }
> + igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
> + igt_subtest_name(),
> + kmstest_pipe_name(data->pipe),
> + igt_output_name(output),
> + nchildren);
> +
> + if (data->flags & BUSY) {
> + struct drm_crtc_queue_sequence cqs;
> +
> + memset(&cqs, 0, sizeof(cqs));
> + cqs.crtc_id = data->crtc_id;
> + cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
> + cqs.sequence = 120 + 12;
> + igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
> + }
>
> - igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
> + igt_fork(child, nchildren)
> + testfunc(data, fd, nchildren);
> + igt_waitchildren();
>
> - igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
> - igt_subtest_name(),
> - kmstest_pipe_name(data->pipe),
> - igt_output_name(output));
> + if (data->flags & BUSY) {
> + struct drm_event_vblank buf;
>
> - /* cleanup what prepare_crtc() has done */
> - cleanup_crtc(data, fd, output);
> - valid_tests++;
> + igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> }
>
> - igt_require_f(valid_tests,
> - "no valid crtc/connector combinations found\n");
> + igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
> +
> + igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
> + igt_subtest_name(),
> + kmstest_pipe_name(data->pipe),
> + igt_output_name(output));
> +
> + /* cleanup what prepare_crtc() has done */
> + cleanup_crtc(data, fd, output);
> }
>
> static void sequence_get(data_t *data, int fd, int nchildren)
> @@ -255,6 +247,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
> igt_main
> {
> int fd;
> + igt_output_t *output;
> + enum pipe p;
> data_t data;
> const struct {
> const char *name;
> @@ -280,6 +274,7 @@ igt_main
> fd = drm_open_driver_master(DRIVER_ANY);
> kmstest_set_vt_graphics_mode();
> igt_display_require(&data.display, fd);
> + igt_display_require_output(&data.display);
> }
>
> for (f = funcs; f->name; f++) {
> @@ -289,9 +284,15 @@ igt_main
>
> igt_describe("This is a test of drmCrtcGetSequence and "
> "drmCrtcQueueSequence");
> - igt_subtest_f("%s-%s", f->name, m->name) {
> - data.flags = m->flags;
> - run_test(&data, fd, f->func);
> + igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
> + for_each_pipe_with_valid_output(&data.display, p, output) {
> + igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
> + data.pipe = p;
> + data.output = output;
> + data.flags = m->flags;
> + run_test(&data, fd, f->func);
> + }
> + }
> }
> }
> }
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-22 10:45 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
@ 2022-04-22 10:45 ` Nidhi Gupta
2022-04-22 13:03 ` Modem, Bhanuprakash
0 siblings, 1 reply; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-22 10:45 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
Modified kms_sequence and kms_concurrent to include
dynamic test cases.
Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
---
tests/kms_concurrent.c | 6 ++-
tests/kms_sequence.c | 87 +++++++++++++++++++++---------------------
2 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 622d3335..82b2021e 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
"resolution.");
- igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+ igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
for_each_valid_output_on_pipe(&data->display, pipe, output)
- run_test(data, pipe, output);
+ igt_dynamic_f("%s", igt_output_name(output))
+ run_test(data, pipe, output);
+ }
}
static int opt_handler(int option, int option_index, void *input)
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
index ca25e041..5ec3e925 100644
--- a/tests/kms_sequence.c
+++ b/tests/kms_sequence.c
@@ -140,54 +140,46 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
{
int nchildren =
data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
- igt_display_t *display = &data->display;
igt_output_t *output;
- enum pipe p;
- unsigned int valid_tests = 0;
-
- for_each_pipe_with_valid_output(display, p, output) {
- data->pipe = p;
- prepare_crtc(data, fd, output);
-
- igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output),
- nchildren);
-
- if (data->flags & BUSY) {
- struct drm_crtc_queue_sequence cqs;
-
- memset(&cqs, 0, sizeof(cqs));
- cqs.crtc_id = data->crtc_id;
- cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
- cqs.sequence = 120 + 12;
- igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
- }
+ output = data->output;
- igt_fork(child, nchildren)
- testfunc(data, fd, nchildren);
- igt_waitchildren();
+ prepare_crtc(data, fd, output);
- if (data->flags & BUSY) {
- struct drm_event_vblank buf;
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- }
+ igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output),
+ nchildren);
+
+ if (data->flags & BUSY) {
+ struct drm_crtc_queue_sequence cqs;
+
+ memset(&cqs, 0, sizeof(cqs));
+ cqs.crtc_id = data->crtc_id;
+ cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
+ cqs.sequence = 120 + 12;
+ igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
+ }
- igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+ igt_fork(child, nchildren)
+ testfunc(data, fd, nchildren);
+ igt_waitchildren();
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output));
+ if (data->flags & BUSY) {
+ struct drm_event_vblank buf;
- /* cleanup what prepare_crtc() has done */
- cleanup_crtc(data, fd, output);
- valid_tests++;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
}
- igt_require_f(valid_tests,
- "no valid crtc/connector combinations found\n");
+ igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+
+ igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output));
+
+ /* cleanup what prepare_crtc() has done */
+ cleanup_crtc(data, fd, output);
}
static void sequence_get(data_t *data, int fd, int nchildren)
@@ -255,6 +247,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
igt_main
{
int fd;
+ igt_output_t *output;
+ enum pipe p;
data_t data;
const struct {
const char *name;
@@ -280,6 +274,7 @@ igt_main
fd = drm_open_driver_master(DRIVER_ANY);
kmstest_set_vt_graphics_mode();
igt_display_require(&data.display, fd);
+ igt_display_require_output(&data.display);
}
for (f = funcs; f->name; f++) {
@@ -289,9 +284,15 @@ igt_main
igt_describe("This is a test of drmCrtcGetSequence and "
"drmCrtcQueueSequence");
- igt_subtest_f("%s-%s", f->name, m->name) {
- data.flags = m->flags;
- run_test(&data, fd, f->func);
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_valid_output(&data.display, p, output) {
+ igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
+ data.pipe = p;
+ data.output = output;
+ data.flags = m->flags;
+ run_test(&data, fd, f->func);
+ }
+ }
}
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-19 7:33 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
@ 2022-04-21 14:00 ` Modem, Bhanuprakash
0 siblings, 0 replies; 9+ messages in thread
From: Modem, Bhanuprakash @ 2022-04-21 14:00 UTC (permalink / raw)
To: Nidhi Gupta, igt-dev
On Tue-19-04-2022 01:03 pm, Nidhi Gupta wrote:
> Modified kms_sequence and kms_concurrent to include
> dynamic test cases.
>
> Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
> ---
> tests/kms_concurrent.c | 6 ++--
> tests/kms_sequence.c | 81 ++++++++++++++++++++++--------------------
> 2 files changed, 47 insertions(+), 40 deletions(-)
>
> diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
> index 622d3335..82b2021e 100644
> --- a/tests/kms_concurrent.c
> +++ b/tests/kms_concurrent.c
> @@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
>
> igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
> "resolution.");
> - igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
> + igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
> for_each_valid_output_on_pipe(&data->display, pipe, output)
> - run_test(data, pipe, output);
> + igt_dynamic_f("%s", igt_output_name(output))
> + run_test(data, pipe, output);
> + }
> }
>
> static int opt_handler(int option, int option_index, void *input)
> diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
> index ca25e041..593373b9 100644
> --- a/tests/kms_sequence.c
> +++ b/tests/kms_sequence.c
> @@ -140,53 +140,49 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
> {
> int nchildren =
> data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
> - igt_display_t *display = &data->display;
> igt_output_t *output;
> - enum pipe p;
> unsigned int valid_tests = 0;
> + output = data->output;
>
> - for_each_pipe_with_valid_output(display, p, output) {
> - data->pipe = p;
> - prepare_crtc(data, fd, output);
> + prepare_crtc(data, fd, output);
>
> - igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
> - igt_subtest_name(),
> - kmstest_pipe_name(data->pipe),
> - igt_output_name(output),
> - nchildren);
> + igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
> + igt_subtest_name(),
> + kmstest_pipe_name(data->pipe),
> + igt_output_name(output),
> + nchildren);
>
> - if (data->flags & BUSY) {
> - struct drm_crtc_queue_sequence cqs;
> + if (data->flags & BUSY) {
> + struct drm_crtc_queue_sequence cqs;
>
> - memset(&cqs, 0, sizeof(cqs));
> - cqs.crtc_id = data->crtc_id;
> - cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
> - cqs.sequence = 120 + 12;
> - igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
> - }
> + memset(&cqs, 0, sizeof(cqs));
> + cqs.crtc_id = data->crtc_id;
> + cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
> + cqs.sequence = 120 + 12;
> + igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
> + }
>
> - igt_fork(child, nchildren)
> - testfunc(data, fd, nchildren);
> - igt_waitchildren();
> + igt_fork(child, nchildren)
> + testfunc(data, fd, nchildren);
> + igt_waitchildren();
>
> - if (data->flags & BUSY) {
> - struct drm_event_vblank buf;
> - igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> - }
> + if (data->flags & BUSY) {
> + struct drm_event_vblank buf;
> + igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> + }
Please fix these:
WARNING: suspect code indent for conditional statements (8, 8)
#232: FILE: tests/kms_sequence.c:169:
+ if (data->flags & BUSY) {
+ struct drm_event_vblank buf;
WARNING: Missing a blank line after declarations
#234: FILE: tests/kms_sequence.c:171:
+ struct drm_event_vblank buf;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
>
> - igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
> + igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
>
> - igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
> - igt_subtest_name(),
> - kmstest_pipe_name(data->pipe),
> - igt_output_name(output));
> + igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
> + igt_subtest_name(),
> + kmstest_pipe_name(data->pipe),
> + igt_output_name(output));
>
> - /* cleanup what prepare_crtc() has done */
> - cleanup_crtc(data, fd, output);
> - valid_tests++;
> - }
> + /* cleanup what prepare_crtc() has done */
> + cleanup_crtc(data, fd, output);
> + valid_tests++;
>
> - igt_require_f(valid_tests,
> +igt_require_f(valid_tests,
> "no valid crtc/connector combinations found\n");
As we are using dynamic subtests, this valid_tests is no more required.
- Bhanu
> }
>
> @@ -255,6 +251,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
> igt_main
> {
> int fd;
> + igt_output_t *output;
> + enum pipe p;
> data_t data;
> const struct {
> const char *name;
> @@ -280,6 +278,7 @@ igt_main
> fd = drm_open_driver_master(DRIVER_ANY);
> kmstest_set_vt_graphics_mode();
> igt_display_require(&data.display, fd);
> + igt_display_require_output(&data.display);
> }
>
> for (f = funcs; f->name; f++) {
> @@ -289,9 +288,15 @@ igt_main
>
> igt_describe("This is a test of drmCrtcGetSequence and "
> "drmCrtcQueueSequence");
> - igt_subtest_f("%s-%s", f->name, m->name) {
> - data.flags = m->flags;
> - run_test(&data, fd, f->func);
> + igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
> + for_each_pipe_with_valid_output(&data.display, p, output) {
> + igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
> + data.pipe = p;
> + data.output = output;
> + data.flags = m->flags;
> + run_test(&data, fd, f->func);
> + }
> + }
> }
> }
> }
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases
2022-04-19 7:33 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
@ 2022-04-19 7:33 ` Nidhi Gupta
2022-04-21 14:00 ` Modem, Bhanuprakash
0 siblings, 1 reply; 9+ messages in thread
From: Nidhi Gupta @ 2022-04-19 7:33 UTC (permalink / raw)
To: igt-dev; +Cc: Nidhi Gupta
Modified kms_sequence and kms_concurrent to include
dynamic test cases.
Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
---
tests/kms_concurrent.c | 6 ++--
tests/kms_sequence.c | 81 ++++++++++++++++++++++--------------------
2 files changed, 47 insertions(+), 40 deletions(-)
diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 622d3335..82b2021e 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -328,9 +328,11 @@ run_tests_for_pipe(data_t *data, enum pipe pipe)
igt_describe("Test atomic mode setting concurrently with multiple planes and screen "
"resolution.");
- igt_subtest_f("pipe-%s", kmstest_pipe_name(pipe))
+ igt_subtest_with_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
for_each_valid_output_on_pipe(&data->display, pipe, output)
- run_test(data, pipe, output);
+ igt_dynamic_f("%s", igt_output_name(output))
+ run_test(data, pipe, output);
+ }
}
static int opt_handler(int option, int option_index, void *input)
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c
index ca25e041..593373b9 100644
--- a/tests/kms_sequence.c
+++ b/tests/kms_sequence.c
@@ -140,53 +140,49 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
{
int nchildren =
data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
- igt_display_t *display = &data->display;
igt_output_t *output;
- enum pipe p;
unsigned int valid_tests = 0;
+ output = data->output;
- for_each_pipe_with_valid_output(display, p, output) {
- data->pipe = p;
- prepare_crtc(data, fd, output);
+ prepare_crtc(data, fd, output);
- igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output),
- nchildren);
+ igt_info("Beginning %s on pipe %s, connector %s (%d threads)\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output),
+ nchildren);
- if (data->flags & BUSY) {
- struct drm_crtc_queue_sequence cqs;
+ if (data->flags & BUSY) {
+ struct drm_crtc_queue_sequence cqs;
- memset(&cqs, 0, sizeof(cqs));
- cqs.crtc_id = data->crtc_id;
- cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
- cqs.sequence = 120 + 12;
- igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
- }
+ memset(&cqs, 0, sizeof(cqs));
+ cqs.crtc_id = data->crtc_id;
+ cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE;
+ cqs.sequence = 120 + 12;
+ igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0);
+ }
- igt_fork(child, nchildren)
- testfunc(data, fd, nchildren);
- igt_waitchildren();
+ igt_fork(child, nchildren)
+ testfunc(data, fd, nchildren);
+ igt_waitchildren();
- if (data->flags & BUSY) {
- struct drm_event_vblank buf;
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- }
+ if (data->flags & BUSY) {
+ struct drm_event_vblank buf;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ }
- igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
+ igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(output));
+ igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
+ igt_subtest_name(),
+ kmstest_pipe_name(data->pipe),
+ igt_output_name(output));
- /* cleanup what prepare_crtc() has done */
- cleanup_crtc(data, fd, output);
- valid_tests++;
- }
+ /* cleanup what prepare_crtc() has done */
+ cleanup_crtc(data, fd, output);
+ valid_tests++;
- igt_require_f(valid_tests,
+igt_require_f(valid_tests,
"no valid crtc/connector combinations found\n");
}
@@ -255,6 +251,8 @@ static void sequence_queue(data_t *data, int fd, int nchildren)
igt_main
{
int fd;
+ igt_output_t *output;
+ enum pipe p;
data_t data;
const struct {
const char *name;
@@ -280,6 +278,7 @@ igt_main
fd = drm_open_driver_master(DRIVER_ANY);
kmstest_set_vt_graphics_mode();
igt_display_require(&data.display, fd);
+ igt_display_require_output(&data.display);
}
for (f = funcs; f->name; f++) {
@@ -289,9 +288,15 @@ igt_main
igt_describe("This is a test of drmCrtcGetSequence and "
"drmCrtcQueueSequence");
- igt_subtest_f("%s-%s", f->name, m->name) {
- data.flags = m->flags;
- run_test(&data, fd, f->func);
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_valid_output(&data.display, p, output) {
+ igt_dynamic_f("%s-pipe-%s", igt_output_name(output), kmstest_pipe_name(p)) {
+ data.pipe = p;
+ data.output = output;
+ data.flags = m->flags;
+ run_test(&data, fd, f->func);
+ }
+ }
}
}
}
--
2.26.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-04-22 17:46 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-22 15:20 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 1/2] tests/kms: sanitize the system state between subtests Nidhi Gupta
2022-04-22 15:20 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
2022-04-22 17:46 ` [igt-dev] ✗ Fi.CI.BAT: failure for kms/tests : IGT cleanup (rev4) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-04-22 14:47 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-22 14:47 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
2022-04-22 10:45 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-22 10:45 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
2022-04-22 13:03 ` Modem, Bhanuprakash
2022-04-19 7:33 [igt-dev] [PATCH i-g-t 0/2] kms/tests : IGT cleanup Nidhi Gupta
2022-04-19 7:33 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms : Added dynamic test cases Nidhi Gupta
2022-04-21 14:00 ` Modem, Bhanuprakash
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.