Skip to contentSkip to conversation

tests/kms_rmfb: IGT test Cleanup

PATCH Superseded Mohammed Thasleem 3 participants 5 messages Jun 23, 2022 – Jun 27, 2022

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v2 cover tests/kms_rmfb: IGT test Cleanup

Convert all possible subtests to dynamic and sanitize the system state before starting/exiting the subtest.

Mohammed Thasleem (2):
tests/kms_rmfb: Create dynamic subtests
tests/kms_rmfb: Test Cleanup

 tests/kms_rmfb.c | 45 ++++++++++++++++++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 11 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/2 tests/kms_rmfb: Create dynamic subtests

Modified kms_rmfb to include dynamic test cases.

v2: addressed indentation, test description moved into struct
and added global description to test.

---
 tests/kms_rmfb.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
tests/kms_rmfb.c +27 -10
index fcd5cdad..72e58042 100644
@@ -36,6 +36,9 @@
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+IGT_TEST_DESCRIPTION("This tests rmfb and close-fd behavior. In these cases"
+		     "the framebuffers should be removed from the crtc.");
+
 struct rmfb_data {
 	int drm_fd;
 	igt_display_t display;
@@ -151,14 +154,29 @@ run_rmfb_test(struct rmfb_data *data, bool reopen)
 	igt_output_t *output;
 	enum pipe pipe;
 
-	for_each_pipe_with_single_output(&data->display, pipe, output)
-		test_rmfb(data, output, pipe, reopen);
+	for_each_pipe_with_single_output(&data->display, pipe, output) {
+		igt_dynamic_f("%s-pipe-%s", igt_output_name(output),
+			      kmstest_pipe_name(pipe))
+			test_rmfb(data, output, pipe, reopen);
+	}
 }
 
 igt_main
 {
+	int i;
 	struct rmfb_data data = {};
 
+	const struct {
+		bool flags;
+		const char *name;
+		const char *description;
+	} tests[] = {
+		{ false, "rmfb-ioctl", "RMFB is supposed to free the framebuffers from any and all"
+				       "planes so test this and make sure it works."},
+		{ true, "close-fd", "RMFB is supposed to free the framebuffers from any and all planes"
+				    "so test this and make sure it works with fd close and reopen."},
+	};
+
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
@@ -168,15 +186,14 @@ igt_main
 		igt_display_require_output(&data.display);
 	}
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all "
-		     "planes so test this and make sure it works.");
-	igt_subtest_f("rmfb-ioctl")
-		run_rmfb_test(&data, false);
+	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all planes "
-		     "so test this and make sure it works with fd close and reopen.");
-	igt_subtest_f("close-fd")
-		run_rmfb_test(&data, true);
+		igt_describe(tests[i].description);
+		igt_subtest_with_dynamic(tests[i].name) {
+			run_rmfb_test(&data, tests[i].flags);
+
+		}
+	}
 
 	igt_fixture {
 		igt_display_fini(&data.display);
Signature · 1 line
2.25.1
#2 lore raw

Re: [igt-dev] [PATCH v2 1/2] tests/kms_rmfb: Create dynamic subtests

Hi Mohammed,

Quoted 30 lines · Mohammed Thasleem

Modified kms_rmfb to include dynamic test cases.

v2: addressed indentation, test description moved into struct
and added global description to test.

---
 tests/kms_rmfb.c | 37 +++++++++++++++++++++++++++----------
 1 file changed, 27 insertions(+), 10 deletions(-)
tests/kms_rmfb.c +3 -2
index fcd5cdad..72e58042 100644
@@ -36,6 +36,9 @@
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+IGT_TEST_DESCRIPTION("This tests rmfb and close-fd behavior. In these cases"
+		     "the framebuffers should be removed from the crtc.");
+
 struct rmfb_data {
 	int drm_fd;
 	igt_display_t display;
@@ -151,14 +154,29 @@ run_rmfb_test(struct rmfb_data *data, bool reopen)
 	igt_output_t *output;
 	enum pipe pipe;
 
-	for_each_pipe_with_single_output(&data->display, pipe, output)
-		test_rmfb(data, output, pipe, reopen);

tests/kms_rmfb.c run_rmfb_test(struct rmfb_data *data, bool reopen) · line 166

Quoted 10 lines
tests/kms_rmfb.c +6 -0
+	for_each_pipe_with_single_output(&data->display, pipe, output) {
+		igt_dynamic_f("%s-pipe-%s", igt_output_name(output),
+			      kmstest_pipe_name(pipe))
+			test_rmfb(data, output, pipe, reopen);
+	}
 }
 
 igt_main
 {
+	int i;

Move this below after tests[] definition.

tests/kms_rmfb.c run_rmfb_test(struct rmfb_data *data, bool reopen) · line 168

Quoted 2 lines
tests/kms_rmfb.c +0 -0
 	struct rmfb_data data = {};
 

Remove this empty line from here.

tests/kms_rmfb.c run_rmfb_test(struct rmfb_data *data, bool reopen) · line 174

Quoted 6 lines
tests/kms_rmfb.c +6 -0
+	const struct {
+		bool flags;
+		const char *name;
+		const char *description;
+	} tests[] = {
+		{ false, "rmfb-ioctl", "RMFB is supposed to free the framebuffers from any and all"

------------------------------------------------------------------------------------------------- ^ Please add space here. You can use --describe option to see
description on screen and check them. Now it will look like
"allplanes", but it should be "all planes".

tests/kms_rmfb.c run_rmfb_test(struct rmfb_data *data, bool reopen) · line 176

Quoted 2 lines
tests/kms_rmfb.c +2 -0
+				       "planes so test this and make sure it works."},
+		{ true, "close-fd", "RMFB is supposed to free the framebuffers from any and all planes"

----------------------------------------------------------------------------------------------------- ^ Same here, add space at end.
This line is a little too long, split it more, into three lines.

tests/kms_rmfb.c run_rmfb_test(struct rmfb_data *data, bool reopen) · line 178

Quoted 2 lines
tests/kms_rmfb.c +2 -0
+				    "so test this and make sure it works with fd close and reopen."},
+	};

Put "int i;" here.

Quoted 30 lines
tests/kms_rmfb.c +8 -8
+
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
@@ -168,15 +186,14 @@ igt_main
 		igt_display_require_output(&data.display);
 	}
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all "
-		     "planes so test this and make sure it works.");
-	igt_subtest_f("rmfb-ioctl")
-		run_rmfb_test(&data, false);
+	for (i = 0; i < ARRAY_SIZE(tests); i++) {
 
-	igt_describe("RMFB is supposed to free the framebuffers from any and all planes "
-		     "so test this and make sure it works with fd close and reopen.");
-	igt_subtest_f("close-fd")
-		run_rmfb_test(&data, true);
+		igt_describe(tests[i].description);
+		igt_subtest_with_dynamic(tests[i].name) {
+			run_rmfb_test(&data, tests[i].flags);
+
+		}
+	}
 
 	igt_fixture {
 		igt_display_fini(&data.display);
Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 2/2 tests/kms_rmfb: Test Cleanup

In reply to Mohammed Thasleem

Sanitize the system state before starting the subtest.

---
 tests/kms_rmfb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
tests/kms_rmfb.c +7 -1
index 72e58042..e2afbc93 100644
@@ -57,12 +57,14 @@ static void
 test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reopen)
 {
 	struct igt_fb fb, argb_fb;
+	igt_display_t *display = &data->display;
 	drmModeModeInfo *mode;
 	igt_plane_t *plane;
 	drmModeCrtc *crtc;
 	uint64_t cursor_width, cursor_height;
 	int num_active_planes = 0;
 
+	igt_display_reset(display);
 	igt_output_set_pipe(output, pipe);
 
 	mode = igt_output_get_mode(output);
@@ -145,7 +147,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo
 		drmModeFreePlane(planeres);
 	}
 
-	igt_output_set_pipe(output, PIPE_ANY);
+	igt_output_set_pipe(output, PIPE_NONE);
 }
 
 static void
@@ -184,6 +186,9 @@ igt_main
 
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
+		igt_display_reset(&data.display);
+		igt_display_commit2(&data.display, data.display.is_atomic ?
+				    COMMIT_ATOMIC : COMMIT_LEGACY);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(tests); i++) {
@@ -197,5 +202,6 @@ igt_main
 
 	igt_fixture {
 		igt_display_fini(&data.display);
+		close(data.drm_fd);
 	}
 }
Signature · 1 line
2.25.1
#4 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_rmfb: IGT test cleanup (rev2)

In reply to Mohammed Thasleem
== Series Details ==

== Series Details ==

Series: tests/kms_rmfb: IGT test cleanup (rev2)
URL : https://patchwork.freedesktop.org/series/105149/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_11797 -> IGTPW_7369
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_7369 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_7369, 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_7369/index.html

Participating hosts (36 -> 36)
------------------------------

Additional (3): bat-dg2-8 bat-adln-1 bat-jsl-1
Missing (3): fi-cfl-guc fi-bdw-samus fi-tgl-u2

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_7369:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@vma:
- fi-bdw-5557u: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11797/fi-bdw-5557u/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/fi-bdw-5557u/igt@i915_selftest@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* igt@i915_selftest@live@mman:
- {bat-adln-1}: NOTRUN -> [DMESG-FAIL][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/bat-adln-1/igt@i915_selftest@[email protected]

Known issues
------------

Here are the changes found in IGTPW_7369 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@i915_selftest@live@hangcheck:
- bat-dg1-5: [PASS][4] -> [DMESG-FAIL][5] ([i915#4494] / [i915#4957])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11797/bat-dg1-5/igt@i915_selftest@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/bat-dg1-5/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@requests:
- fi-pnv-d510: [PASS][6] -> [DMESG-FAIL][7] ([i915#4528])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11797/fi-pnv-d510/igt@i915_selftest@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/fi-pnv-d510/igt@i915_selftest@[email protected]

* igt@kms_chamelium@common-hpd-after-suspend:
- fi-snb-2600: NOTRUN -> [SKIP][8] ([fdo#109271] / [fdo#111827])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/fi-snb-2600/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@hangcheck:
- fi-snb-2600: [INCOMPLETE][9] ([i915#3921]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11797/fi-snb-2600/igt@i915_selftest@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/fi-snb-2600/igt@i915_selftest@[email protected]

{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#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[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#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#3003]: https://gitlab.freedesktop.org/drm/intel/issues/3003
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3595]: https://gitlab.freedesktop.org/drm/intel/issues/3595
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3921]: https://gitlab.freedesktop.org/drm/intel/issues/3921
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4494]: https://gitlab.freedesktop.org/drm/intel/issues/4494
[i915#4528]: https://gitlab.freedesktop.org/drm/intel/issues/4528
[i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
[i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
[i915#5174]: https://gitlab.freedesktop.org/drm/intel/issues/5174
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5763]: https://gitlab.freedesktop.org/drm/intel/issues/5763
[i915#5885]: https://gitlab.freedesktop.org/drm/intel/issues/5885
[i915#5903]: https://gitlab.freedesktop.org/drm/intel/issues/5903

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_6541 -> IGTPW_7369

CI-20190529: 20190529
CI_DRM_11797: c8c7034b2d49cd9833263fb7aa764c8d4f3f0043 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7369: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/index.html
IGT_6541: 02153f109bd422d93cfce7f5aa9d7b0e22fab13c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7369/index.html