* [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic
2023-09-18 7:50 [igt-dev] [PATCH i-g-t 0/3] Test cleanup and dynamic conversion Swati Sharma
@ 2023-09-18 7:51 ` Swati Sharma
0 siblings, 0 replies; 9+ messages in thread
From: Swati Sharma @ 2023-09-18 7:51 UTC (permalink / raw)
To: igt-dev
Convert existing subtests to dynamic subtests at pipe/output level.
v2: -Remove redundant debug prints
-Convert all subtests into dynamic
v3: -Use pipe & output from struct data_t
v4: -Directly use data->pipe instead of using p
-Use for_each_pipe_with_single_output()
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_vblank.c | 172 ++++++++++++++++++---------------------------
1 file changed, 69 insertions(+), 103 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index bcfd8d012..507421382 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -270,10 +270,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (data->flags & RPM)
igt_require(igt_setup_runtime_pm(fd));
- igt_info("Beginning %s on pipe %s, connector %s\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe),
- igt_output_name(output));
-
if (!(data->flags & NOHANG)) {
ahnd = is_i915_device(fd) ?
get_reloc_ahnd(fd, 0) :
@@ -314,9 +310,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (!(data->flags & NOHANG))
igt_post_hang_ring(fd, hang);
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
-
put_ahnd(ahnd);
/* cleanup what prepare_crtc() has done */
@@ -342,63 +335,50 @@ pipe_output_combo_valid(igt_display_t *display,
static void crtc_id_subtest(data_t *data, int fd)
{
igt_display_t *display = &data->display;
- igt_output_t *output;
- enum pipe p;
-
- for_each_pipe_with_valid_output(display, p, output) {
- struct drm_event_vblank buf;
- const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
- unsigned crtc_id, expected_crtc_id;
- uint64_t val;
- union drm_wait_vblank vbl;
+ enum pipe p = data->pipe;
+ igt_output_t *output = data->output;
+ struct drm_event_vblank buf;
+ const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
+ unsigned crtc_id, expected_crtc_id;
+ uint64_t val;
+ union drm_wait_vblank vbl;
- igt_display_reset(display);
+ crtc_id = display->pipes[p].crtc_id;
+ if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
+ expected_crtc_id = crtc_id;
+ else
+ expected_crtc_id = 0;
- igt_output_set_pipe(output, p);
- if (!i915_pipe_output_combo_valid(display))
- continue;
+ prepare_crtc(data, fd, output);
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(p), igt_output_name(output));
+ memset(&vbl, 0, sizeof(vbl));
+ vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
+ vbl.request.type |= pipe_id_flag;
+ vbl.request.sequence = 1;
+ igt_assert_eq(wait_vblank(fd, &vbl), 0);
- crtc_id = display->pipes[p].crtc_id;
- if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
- expected_crtc_id = crtc_id;
- else
- expected_crtc_id = 0;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- data->pipe = p;
- prepare_crtc(data, fd, output);
+ do_or_die(drmModePageFlip(fd, crtc_id,
+ data->primary_fb.fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, NULL));
- memset(&vbl, 0, sizeof(vbl));
- vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
- vbl.request.type |= pipe_id_flag;
- vbl.request.sequence = 1;
- igt_assert_eq(wait_vblank(fd, &vbl), 0);
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
+ if (display->is_atomic) {
+ igt_plane_t *primary = igt_output_get_plane(output, 0);
- do_or_die(drmModePageFlip(fd, crtc_id,
- data->primary_fb.fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, NULL));
+ igt_plane_set_fb(primary, &data->primary_fb);
+ igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
igt_assert_eq(buf.crtc_id, expected_crtc_id);
-
- if (display->is_atomic) {
- igt_plane_t *primary = igt_output_get_plane(output, 0);
-
- igt_plane_set_fb(primary, &data->primary_fb);
- igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
-
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
- }
-
- cleanup_crtc(data, fd, output);
- return;
}
+
+ cleanup_crtc(data, fd, output);
+ return;
}
static void accuracy(data_t *data, int fd, int nchildren)
@@ -576,7 +556,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren)
estimated_vblanks, seq2, seq1 + estimated_vblanks);
}
-static void run_subtests_for_pipe(data_t *data)
+static void run_subtests(data_t *data)
{
const struct {
const char *name;
@@ -610,30 +590,22 @@ static void run_subtests_for_pipe(data_t *data)
{ }
}, *m;
- igt_fixture
- igt_display_require_output_on_pipe(&data->display, data->pipe);
-
for (f = funcs; f->name; f++) {
for (m = modes; m->name; m++) {
if (m->flags & ~(f->valid | NOHANG))
continue;
igt_describe("Check if test run while hanging by introducing NOHANG flag.");
- igt_subtest_f("pipe-%s-%s-%s",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
- int found = 0;
-
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
- if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_single_output(&data->display, data->pipe, data->output) {
+ if (!pipe_output_combo_valid(&data->display, data->output, data->pipe))
continue;
- data->flags = m->flags | NOHANG;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags | NOHANG;
+ run_test(data, f->func);
+ }
}
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
/* Skip the -hang version if NOHANG flag is set */
@@ -641,24 +613,20 @@ static void run_subtests_for_pipe(data_t *data)
continue;
igt_describe("Check if injected hang is working properly.");
- igt_subtest_f("pipe-%s-%s-%s-hang",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
+ igt_subtest_with_dynamic_f("%s-%s-hang", f->name, m->name) {
igt_hang_t hang;
- int found = 0;
hang = igt_allow_hang(data->display.drm_fd, 0, 0);
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
- if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
+ for_each_pipe_with_single_output(&data->display, data->pipe, data->output) {
+ if (!pipe_output_combo_valid(&data->display, data->output, data->pipe))
continue;
- data->flags = m->flags;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags;
+ run_test(data, f->func);
+ }
}
igt_disallow_hang(data->display.drm_fd, hang);
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
}
}
@@ -668,23 +636,7 @@ static void invalid_subtest(data_t *data, int fd)
{
union drm_wait_vblank vbl;
unsigned long valid_flags;
- igt_display_t* display = &data->display;
- enum pipe pipe = 0;
- igt_output_t *output;
-
- igt_display_reset(display);
-
- output = igt_get_single_output_for_pipe(display, pipe);
- igt_require(output);
-
- data->pipe = pipe;
- data->output = output;
-
- igt_output_set_pipe(output, pipe);
- igt_require(i915_pipe_output_combo_valid(display));
-
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(pipe), igt_output_name(output));
+ igt_output_t *output = data->output;
prepare_crtc(data, fd, output);
@@ -738,18 +690,32 @@ igt_main
}
igt_describe("Negative test for vblank request.");
- igt_subtest("invalid")
- invalid_subtest(&data, fd);
+ igt_subtest_with_dynamic("invalid") {
+ for_each_pipe_with_single_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ invalid_subtest(&data, fd);
+ break;
+ }
+ }
igt_describe("Check the vblank and flip events works with given crtc id.");
- igt_subtest("crtc-id")
- crtc_id_subtest(&data, fd);
+ igt_subtest_with_dynamic("crtc-id") {
+ for_each_pipe_with_single_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ crtc_id_subtest(&data, fd);
+ }
+ }
- for_each_pipe_static(data.pipe)
- igt_subtest_group
- run_subtests_for_pipe(&data);
+ run_subtests(&data);
igt_fixture {
+ igt_display_fini(&data.display);
drm_close_driver(fd);
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion
@ 2023-09-18 7:54 Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes Swati Sharma
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Swati Sharma @ 2023-09-18 7:54 UTC (permalink / raw)
To: igt-dev
Subtests are converted to dynamic subtests. Also, testplan
documentation is updated.
Review comments addressed from
https://patchwork.freedesktop.org/series/109170/
Swati Sharma (3):
tests/kms_vblank: cosmetic changes
tests/kms_vblank: convert test to dynamic
tests/kms_vblank: update testplan doc
tests/kms_vblank.c | 268 +++++++++++++++------------------------------
1 file changed, 87 insertions(+), 181 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
@ 2023-09-18 7:54 ` Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Swati Sharma @ 2023-09-18 7:54 UTC (permalink / raw)
To: igt-dev
Fix igt_describe() documentation. Remove redundant documentation.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_vblank.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 33e933c22..bcfd8d012 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -21,11 +21,6 @@
* IN THE SOFTWARE.
*/
-/** @file kms_vblank.c
- *
- * This is a test of performance of drmWaitVblank.
- */
-
#include "igt.h"
#include <stdlib.h>
#include <stdio.h>
@@ -46,7 +41,7 @@
* Description: Test speed of WaitVblank.
*
* SUBTEST: crtc-id
- * Description: check the Vblank and flip events works with given crtc id
+ * Description: Check the vblank and flip events works with given crtc id
* Driver requirement: i915, xe
* Functionality: vblank
* Mega feature: General Display Features
@@ -623,7 +618,7 @@ static void run_subtests_for_pipe(data_t *data)
if (m->flags & ~(f->valid | NOHANG))
continue;
- igt_describe("Check if test run while hanging by introducing NOHANG flag");
+ igt_describe("Check if test run while hanging by introducing NOHANG flag.");
igt_subtest_f("pipe-%s-%s-%s",
kmstest_pipe_name(data->pipe),
f->name, m->name) {
@@ -645,7 +640,7 @@ static void run_subtests_for_pipe(data_t *data)
if (f->valid & NOHANG || m->flags & NOHANG)
continue;
- igt_describe("check if injected hang is working properly");
+ igt_describe("Check if injected hang is working properly.");
igt_subtest_f("pipe-%s-%s-%s-hang",
kmstest_pipe_name(data->pipe),
f->name, m->name) {
@@ -742,11 +737,11 @@ igt_main
igt_display_require_output(&data.display);
}
- igt_describe("Negative test for vblank request");
+ igt_describe("Negative test for vblank request.");
igt_subtest("invalid")
invalid_subtest(&data, fd);
- igt_describe("check the Vblank and flip events works with given crtc id");
+ igt_describe("Check the vblank and flip events works with given crtc id.");
igt_subtest("crtc-id")
crtc_id_subtest(&data, fd);
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes Swati Sharma
@ 2023-09-18 7:54 ` Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: update testplan doc Swati Sharma
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Swati Sharma @ 2023-09-18 7:54 UTC (permalink / raw)
To: igt-dev
Convert existing subtests to dynamic subtests at pipe/output level.
v2: -Remove redundant debug prints
-Convert all subtests into dynamic
v3: -Use pipe & output from struct data_t
v4: -Directly use data->pipe instead of using p
-Use for_each_pipe_with_single_output()
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_vblank.c | 172 ++++++++++++++++++---------------------------
1 file changed, 69 insertions(+), 103 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index bcfd8d012..507421382 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -270,10 +270,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (data->flags & RPM)
igt_require(igt_setup_runtime_pm(fd));
- igt_info("Beginning %s on pipe %s, connector %s\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe),
- igt_output_name(output));
-
if (!(data->flags & NOHANG)) {
ahnd = is_i915_device(fd) ?
get_reloc_ahnd(fd, 0) :
@@ -314,9 +310,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (!(data->flags & NOHANG))
igt_post_hang_ring(fd, hang);
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
-
put_ahnd(ahnd);
/* cleanup what prepare_crtc() has done */
@@ -342,63 +335,50 @@ pipe_output_combo_valid(igt_display_t *display,
static void crtc_id_subtest(data_t *data, int fd)
{
igt_display_t *display = &data->display;
- igt_output_t *output;
- enum pipe p;
-
- for_each_pipe_with_valid_output(display, p, output) {
- struct drm_event_vblank buf;
- const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
- unsigned crtc_id, expected_crtc_id;
- uint64_t val;
- union drm_wait_vblank vbl;
+ enum pipe p = data->pipe;
+ igt_output_t *output = data->output;
+ struct drm_event_vblank buf;
+ const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
+ unsigned crtc_id, expected_crtc_id;
+ uint64_t val;
+ union drm_wait_vblank vbl;
- igt_display_reset(display);
+ crtc_id = display->pipes[p].crtc_id;
+ if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
+ expected_crtc_id = crtc_id;
+ else
+ expected_crtc_id = 0;
- igt_output_set_pipe(output, p);
- if (!i915_pipe_output_combo_valid(display))
- continue;
+ prepare_crtc(data, fd, output);
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(p), igt_output_name(output));
+ memset(&vbl, 0, sizeof(vbl));
+ vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
+ vbl.request.type |= pipe_id_flag;
+ vbl.request.sequence = 1;
+ igt_assert_eq(wait_vblank(fd, &vbl), 0);
- crtc_id = display->pipes[p].crtc_id;
- if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
- expected_crtc_id = crtc_id;
- else
- expected_crtc_id = 0;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- data->pipe = p;
- prepare_crtc(data, fd, output);
+ do_or_die(drmModePageFlip(fd, crtc_id,
+ data->primary_fb.fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, NULL));
- memset(&vbl, 0, sizeof(vbl));
- vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
- vbl.request.type |= pipe_id_flag;
- vbl.request.sequence = 1;
- igt_assert_eq(wait_vblank(fd, &vbl), 0);
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
+ if (display->is_atomic) {
+ igt_plane_t *primary = igt_output_get_plane(output, 0);
- do_or_die(drmModePageFlip(fd, crtc_id,
- data->primary_fb.fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, NULL));
+ igt_plane_set_fb(primary, &data->primary_fb);
+ igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
igt_assert_eq(buf.crtc_id, expected_crtc_id);
-
- if (display->is_atomic) {
- igt_plane_t *primary = igt_output_get_plane(output, 0);
-
- igt_plane_set_fb(primary, &data->primary_fb);
- igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
-
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
- }
-
- cleanup_crtc(data, fd, output);
- return;
}
+
+ cleanup_crtc(data, fd, output);
+ return;
}
static void accuracy(data_t *data, int fd, int nchildren)
@@ -576,7 +556,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren)
estimated_vblanks, seq2, seq1 + estimated_vblanks);
}
-static void run_subtests_for_pipe(data_t *data)
+static void run_subtests(data_t *data)
{
const struct {
const char *name;
@@ -610,30 +590,22 @@ static void run_subtests_for_pipe(data_t *data)
{ }
}, *m;
- igt_fixture
- igt_display_require_output_on_pipe(&data->display, data->pipe);
-
for (f = funcs; f->name; f++) {
for (m = modes; m->name; m++) {
if (m->flags & ~(f->valid | NOHANG))
continue;
igt_describe("Check if test run while hanging by introducing NOHANG flag.");
- igt_subtest_f("pipe-%s-%s-%s",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
- int found = 0;
-
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
- if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_single_output(&data->display, data->pipe, data->output) {
+ if (!pipe_output_combo_valid(&data->display, data->output, data->pipe))
continue;
- data->flags = m->flags | NOHANG;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags | NOHANG;
+ run_test(data, f->func);
+ }
}
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
/* Skip the -hang version if NOHANG flag is set */
@@ -641,24 +613,20 @@ static void run_subtests_for_pipe(data_t *data)
continue;
igt_describe("Check if injected hang is working properly.");
- igt_subtest_f("pipe-%s-%s-%s-hang",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
+ igt_subtest_with_dynamic_f("%s-%s-hang", f->name, m->name) {
igt_hang_t hang;
- int found = 0;
hang = igt_allow_hang(data->display.drm_fd, 0, 0);
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
- if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
+ for_each_pipe_with_single_output(&data->display, data->pipe, data->output) {
+ if (!pipe_output_combo_valid(&data->display, data->output, data->pipe))
continue;
- data->flags = m->flags;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags;
+ run_test(data, f->func);
+ }
}
igt_disallow_hang(data->display.drm_fd, hang);
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
}
}
@@ -668,23 +636,7 @@ static void invalid_subtest(data_t *data, int fd)
{
union drm_wait_vblank vbl;
unsigned long valid_flags;
- igt_display_t* display = &data->display;
- enum pipe pipe = 0;
- igt_output_t *output;
-
- igt_display_reset(display);
-
- output = igt_get_single_output_for_pipe(display, pipe);
- igt_require(output);
-
- data->pipe = pipe;
- data->output = output;
-
- igt_output_set_pipe(output, pipe);
- igt_require(i915_pipe_output_combo_valid(display));
-
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(pipe), igt_output_name(output));
+ igt_output_t *output = data->output;
prepare_crtc(data, fd, output);
@@ -738,18 +690,32 @@ igt_main
}
igt_describe("Negative test for vblank request.");
- igt_subtest("invalid")
- invalid_subtest(&data, fd);
+ igt_subtest_with_dynamic("invalid") {
+ for_each_pipe_with_single_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ invalid_subtest(&data, fd);
+ break;
+ }
+ }
igt_describe("Check the vblank and flip events works with given crtc id.");
- igt_subtest("crtc-id")
- crtc_id_subtest(&data, fd);
+ igt_subtest_with_dynamic("crtc-id") {
+ for_each_pipe_with_single_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ crtc_id_subtest(&data, fd);
+ }
+ }
- for_each_pipe_static(data.pipe)
- igt_subtest_group
- run_subtests_for_pipe(&data);
+ run_subtests(&data);
igt_fixture {
+ igt_display_fini(&data.display);
drm_close_driver(fd);
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: update testplan doc
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
@ 2023-09-18 7:54 ` Swati Sharma
2023-09-18 11:50 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_vblank: Test cleanup and dynamic conversion Patchwork
2023-09-18 11:51 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
4 siblings, 0 replies; 9+ messages in thread
From: Swati Sharma @ 2023-09-18 7:54 UTC (permalink / raw)
To: igt-dev
After introducing dynamic subtests, testplan documentation needs
to be updated.
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_vblank.c | 81 ++++++++--------------------------------------
1 file changed, 13 insertions(+), 68 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 507421382..0433e7d46 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -56,107 +56,63 @@
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-dpms-rpm
+ * SUBTEST: ts-continuation-dpms-rpm
* Description: Test TS continuty with DPMS & RPM while hanging by introducing
- * NOHANG flag on %arg[1]
+ * NOHANG flag
* Driver requirement: i915, xe
* Functionality: dpms, hang, rpm, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-dpms-suspend
+ * SUBTEST: ts-continuation-dpms-suspend
* Description: Test TS continuty with DPMS & Suspend while hanging by introducing
- * NOHANG flag on %arg[1]
+ * NOHANG flag
* Driver requirement: i915, xe
* Functionality: dpms, hang, suspend, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-suspend
+ * SUBTEST: ts-continuation-suspend
* Description: Test TS continuty with Suspend while hanging by introducing NOHANG
- * flag on %arg[1]
+ * flag
* Driver requirement: i915, xe
* Functionality: hang, suspend, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
* SUBTEST: pipe-%s-ts-continuation-modeset-rpm
* Description: Test TS continuty during Modeset with Suspend while hanging by
- * introducing NOHANG flag on %arg[1]
+ * introducing NOHANG flag
* Driver requirement: i915, xe
* Functionality: hang, rpm, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-accuracy-idle
+ * SUBTEST: accuracy-idle
* Description: Test Accuracy of vblank events while hanging by introducing NOHANG
- * flag on %arg[1]
+ * flag
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
* Test category: functionality test
*
- * SUBTEST: pipe-%s-%s
- * Description: Test %arg[2] while hanging by introducing NOHANG flag on %arg[1]
+ * SUBTEST: %s
+ * Description: Test %arg[1] while hanging by introducing NOHANG flag
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
* Test category: functionality test
*
- * SUBTEST: pipe-%s-%s-hang
- * Description: Test %arg[2] with injected hang is working properly on %arg[1]
+ * SUBTEST: %s-hang
+ * Description: Test %arg[1] with injected hang is working properly
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
@@ -164,17 +120,6 @@
*
* arg[1]:
*
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
- *
- * arg[2]:
- *
* @query-idle: Time taken to Query vblank counters
* @query-forked: Time taken to Query vblank counters (multithreaded)
* @query-busy: Time taken to Query vblank counters (during V-active)
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_vblank: Test cleanup and dynamic conversion
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
` (2 preceding siblings ...)
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: update testplan doc Swati Sharma
@ 2023-09-18 11:50 ` Patchwork
2023-09-18 11:51 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2023-09-18 11:50 UTC (permalink / raw)
To: Swati Sharma; +Cc: igt-dev
== Series Details ==
Series: tests/kms_vblank: Test cleanup and dynamic conversion
URL : https://patchwork.freedesktop.org/series/123847/
State : failure
== Summary ==
IGT patchset build failed on latest successful build
2517e42d612e0c1ca096acf8b5f6177f7ef4bce7 tests/intel/xe_query: Print XE_QUERY_CONFIG_MAX_ENGINE_PRIORITY value
Tail of build.log:
[382/1636] Compiling C object 'tests/59830eb@@kms_vrr@exe/kms_vrr.c.o'.
[383/1636] Compiling C object 'tests/59830eb@@testdisplay@exe/testdisplay_hotplug.c.o'.
[384/1636] Compiling C object 'tests/59830eb@@gen3_render_linear_blits@exe/intel_gen3_render_linear_blits.c.o'.
[385/1636] Compiling C object 'tests/59830eb@@kms_tiled_display@exe/kms_tiled_display.c.o'.
[386/1636] Compiling C object 'tests/59830eb@@gem_basic@exe/intel_gem_basic.c.o'.
[387/1636] Compiling C object 'tests/59830eb@@gem_compute@exe/intel_gem_compute.c.o'.
[388/1636] Compiling C object 'tests/59830eb@@gen3_render_tiledy_blits@exe/intel_gen3_render_tiledy_blits.c.o'.
[389/1636] Compiling C object 'tests/59830eb@@gen3_render_tiledx_blits@exe/intel_gen3_render_tiledx_blits.c.o'.
[390/1636] Compiling C object 'tests/59830eb@@gen3_render_mixed_blits@exe/intel_gen3_render_mixed_blits.c.o'.
[391/1636] Compiling C object 'tests/59830eb@@debugfs_test@exe/intel_debugfs_test.c.o'.
[392/1636] Compiling C object 'tests/59830eb@@gem_close@exe/intel_gem_close.c.o'.
[393/1636] Generating i915-perf-registers-acmgt3 with a custom command.
[394/1636] Compiling C object 'tests/59830eb@@gem_ctx_bad_destroy@exe/intel_gem_ctx_bad_destroy.c.o'.
[395/1636] Compiling C object 'tests/59830eb@@gem_bad_reloc@exe/intel_gem_bad_reloc.c.o'.
[396/1636] Compiling C object 'tests/59830eb@@gem_close_race@exe/intel_gem_close_race.c.o'.
[397/1636] Compiling C object 'tests/59830eb@@gen3_mixed_blits@exe/intel_gen3_mixed_blits.c.o'.
[398/1636] Compiling C object 'tests/59830eb@@gem_cs_tlb@exe/intel_gem_cs_tlb.c.o'.
[399/1636] Compiling C object 'tests/59830eb@@sw_sync@exe/sw_sync.c.o'.
[400/1636] Compiling C object 'tests/59830eb@@testdisplay@exe/testdisplay.c.o'.
[401/1636] Compiling C object 'tests/59830eb@@prime_mmap_kms@exe/intel_prime_mmap_kms.c.o'.
[402/1636] Compiling C object 'tests/59830eb@@kms_properties@exe/kms_properties.c.o'.
[403/1636] Compiling C object 'tests/59830eb@@kms_universal_plane@exe/kms_universal_plane.c.o'.
[404/1636] Compiling C object 'tests/59830eb@@gem_caching@exe/intel_gem_caching.c.o'.
[405/1636] Compiling C object 'tests/59830eb@@kms_setmode@exe/kms_setmode.c.o'.
[406/1636] Compiling C object 'tests/59830eb@@sysfs_heartbeat_interval@exe/intel_sysfs_heartbeat_interval.c.o'.
[407/1636] Generating i915-perf-metrics-acmgt3 with a custom command.
[408/1636] Compiling C object 'tests/59830eb@@vgem_basic@exe/vgem_basic.c.o'.
[409/1636] Compiling C object 'tests/59830eb@@kms_rotation_crc@exe/kms_rotation_crc.c.o'.
[410/1636] Compiling C object 'tests/59830eb@@gem_create@exe/intel_gem_create.c.o'.
[411/1636] Compiling C object 'lib/76b5a35@@igt-intel_batchbuffer_c@sta/intel_batchbuffer.c.o'.
[412/1636] Compiling C object 'tests/59830eb@@syncobj_wait@exe/syncobj_wait.c.o'.
[413/1636] Compiling C object 'tests/59830eb@@kms_cursor_legacy@exe/kms_cursor_legacy.c.o'.
[414/1636] Compiling C object 'tests/59830eb@@gem_busy@exe/intel_gem_busy.c.o'.
[415/1636] Compiling C object 'tests/59830eb@@gem_ccs@exe/intel_gem_ccs.c.o'.
[416/1636] Compiling C object 'lib/76b5a35@@igt-igt_core_c@sta/igt_core.c.o'.
[417/1636] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen8_c@sta/rendercopy_gen8.c.o'.
[418/1636] Compiling C object 'lib/76b5a35@@igt-igt_chamelium_c@sta/igt_chamelium.c.o'.
[419/1636] Compiling C object 'tests/59830eb@@api_intel_allocator@exe/intel_api_intel_allocator.c.o'.
[420/1636] Compiling C object 'tests/59830eb@@gem_blits@exe/intel_gem_blits.c.o'.
[421/1636] Compiling C object 'tests/59830eb@@syncobj_timeline@exe/syncobj_timeline.c.o'.
[422/1636] Compiling C object 'tests/59830eb@@prime_vgem@exe/prime_vgem.c.o'.
[423/1636] Compiling C object 'tests/59830eb@@drm_fdinfo@exe/intel_drm_fdinfo.c.o'.
[424/1636] Compiling C object 'tests/59830eb@@api_intel_bb@exe/intel_api_intel_bb.c.o'.
[425/1636] Compiling C object 'lib/76b5a35@@igt-rendercopy_gen9_c@sta/rendercopy_gen9.c.o'.
[426/1636] Compiling C object 'lib/76b5a35@@igt-i915_intel_decode_c@sta/i915_intel_decode.c.o'.
[427/1636] Compiling C object 'tests/59830eb@@gem_concurrent_blit@exe/intel_gem_concurrent_blit.c.o'.
[428/1636] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'.
[429/1636] Compiling C object 'lib/76b5a35@@igt-igt_fb_c@sta/igt_fb.c.o'.
[430/1636] Generating i915-perf-equations with a custom command.
ninja: build stopped: subcommand failed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] ✗ GitLab.Pipeline: warning for tests/kms_vblank: Test cleanup and dynamic conversion
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
` (3 preceding siblings ...)
2023-09-18 11:50 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_vblank: Test cleanup and dynamic conversion Patchwork
@ 2023-09-18 11:51 ` Patchwork
4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2023-09-18 11:51 UTC (permalink / raw)
To: Swati Sharma; +Cc: igt-dev
== Series Details ==
Series: tests/kms_vblank: Test cleanup and dynamic conversion
URL : https://patchwork.freedesktop.org/series/123847/
State : warning
== Summary ==
Pipeline status: FAILED.
see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/988509 for the overview.
build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131355):
~~~~~~~~~~~~~~^~~~~~
../tests/kms_vblank.c:652:52: error: incompatible type for argument 2 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~~~
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037838:step_script
section_start:1695037838:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037839:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-meson-arm64 has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131358):
~~~~~~~~~~~~~~^~~~~~
../tests/kms_vblank.c:652:52: error: incompatible type for argument 2 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~~~
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037867:step_script
section_start:1695037867:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037868:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-meson-armhf has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131357):
~~~~~~~~~~~~~~^~~~~~
../tests/kms_vblank.c:652:52: error: incompatible type for argument 2 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~~~
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037849:step_script
section_start:1695037849:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037849:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-meson-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131359):
~~~~~~~~~~~~~~^~~~~~
../tests/kms_vblank.c:652:52: error: incompatible type for argument 2 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~~~
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
~~~~^~~~~
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
enum pipe pipe, igt_output_t *output)
~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037855:step_script
section_start:1695037855:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037856:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-debian-minimal has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131356):
[549/554] Compiling C object 'lib/76b5a35@@i915_perf@sha/meson-generated_.._i915_perf_metrics_acmgt3.c.o'.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/102] Generating version.h with a custom command.
[2/7] Linking target lib/libi915_perf.so.1.5.
[3/7] Generating symbol file 'lib/76b5a35@@i915_perf@sha/libi915_perf.so.1.5.symbols'.
[4/7] Linking target tools/i915-perf/i915-perf-configs.
[5/7] Linking target tools/i915-perf/i915-perf-recorder.
[6/7] Linking target tools/i915-perf/i915-perf-reader.
[7/7] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/tests/intel/../kms_vblank.c:subtest igt@kms_vblank@pipe-%s-ts-continuation-modeset-rpm needs 1 arguments but only 0 are defined.
ninja: build stopped: subcommand failed.
section_end:1695037830:step_script
section_start:1695037830:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037831:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131350):
| |
| igt_output_t * {aka struct <anonymous> *}
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
652 | if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
| ~~~~^~~~~
| |
| enum pipe
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037838:step_script
section_start:1695037838:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037839:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131354):
[1640/1643] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
/builds/gfx-ci/igt-ci-tags/tests/intel/../kms_vblank.c:subtest igt@kms_vblank@pipe-%s-ts-continuation-modeset-rpm needs 1 arguments but only 0 are defined.
[1641/1643] Generating i915_tests.rst with a custom command.
ninja: build stopped: subcommand failed.
ninja: Entering directory `build'
[1/726] Generating version.h with a custom command.
[2/4] Generating i915_tests.html with a custom command.
[3/4] Generating kms_tests.rst with a custom command.
FAILED: docs/testplan/kms_tests.rst
/builds/gfx-ci/igt-ci-tags/scripts/igt_doc.py --config /builds/gfx-ci/igt-ci-tags/tests/intel/kms_test_config.json --rest docs/testplan/kms_tests.rst --check-testlist --igt-build-path /builds/gfx-ci/igt-ci-tags/build
/builds/gfx-ci/igt-ci-tags/tests/intel/../kms_vblank.c:subtest igt@kms_vblank@pipe-%s-ts-continuation-modeset-rpm needs 1 arguments but only 0 are defined.
ninja: build stopped: subcommand failed.
section_end:1695037875:step_script
section_start:1695037875:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037875:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131353):
| |
| igt_output_t * {aka struct <anonymous> *}
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
652 | if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
| ~~~~^~~~~
| |
| enum pipe
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037840:step_script
section_start:1695037840:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037840:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131351):
| |
| igt_output_t * {aka struct <anonymous> *}
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
652 | if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
| ~~~~^~~~~
| |
| enum pipe
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037841:step_script
section_start:1695037841:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037842:cleanup_file_variables
ERROR: Job failed: exit code 1
build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/49131352):
| |
| igt_output_t * {aka struct <anonymous> *}
../tests/kms_vblank.c:266:14: note: expected ‘enum pipe’ but argument is of type ‘igt_output_t *’ {aka ‘struct <anonymous> *’}
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~^~~~
../tests/kms_vblank.c:652:65: error: incompatible type for argument 3 of ‘pipe_output_combo_valid’
652 | if (!pipe_output_combo_valid(&data.display, data.output, data.pipe))
| ~~~~^~~~~
| |
| enum pipe
../tests/kms_vblank.c:266:34: note: expected ‘igt_output_t *’ {aka ‘struct <anonymous> *’} but argument is of type ‘enum pipe’
266 | enum pipe pipe, igt_output_t *output)
| ~~~~~~~~~~~~~~^~~~~~
ninja: build stopped: subcommand failed.
section_end:1695037840:step_script
section_start:1695037840:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1695037841:cleanup_file_variables
ERROR: Job failed: exit code 1
== Logs ==
For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/988509
^ permalink raw reply [flat|nested] 9+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic
2023-10-11 13:31 [igt-dev] [PATCH i-g-t 0/3] " Swati Sharma
@ 2023-10-11 13:31 ` Swati Sharma
2023-10-13 3:21 ` Karthik B S
0 siblings, 1 reply; 9+ messages in thread
From: Swati Sharma @ 2023-10-11 13:31 UTC (permalink / raw)
To: igt-dev
Convert existing subtests to dynamic subtests at pipe/output level
and update testplan documentation.
v2: -Remove redundant debug prints
-Convert all subtests into dynamic
v3: -Use pipe & output from struct data_t
v4: -Directly use data->pipe instead of using p
v5: -Use for_each_pipe_with_valid_output()
Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
tests/kms_vblank.c | 251 +++++++++++++++------------------------------
1 file changed, 81 insertions(+), 170 deletions(-)
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index bcfd8d012..4edd3f6bc 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -56,107 +56,63 @@
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-dpms-rpm
+ * SUBTEST: ts-continuation-dpms-rpm
* Description: Test TS continuty with DPMS & RPM while hanging by introducing
- * NOHANG flag on %arg[1]
+ * NOHANG flag
* Driver requirement: i915, xe
* Functionality: dpms, hang, rpm, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-dpms-suspend
+ * SUBTEST: ts-continuation-dpms-suspend
* Description: Test TS continuty with DPMS & Suspend while hanging by introducing
- * NOHANG flag on %arg[1]
+ * NOHANG flag
* Driver requirement: i915, xe
* Functionality: dpms, hang, suspend, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-suspend
+ * SUBTEST: ts-continuation-suspend
* Description: Test TS continuty with Suspend while hanging by introducing NOHANG
- * flag on %arg[1]
+ * flag
* Driver requirement: i915, xe
* Functionality: hang, suspend, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-ts-continuation-modeset-rpm
+ * SUBTEST: ts-continuation-modeset-rpm
* Description: Test TS continuty during Modeset with Suspend while hanging by
- * introducing NOHANG flag on %arg[1]
+ * introducing NOHANG flag
* Driver requirement: i915, xe
* Functionality: hang, rpm, vblank
* Mega feature: General Display Features
* Test category: functionality test
- *
- * arg[1]:
- *
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
*/
/**
- * SUBTEST: pipe-%s-accuracy-idle
+ * SUBTEST: accuracy-idle
* Description: Test Accuracy of vblank events while hanging by introducing NOHANG
- * flag on %arg[1]
+ * flag
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
* Test category: functionality test
*
- * SUBTEST: pipe-%s-%s
- * Description: Test %arg[2] while hanging by introducing NOHANG flag on %arg[1]
+ * SUBTEST: %s
+ * Description: Test %arg[1] while hanging by introducing NOHANG flag
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
* Test category: functionality test
*
- * SUBTEST: pipe-%s-%s-hang
- * Description: Test %arg[2] with injected hang is working properly on %arg[1]
+ * SUBTEST: %s-hang
+ * Description: Test %arg[1] with injected hang is working properly
* Driver requirement: i915, xe
* Functionality: hang, vblank
* Mega feature: General Display Features
@@ -164,17 +120,6 @@
*
* arg[1]:
*
- * @A: pipe A
- * @B: pipe B
- * @C: pipe C
- * @D: pipe D
- * @E: pipe E
- * @F: pipe F
- * @G: pipe G
- * @H: pipe H
- *
- * arg[2]:
- *
* @query-idle: Time taken to Query vblank counters
* @query-forked: Time taken to Query vblank counters (multithreaded)
* @query-busy: Time taken to Query vblank counters (during V-active)
@@ -270,10 +215,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (data->flags & RPM)
igt_require(igt_setup_runtime_pm(fd));
- igt_info("Beginning %s on pipe %s, connector %s\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe),
- igt_output_name(output));
-
if (!(data->flags & NOHANG)) {
ahnd = is_i915_device(fd) ?
get_reloc_ahnd(fd, 0) :
@@ -314,9 +255,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
if (!(data->flags & NOHANG))
igt_post_hang_ring(fd, hang);
- igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
- igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
-
put_ahnd(ahnd);
/* cleanup what prepare_crtc() has done */
@@ -342,63 +280,50 @@ pipe_output_combo_valid(igt_display_t *display,
static void crtc_id_subtest(data_t *data, int fd)
{
igt_display_t *display = &data->display;
- igt_output_t *output;
- enum pipe p;
-
- for_each_pipe_with_valid_output(display, p, output) {
- struct drm_event_vblank buf;
- const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
- unsigned crtc_id, expected_crtc_id;
- uint64_t val;
- union drm_wait_vblank vbl;
+ enum pipe p = data->pipe;
+ igt_output_t *output = data->output;
+ struct drm_event_vblank buf;
+ const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
+ unsigned crtc_id, expected_crtc_id;
+ uint64_t val;
+ union drm_wait_vblank vbl;
- igt_display_reset(display);
+ crtc_id = display->pipes[p].crtc_id;
+ if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
+ expected_crtc_id = crtc_id;
+ else
+ expected_crtc_id = 0;
- igt_output_set_pipe(output, p);
- if (!i915_pipe_output_combo_valid(display))
- continue;
+ prepare_crtc(data, fd, output);
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(p), igt_output_name(output));
+ memset(&vbl, 0, sizeof(vbl));
+ vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
+ vbl.request.type |= pipe_id_flag;
+ vbl.request.sequence = 1;
+ igt_assert_eq(wait_vblank(fd, &vbl), 0);
- crtc_id = display->pipes[p].crtc_id;
- if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
- expected_crtc_id = crtc_id;
- else
- expected_crtc_id = 0;
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- data->pipe = p;
- prepare_crtc(data, fd, output);
+ do_or_die(drmModePageFlip(fd, crtc_id,
+ data->primary_fb.fb_id,
+ DRM_MODE_PAGE_FLIP_EVENT, NULL));
- memset(&vbl, 0, sizeof(vbl));
- vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
- vbl.request.type |= pipe_id_flag;
- vbl.request.sequence = 1;
- igt_assert_eq(wait_vblank(fd, &vbl), 0);
+ igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+ igt_assert_eq(buf.crtc_id, expected_crtc_id);
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
+ if (display->is_atomic) {
+ igt_plane_t *primary = igt_output_get_plane(output, 0);
- do_or_die(drmModePageFlip(fd, crtc_id,
- data->primary_fb.fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, NULL));
+ igt_plane_set_fb(primary, &data->primary_fb);
+ igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
igt_assert_eq(buf.crtc_id, expected_crtc_id);
-
- if (display->is_atomic) {
- igt_plane_t *primary = igt_output_get_plane(output, 0);
-
- igt_plane_set_fb(primary, &data->primary_fb);
- igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
-
- igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
- igt_assert_eq(buf.crtc_id, expected_crtc_id);
- }
-
- cleanup_crtc(data, fd, output);
- return;
}
+
+ cleanup_crtc(data, fd, output);
+ return;
}
static void accuracy(data_t *data, int fd, int nchildren)
@@ -576,7 +501,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren)
estimated_vblanks, seq2, seq1 + estimated_vblanks);
}
-static void run_subtests_for_pipe(data_t *data)
+static void run_subtests(data_t *data)
{
const struct {
const char *name;
@@ -610,30 +535,22 @@ static void run_subtests_for_pipe(data_t *data)
{ }
}, *m;
- igt_fixture
- igt_display_require_output_on_pipe(&data->display, data->pipe);
-
for (f = funcs; f->name; f++) {
for (m = modes; m->name; m++) {
if (m->flags & ~(f->valid | NOHANG))
continue;
igt_describe("Check if test run while hanging by introducing NOHANG flag.");
- igt_subtest_f("pipe-%s-%s-%s",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
- int found = 0;
-
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
+ igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
+ for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
continue;
- data->flags = m->flags | NOHANG;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags | NOHANG;
+ run_test(data, f->func);
+ }
}
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
/* Skip the -hang version if NOHANG flag is set */
@@ -641,24 +558,20 @@ static void run_subtests_for_pipe(data_t *data)
continue;
igt_describe("Check if injected hang is working properly.");
- igt_subtest_f("pipe-%s-%s-%s-hang",
- kmstest_pipe_name(data->pipe),
- f->name, m->name) {
+ igt_subtest_with_dynamic_f("%s-%s-hang", f->name, m->name) {
igt_hang_t hang;
- int found = 0;
hang = igt_allow_hang(data->display.drm_fd, 0, 0);
- for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
+ for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
continue;
- data->flags = m->flags;
- run_test(data, f->func);
-
- found++;
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
+ data->flags = m->flags;
+ run_test(data, f->func);
+ }
}
igt_disallow_hang(data->display.drm_fd, hang);
- igt_require_f(found, "No valid pipe/output combo found.\n");
}
}
}
@@ -668,23 +581,7 @@ static void invalid_subtest(data_t *data, int fd)
{
union drm_wait_vblank vbl;
unsigned long valid_flags;
- igt_display_t* display = &data->display;
- enum pipe pipe = 0;
- igt_output_t *output;
-
- igt_display_reset(display);
-
- output = igt_get_single_output_for_pipe(display, pipe);
- igt_require(output);
-
- data->pipe = pipe;
- data->output = output;
-
- igt_output_set_pipe(output, pipe);
- igt_require(i915_pipe_output_combo_valid(display));
-
- igt_info("Using (pipe %s + %s) to run the subtest.\n",
- kmstest_pipe_name(pipe), igt_output_name(output));
+ igt_output_t *output = data->output;
prepare_crtc(data, fd, output);
@@ -738,18 +635,32 @@ igt_main
}
igt_describe("Negative test for vblank request.");
- igt_subtest("invalid")
- invalid_subtest(&data, fd);
+ igt_subtest_with_dynamic("invalid") {
+ for_each_pipe_with_valid_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.pipe, data.output))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ invalid_subtest(&data, fd);
+ break;
+ }
+ }
igt_describe("Check the vblank and flip events works with given crtc id.");
- igt_subtest("crtc-id")
- crtc_id_subtest(&data, fd);
+ igt_subtest_with_dynamic("crtc-id") {
+ for_each_pipe_with_valid_output(&data.display, data.pipe, data.output) {
+ if (!pipe_output_combo_valid(&data.display, data.pipe, data.output))
+ continue;
+
+ igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
+ crtc_id_subtest(&data, fd);
+ }
+ }
- for_each_pipe_static(data.pipe)
- igt_subtest_group
- run_subtests_for_pipe(&data);
+ run_subtests(&data);
igt_fixture {
+ igt_display_fini(&data.display);
drm_close_driver(fd);
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic
2023-10-11 13:31 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
@ 2023-10-13 3:21 ` Karthik B S
0 siblings, 0 replies; 9+ messages in thread
From: Karthik B S @ 2023-10-13 3:21 UTC (permalink / raw)
To: Swati Sharma, igt-dev
Hi,
On 10/11/2023 7:01 PM, Swati Sharma wrote:
> Convert existing subtests to dynamic subtests at pipe/output level
> and update testplan documentation.
>
> v2: -Remove redundant debug prints
> -Convert all subtests into dynamic
> v3: -Use pipe & output from struct data_t
> v4: -Directly use data->pipe instead of using p
> v5: -Use for_each_pipe_with_valid_output()
>
> Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
> ---
> tests/kms_vblank.c | 251 +++++++++++++++------------------------------
> 1 file changed, 81 insertions(+), 170 deletions(-)
>
> diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
> index bcfd8d012..4edd3f6bc 100644
> --- a/tests/kms_vblank.c
> +++ b/tests/kms_vblank.c
> @@ -56,107 +56,63 @@
> */
>
> /**
> - * SUBTEST: pipe-%s-ts-continuation-dpms-rpm
> + * SUBTEST: ts-continuation-dpms-rpm
> * Description: Test TS continuty with DPMS & RPM while hanging by introducing
> - * NOHANG flag on %arg[1]
> + * NOHANG flag
> * Driver requirement: i915, xe
> * Functionality: dpms, hang, rpm, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> - *
> - * arg[1]:
> - *
> - * @A: pipe A
> - * @B: pipe B
> - * @C: pipe C
> - * @D: pipe D
> - * @E: pipe E
> - * @F: pipe F
> - * @G: pipe G
> - * @H: pipe H
> */
>
> /**
> - * SUBTEST: pipe-%s-ts-continuation-dpms-suspend
> + * SUBTEST: ts-continuation-dpms-suspend
> * Description: Test TS continuty with DPMS & Suspend while hanging by introducing
> - * NOHANG flag on %arg[1]
> + * NOHANG flag
> * Driver requirement: i915, xe
> * Functionality: dpms, hang, suspend, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> - *
> - * arg[1]:
> - *
> - * @A: pipe A
> - * @B: pipe B
> - * @C: pipe C
> - * @D: pipe D
> - * @E: pipe E
> - * @F: pipe F
> - * @G: pipe G
> - * @H: pipe H
> */
>
> /**
> - * SUBTEST: pipe-%s-ts-continuation-suspend
> + * SUBTEST: ts-continuation-suspend
> * Description: Test TS continuty with Suspend while hanging by introducing NOHANG
> - * flag on %arg[1]
> + * flag
> * Driver requirement: i915, xe
> * Functionality: hang, suspend, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> - *
> - * arg[1]:
> - *
> - * @A: pipe A
> - * @B: pipe B
> - * @C: pipe C
> - * @D: pipe D
> - * @E: pipe E
> - * @F: pipe F
> - * @G: pipe G
> - * @H: pipe H
> */
>
> /**
> - * SUBTEST: pipe-%s-ts-continuation-modeset-rpm
> + * SUBTEST: ts-continuation-modeset-rpm
> * Description: Test TS continuty during Modeset with Suspend while hanging by
> - * introducing NOHANG flag on %arg[1]
> + * introducing NOHANG flag
> * Driver requirement: i915, xe
> * Functionality: hang, rpm, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> - *
> - * arg[1]:
> - *
> - * @A: pipe A
> - * @B: pipe B
> - * @C: pipe C
> - * @D: pipe D
> - * @E: pipe E
> - * @F: pipe F
> - * @G: pipe G
> - * @H: pipe H
> */
>
> /**
> - * SUBTEST: pipe-%s-accuracy-idle
> + * SUBTEST: accuracy-idle
> * Description: Test Accuracy of vblank events while hanging by introducing NOHANG
> - * flag on %arg[1]
> + * flag
> * Driver requirement: i915, xe
> * Functionality: hang, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> *
> - * SUBTEST: pipe-%s-%s
> - * Description: Test %arg[2] while hanging by introducing NOHANG flag on %arg[1]
> + * SUBTEST: %s
> + * Description: Test %arg[1] while hanging by introducing NOHANG flag
> * Driver requirement: i915, xe
> * Functionality: hang, vblank
> * Mega feature: General Display Features
> * Test category: functionality test
> *
> - * SUBTEST: pipe-%s-%s-hang
> - * Description: Test %arg[2] with injected hang is working properly on %arg[1]
> + * SUBTEST: %s-hang
> + * Description: Test %arg[1] with injected hang is working properly
> * Driver requirement: i915, xe
> * Functionality: hang, vblank
> * Mega feature: General Display Features
> @@ -164,17 +120,6 @@
> *
> * arg[1]:
> *
> - * @A: pipe A
> - * @B: pipe B
> - * @C: pipe C
> - * @D: pipe D
> - * @E: pipe E
> - * @F: pipe F
> - * @G: pipe G
> - * @H: pipe H
> - *
> - * arg[2]:
> - *
> * @query-idle: Time taken to Query vblank counters
> * @query-forked: Time taken to Query vblank counters (multithreaded)
> * @query-busy: Time taken to Query vblank counters (during V-active)
> @@ -270,10 +215,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
> if (data->flags & RPM)
> igt_require(igt_setup_runtime_pm(fd));
>
> - igt_info("Beginning %s on pipe %s, connector %s\n",
> - igt_subtest_name(), kmstest_pipe_name(data->pipe),
> - igt_output_name(output));
> -
> if (!(data->flags & NOHANG)) {
> ahnd = is_i915_device(fd) ?
> get_reloc_ahnd(fd, 0) :
> @@ -314,9 +255,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *, int, int))
> if (!(data->flags & NOHANG))
> igt_post_hang_ring(fd, hang);
>
> - igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
> - igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
> -
> put_ahnd(ahnd);
>
> /* cleanup what prepare_crtc() has done */
> @@ -342,63 +280,50 @@ pipe_output_combo_valid(igt_display_t *display,
> static void crtc_id_subtest(data_t *data, int fd)
> {
> igt_display_t *display = &data->display;
> - igt_output_t *output;
> - enum pipe p;
> -
> - for_each_pipe_with_valid_output(display, p, output) {
> - struct drm_event_vblank buf;
> - const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
> - unsigned crtc_id, expected_crtc_id;
> - uint64_t val;
> - union drm_wait_vblank vbl;
> + enum pipe p = data->pipe;
> + igt_output_t *output = data->output;
> + struct drm_event_vblank buf;
> + const uint32_t pipe_id_flag = kmstest_get_vbl_flag(p);
> + unsigned crtc_id, expected_crtc_id;
> + uint64_t val;
> + union drm_wait_vblank vbl;
>
> - igt_display_reset(display);
> + crtc_id = display->pipes[p].crtc_id;
> + if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
> + expected_crtc_id = crtc_id;
> + else
> + expected_crtc_id = 0;
>
> - igt_output_set_pipe(output, p);
> - if (!i915_pipe_output_combo_valid(display))
> - continue;
> + prepare_crtc(data, fd, output);
>
> - igt_info("Using (pipe %s + %s) to run the subtest.\n",
> - kmstest_pipe_name(p), igt_output_name(output));
> + memset(&vbl, 0, sizeof(vbl));
> + vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
> + vbl.request.type |= pipe_id_flag;
> + vbl.request.sequence = 1;
> + igt_assert_eq(wait_vblank(fd, &vbl), 0);
>
> - crtc_id = display->pipes[p].crtc_id;
> - if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
> - expected_crtc_id = crtc_id;
> - else
> - expected_crtc_id = 0;
> + igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> + igt_assert_eq(buf.crtc_id, expected_crtc_id);
>
> - data->pipe = p;
> - prepare_crtc(data, fd, output);
> + do_or_die(drmModePageFlip(fd, crtc_id,
> + data->primary_fb.fb_id,
> + DRM_MODE_PAGE_FLIP_EVENT, NULL));
>
> - memset(&vbl, 0, sizeof(vbl));
> - vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
> - vbl.request.type |= pipe_id_flag;
> - vbl.request.sequence = 1;
> - igt_assert_eq(wait_vblank(fd, &vbl), 0);
> + igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> + igt_assert_eq(buf.crtc_id, expected_crtc_id);
>
> - igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> - igt_assert_eq(buf.crtc_id, expected_crtc_id);
> + if (display->is_atomic) {
> + igt_plane_t *primary = igt_output_get_plane(output, 0);
>
> - do_or_die(drmModePageFlip(fd, crtc_id,
> - data->primary_fb.fb_id,
> - DRM_MODE_PAGE_FLIP_EVENT, NULL));
> + igt_plane_set_fb(primary, &data->primary_fb);
> + igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
>
> igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> igt_assert_eq(buf.crtc_id, expected_crtc_id);
> -
> - if (display->is_atomic) {
> - igt_plane_t *primary = igt_output_get_plane(output, 0);
> -
> - igt_plane_set_fb(primary, &data->primary_fb);
> - igt_display_commit_atomic(display, DRM_MODE_PAGE_FLIP_EVENT, NULL);
> -
> - igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
> - igt_assert_eq(buf.crtc_id, expected_crtc_id);
> - }
> -
> - cleanup_crtc(data, fd, output);
> - return;
> }
> +
> + cleanup_crtc(data, fd, output);
> + return;
> }
>
> static void accuracy(data_t *data, int fd, int nchildren)
> @@ -576,7 +501,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren)
> estimated_vblanks, seq2, seq1 + estimated_vblanks);
> }
>
> -static void run_subtests_for_pipe(data_t *data)
> +static void run_subtests(data_t *data)
> {
> const struct {
> const char *name;
> @@ -610,30 +535,22 @@ static void run_subtests_for_pipe(data_t *data)
> { }
> }, *m;
>
> - igt_fixture
> - igt_display_require_output_on_pipe(&data->display, data->pipe);
> -
> for (f = funcs; f->name; f++) {
> for (m = modes; m->name; m++) {
> if (m->flags & ~(f->valid | NOHANG))
> continue;
>
> igt_describe("Check if test run while hanging by introducing NOHANG flag.");
> - igt_subtest_f("pipe-%s-%s-%s",
> - kmstest_pipe_name(data->pipe),
> - f->name, m->name) {
> - int found = 0;
> -
> - for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
> + igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
> + for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
> if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
> continue;
>
> - data->flags = m->flags | NOHANG;
> - run_test(data, f->func);
> -
> - found++;
> + igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
> + data->flags = m->flags | NOHANG;
> + run_test(data, f->func);
> + }
> }
> - igt_require_f(found, "No valid pipe/output combo found.\n");
> }
>
> /* Skip the -hang version if NOHANG flag is set */
> @@ -641,24 +558,20 @@ static void run_subtests_for_pipe(data_t *data)
> continue;
>
> igt_describe("Check if injected hang is working properly.");
> - igt_subtest_f("pipe-%s-%s-%s-hang",
> - kmstest_pipe_name(data->pipe),
> - f->name, m->name) {
> + igt_subtest_with_dynamic_f("%s-%s-hang", f->name, m->name) {
> igt_hang_t hang;
> - int found = 0;
>
> hang = igt_allow_hang(data->display.drm_fd, 0, 0);
> - for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
> + for_each_pipe_with_valid_output(&data->display, data->pipe, data->output) {
> if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
> continue;
>
> - data->flags = m->flags;
> - run_test(data, f->func);
> -
> - found++;
> + igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
> + data->flags = m->flags;
> + run_test(data, f->func);
> + }
> }
> igt_disallow_hang(data->display.drm_fd, hang);
> - igt_require_f(found, "No valid pipe/output combo found.\n");
> }
> }
> }
> @@ -668,23 +581,7 @@ static void invalid_subtest(data_t *data, int fd)
> {
> union drm_wait_vblank vbl;
> unsigned long valid_flags;
> - igt_display_t* display = &data->display;
> - enum pipe pipe = 0;
> - igt_output_t *output;
> -
> - igt_display_reset(display);
> -
> - output = igt_get_single_output_for_pipe(display, pipe);
> - igt_require(output);
> -
> - data->pipe = pipe;
> - data->output = output;
> -
> - igt_output_set_pipe(output, pipe);
> - igt_require(i915_pipe_output_combo_valid(display));
> -
> - igt_info("Using (pipe %s + %s) to run the subtest.\n",
> - kmstest_pipe_name(pipe), igt_output_name(output));
> + igt_output_t *output = data->output;
>
> prepare_crtc(data, fd, output);
>
> @@ -738,18 +635,32 @@ igt_main
> }
>
> igt_describe("Negative test for vblank request.");
> - igt_subtest("invalid")
> - invalid_subtest(&data, fd);
> + igt_subtest_with_dynamic("invalid") {
> + for_each_pipe_with_valid_output(&data.display, data.pipe, data.output) {
> + if (!pipe_output_combo_valid(&data.display, data.pipe, data.output))
> + continue;
> +
> + igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
> + invalid_subtest(&data, fd);
> + break;
I see that without this patch also this subtest was anyway running on
just one pipe/output combination, so I'm fine with taking that same
design forward. But as we're now adding this loop and then breaking
after the first valid combination, may be we could just add a small
comment saying why we're breaking here as this is the one subtest which
is different from others.
With this added,
Reviewed-by: Karthik B S <karthik.b.s@intel.com>
> + }
> + }
>
> igt_describe("Check the vblank and flip events works with given crtc id.");
> - igt_subtest("crtc-id")
> - crtc_id_subtest(&data, fd);
> + igt_subtest_with_dynamic("crtc-id") {
> + for_each_pipe_with_valid_output(&data.display, data.pipe, data.output) {
> + if (!pipe_output_combo_valid(&data.display, data.pipe, data.output))
> + continue;
> +
> + igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
> + crtc_id_subtest(&data, fd);
> + }
> + }
>
> - for_each_pipe_static(data.pipe)
> - igt_subtest_group
> - run_subtests_for_pipe(&data);
> + run_subtests(&data);
>
> igt_fixture {
> + igt_display_fini(&data.display);
> drm_close_driver(fd);
> }
> }
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-10-13 3:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 7:54 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
2023-09-18 7:54 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: update testplan doc Swati Sharma
2023-09-18 11:50 ` [igt-dev] ✗ Fi.CI.BUILD: failure for tests/kms_vblank: Test cleanup and dynamic conversion Patchwork
2023-09-18 11:51 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-10-11 13:31 [igt-dev] [PATCH i-g-t 0/3] " Swati Sharma
2023-10-11 13:31 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
2023-10-13 3:21 ` Karthik B S
2023-09-18 7:50 [igt-dev] [PATCH i-g-t 0/3] Test cleanup and dynamic conversion Swati Sharma
2023-09-18 7:51 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox