Skip to contentSkip to conversation

tests/kms_plane_alpha_blend: Convert test to dynamic

PATCH Superseded Karthik B S 3 participants 4 messages Sep 13, 2022 – Sep 21, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_plane_alpha_blend: Convert test to dynamic

Covert the existing subtests to dynamic subtests at pipe/output level.

---
 tests/kms_plane_alpha_blend.c | 149 ++++++++++++++++++++++------------
 1 file changed, 96 insertions(+), 53 deletions(-)
tests/kms_plane_alpha_blend.c +96 -53
index bd064d1e..3e7ac7ec 100644
@@ -466,12 +466,11 @@ static void coverage_premult_constant(data_t *data, enum pipe pipe, igt_plane_t
 	igt_pipe_crc_stop(data->pipe_crc);
 }
 
-static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend,
-				    bool must_multiply,
+static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, igt_output_t *output,
+				    bool blend, bool must_multiply,
 				    void(*test)(data_t *, enum pipe, igt_plane_t *))
 {
 	igt_display_t *display = &data->display;
-	igt_output_t *output = igt_get_single_output_for_pipe(display, pipe);
 	igt_plane_t *plane;
 	bool found = false;
 	bool multiply = false;
@@ -506,68 +505,114 @@ static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend,
 	igt_require_f(multiply, "Multiplied (plane x pixel) alpha not available\n");
 }
 
-static void run_subtests(data_t *data, enum pipe pipe)
+static const struct {
+	const char *name;
+	void (*test)(data_t *, enum pipe, igt_plane_t *);
+	bool blend;
+	bool must_multiply;
+	const char *desc;
+} subtests[] = {
+	{ .name = "alpha-basic",
+	  .test = basic_alpha,
+	  .blend = false,
+	  .must_multiply = true,
+	  .desc = "Tests basic plane alpha properties.",
+	},
+	{ .name = "alpha-7efc",
+	  .test = alpha_7efc,
+	  .blend = false,
+	  .must_multiply = true,
+	  .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+		  "plane_alpha are swappable on pre-multiplied blend mode.",
+	},
+	{ .name = "coverage-7efc",
+	  .test = coverage_7efc,
+	  .blend = true,
+	  .must_multiply = true,
+	  .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+		  "plane_alpha are swappable on coverage blend mode.",
+	},
+	{ .name = "coverage-vs-premult-vs-constant",
+	  .test = coverage_premult_constant,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests pipe coverage blending properties.",
+	},
+	{ .name = "alpha-transparent-fb",
+	  .test = argb_transparent,
+	  .blend = false,
+	  .must_multiply = false,
+	  .desc = "Tests the alpha property with transparent fb.",
+	},
+	{ .name = "alpha-opaque-fb",
+	  .test = argb_opaque,
+	  .blend = false,
+	  .must_multiply = false,
+	  .desc = "Tests alpha properties with opaque fb.",
+	},
+	{ .name = "constant-alpha-min",
+	  .test = constant_alpha_min,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with minimum alpha value.",
+	},
+	{ .name = "constant-alpha-mid",
+	  .test = constant_alpha_mid,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with medium alpha value.",
+	},
+	{ .name = "constant-alpha-max",
+	  .test = constant_alpha_max,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with maximum alpha value.",
+	},
+};
+
+static void pipe_check(igt_display_t *display, enum pipe pipe)
 {
-	igt_fixture {
-		bool found = false;
-		igt_plane_t *plane;
-
-		igt_display_require_output_on_pipe(&data->display, pipe);
-		for_each_plane_on_pipe(&data->display, pipe, plane) {
-			if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
-				continue;
+	bool found = false;
+	igt_plane_t *plane;
 
-			found = true;
-			break;
-		}
+	igt_display_require_output_on_pipe(display, pipe);
+	for_each_plane_on_pipe(display, pipe, plane) {
+		if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
+			continue;
 
-		igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n",
-			      kmstest_pipe_name(pipe));
+		found = true;
+		break;
 	}
 
-	igt_describe("Tests basic plane alpha properties.");
-	igt_subtest_f("pipe-%s-alpha-basic", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, true, basic_alpha);
+	igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n",
+		      kmstest_pipe_name(pipe));
 
-	igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
-		     "plane_alpha are swappable on pre-multiplied blend mode.");
-	igt_subtest_f("pipe-%s-alpha-7efc", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, true, alpha_7efc);
-
-	igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
-		     "plane_alpha are swappable on coverage blend mode.");
-	igt_subtest_f("pipe-%s-coverage-7efc", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, true, coverage_7efc);
-
-	igt_describe("Tests pipe coverage blending properties.");
-	igt_subtest_f("pipe-%s-coverage-vs-premult-vs-constant", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, coverage_premult_constant);
-
-	igt_describe("Tests the alpha property with transparent fb.");
-	igt_subtest_f("pipe-%s-alpha-transparent-fb", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, false, argb_transparent);
+}
 
-	igt_describe("Tests alpha properties with opaque fb.");
-	igt_subtest_f("pipe-%s-alpha-opaque-fb", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, false, argb_opaque);
+static void run_subtests(data_t *data)
+{
+	igt_output_t *output;
+	enum pipe pipe;
 
-	igt_describe("Tests plane alpha and blending properties with minimum alpha value.");
-	igt_subtest_f("pipe-%s-constant-alpha-min", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_min);
+	for (int i = 0; i < ARRAY_SIZE(subtests); i++) {
+		igt_describe_f("%s\n", subtests[i].desc);
 
-	igt_describe("Tests plane alpha and blending properties with medium alpha value");
-	igt_subtest_f("pipe-%s-constant-alpha-mid", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_mid);
+		igt_subtest_with_dynamic(subtests[i].name) {
+			for_each_pipe(&data->display, pipe) {
+				pipe_check(&data->display, pipe);
+				output = igt_get_single_output_for_pipe(&data->display, pipe);
 
-	igt_describe("Tests plane alpha and blending properties with maximum alpha value");
-	igt_subtest_f("pipe-%s-constant-alpha-max", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_max);
+				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
+					run_test_on_pipe_planes(data, pipe, output, subtests[i].blend,
+								subtests[i].must_multiply, subtests[i].test);
+			}
+		}
+	}
 }
 
 igt_main
 {
 	data_t data = {};
-	enum pipe pipe;
 
 	igt_fixture {
 		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
@@ -576,9 +621,7 @@ igt_main
 		igt_require(data.display.is_atomic);
 	}
 
-	for_each_pipe_static(pipe)
-		igt_subtest_group
-			run_subtests(&data, pipe);
+	run_subtests(&data);
 
 	igt_fixture {
 		igt_display_reset(&data.display);
Signature · 1 line
2.22.0
#1 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_plane_alpha_blend: Convert test to dynamic

== Series Details ==

== Series Details ==

Series: tests/kms_plane_alpha_blend: Convert test to dynamic
URL : https://patchwork.freedesktop.org/series/108500/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12128 -> IGTPW_7778
====================================================

Summary
-------

**FAILURE**

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

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

Participating hosts (42 -> 42)
------------------------------

Additional (2): bat-dg2-11 fi-icl-u2
Missing (2): fi-ctg-p8600 fi-bdw-samus

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

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

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live@mman:
- fi-rkl-guc: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/fi-rkl-guc/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-rkl-guc/igt@i915_selftest@[email protected]

#### Suppressed ####

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

* igt@gem_exec_suspend@basic-s0@lmem0:
- {bat-dg2-11}: NOTRUN -> [DMESG-WARN][3] +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/bat-dg2-11/igt@gem_exec_suspend@[email protected]

* igt@i915_module_load@load:
- {bat-dg2-8}: [PASS][4] -> [FAIL][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/bat-dg2-8/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/bat-dg2-8/igt@[email protected]

* igt@kms_pipe_crc_basic@suspend-read-crc@pipe-d-dp-2:
- {bat-dg2-11}: NOTRUN -> [FAIL][6]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/bat-dg2-11/igt@kms_pipe_crc_basic@[email protected]

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

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

### IGT changes ###

#### Issues hit ####

* igt@gem_huc_copy@huc-copy:
- fi-icl-u2: NOTRUN -> [SKIP][7] ([i915#2190])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@gem_lmem_swapping@random-engines:
- fi-icl-u2: NOTRUN -> [SKIP][8] ([i915#4613]) +3 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@i915_selftest@live@gt_mocs:
- fi-icl-u2: NOTRUN -> [INCOMPLETE][9] ([i915#4890])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@i915_selftest@live@gt_mocs.html

* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [PASS][10] -> [INCOMPLETE][11] ([i915#4785])
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/fi-hsw-4770/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-hsw-4770/igt@i915_selftest@[email protected]
- fi-hsw-g3258: [PASS][12] -> [INCOMPLETE][13] ([i915#3303] / [i915#4785])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/fi-hsw-g3258/igt@i915_selftest@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-hsw-g3258/igt@i915_selftest@[email protected]

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

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

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-icl-u2: NOTRUN -> [SKIP][17] ([fdo#111827]) +7 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
- fi-icl-u2: NOTRUN -> [SKIP][18] ([i915#4103])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@kms_force_connector_basic@force-connector-state:
- fi-icl-u2: NOTRUN -> [WARN][19] ([i915#6008])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@kms_force_connector_basic@force-load-detect:
- fi-icl-u2: NOTRUN -> [SKIP][20] ([fdo#109285])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@kms_setmode@basic-clone-single-crtc:
- fi-icl-u2: NOTRUN -> [SKIP][21] ([i915#3555])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@prime_vgem@basic-userptr:
- fi-icl-u2: NOTRUN -> [SKIP][22] ([fdo#109295] / [i915#3301])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]

* igt@runner@aborted:
- fi-icl-u2: NOTRUN -> [FAIL][23] ([i915#4312] / [i915#6599])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-icl-u2/igt@[email protected]
- fi-hsw-g3258: NOTRUN -> [FAIL][24] ([fdo#109271] / [i915#4312] / [i915#6246])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-hsw-g3258/igt@[email protected]

#### Possible fixes ####

* igt@i915_selftest@live@hangcheck:
- fi-ivb-3770: [INCOMPLETE][25] ([i915#3303] / [i915#5370]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/fi-ivb-3770/igt@i915_selftest@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/fi-ivb-3770/igt@i915_selftest@[email protected]

* igt@i915_selftest@live@slpc:
- {bat-rpls-1}: [DMESG-FAIL][27] ([i915#6367]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/bat-rpls-1/igt@i915_selftest@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/bat-rpls-1/igt@i915_selftest@[email protected]

#### Warnings ####

* igt@i915_selftest@live@hangcheck:
- bat-dg1-5: [DMESG-FAIL][29] ([i915#4957]) -> [DMESG-FAIL][30] ([i915#4494] / [i915#4957])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12128/bat-dg1-5/igt@i915_selftest@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/bat-dg1-5/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#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
[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#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#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4873]: https://gitlab.freedesktop.org/drm/intel/issues/4873
[i915#4890]: https://gitlab.freedesktop.org/drm/intel/issues/4890
[i915#4957]: https://gitlab.freedesktop.org/drm/intel/issues/4957
[i915#5190]: https://gitlab.freedesktop.org/drm/intel/issues/5190
[i915#5274]: https://gitlab.freedesktop.org/drm/intel/issues/5274
[i915#5370]: https://gitlab.freedesktop.org/drm/intel/issues/5370
[i915#6008]: https://gitlab.freedesktop.org/drm/intel/issues/6008
[i915#6246]: https://gitlab.freedesktop.org/drm/intel/issues/6246
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6599]: https://gitlab.freedesktop.org/drm/intel/issues/6599
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621

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

* CI: CI-20190529 -> None
* IGT: IGT_6653 -> IGTPW_7778

CI-20190529: 20190529
CI_DRM_12128: 9508a7418e4beed93db88d42235449bc097eaf97 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_7778: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7778/index.html
IGT_6653: 4f927248ebbf11f03f4c1ea2254f011e7575322f @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

Testlist changes
----------------

+igt@kms_plane_alpha_blend@alpha-7efc +igt@kms_plane_alpha_blend@alpha-basic +igt@kms_plane_alpha_blend@alpha-opaque-fb +igt@kms_plane_alpha_blend@alpha-transparent-fb +igt@kms_plane_alpha_blend@constant-alpha-max +igt@kms_plane_alpha_blend@constant-alpha-mid +igt@kms_plane_alpha_blend@constant-alpha-min +igt@kms_plane_alpha_blend@coverage-7efc +igt@kms_plane_alpha_blend@coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-a-alpha-7efc -igt@kms_plane_alpha_blend@pipe-a-alpha-basic -igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-a-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-a-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-a-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-a-coverage-7efc -igt@kms_plane_alpha_blend@pipe-a-coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-b-alpha-7efc -igt@kms_plane_alpha_blend@pipe-b-alpha-basic -igt@kms_plane_alpha_blend@pipe-b-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-b-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-b-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-b-coverage-7efc -igt@kms_plane_alpha_blend@pipe-b-coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-c-alpha-7efc -igt@kms_plane_alpha_blend@pipe-c-alpha-basic -igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-c-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-c-coverage-7efc -igt@kms_plane_alpha_blend@pipe-c-coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-d-alpha-7efc -igt@kms_plane_alpha_blend@pipe-d-alpha-basic -igt@kms_plane_alpha_blend@pipe-d-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-d-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-d-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-d-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-d-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-d-coverage-7efc -igt@kms_plane_alpha_blend@pipe-d-coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-e-alpha-7efc -igt@kms_plane_alpha_blend@pipe-e-alpha-basic -igt@kms_plane_alpha_blend@pipe-e-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-e-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-e-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-e-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-e-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-e-coverage-7efc -igt@kms_plane_alpha_blend@pipe-e-coverage-vs-premult-vs-constant -igt@kms_plane_alpha_blend@pipe-f-alpha-7efc -igt@kms_plane_alpha_blend@pipe-f-alpha-basic -igt@kms_plane_alpha_blend@pipe-f-alpha-opaque-fb -igt@kms_plane_alpha_blend@pipe-f-alpha-transparent-fb -igt@kms_plane_alpha_blend@pipe-f-constant-alpha-max -igt@kms_plane_alpha_blend@pipe-f-constant-alpha-mid -igt@kms_plane_alpha_blend@pipe-f-constant-alpha-min -igt@kms_plane_alpha_blend@pipe-f-coverage-7efc -igt@kms_plane_alpha_blend@pipe-f-coverage-vs-premult-vs-constant

== Logs ==

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

#2 lore raw
In reply to Karthik B S
Quoted 111 lines · Karthik B S

Covert the existing subtests to dynamic subtests at pipe/output level.

---
  tests/kms_plane_alpha_blend.c | 149 ++++++++++++++++++++++------------
  1 file changed, 96 insertions(+), 53 deletions(-)
tests/kms_plane_alpha_blend.c +70 -14
index bd064d1e..3e7ac7ec 100644
@@ -466,12 +466,11 @@ static void coverage_premult_constant(data_t *data, enum pipe pipe, igt_plane_t
  	igt_pipe_crc_stop(data->pipe_crc);
  }
 
-static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend,
-				    bool must_multiply,
+static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, igt_output_t *output,
+				    bool blend, bool must_multiply,
  				    void(*test)(data_t *, enum pipe, igt_plane_t *))
  {
  	igt_display_t *display = &data->display;
-	igt_output_t *output = igt_get_single_output_for_pipe(display, pipe);
  	igt_plane_t *plane;
  	bool found = false;
  	bool multiply = false;
@@ -506,68 +505,114 @@ static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend,
  	igt_require_f(multiply, "Multiplied (plane x pixel) alpha not available\n");
  }
 
-static void run_subtests(data_t *data, enum pipe pipe)
+static const struct {
+	const char *name;
+	void (*test)(data_t *, enum pipe, igt_plane_t *);
+	bool blend;
+	bool must_multiply;
+	const char *desc;
+} subtests[] = {
+	{ .name = "alpha-basic",
+	  .test = basic_alpha,
+	  .blend = false,
+	  .must_multiply = true,
+	  .desc = "Tests basic plane alpha properties.",
+	},
+	{ .name = "alpha-7efc",
+	  .test = alpha_7efc,
+	  .blend = false,
+	  .must_multiply = true,
+	  .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+		  "plane_alpha are swappable on pre-multiplied blend mode.",
+	},
+	{ .name = "coverage-7efc",
+	  .test = coverage_7efc,
+	  .blend = true,
+	  .must_multiply = true,
+	  .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+		  "plane_alpha are swappable on coverage blend mode.",
+	},
+	{ .name = "coverage-vs-premult-vs-constant",
+	  .test = coverage_premult_constant,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests pipe coverage blending properties.",
+	},
+	{ .name = "alpha-transparent-fb",
+	  .test = argb_transparent,
+	  .blend = false,
+	  .must_multiply = false,
+	  .desc = "Tests the alpha property with transparent fb.",
+	},
+	{ .name = "alpha-opaque-fb",
+	  .test = argb_opaque,
+	  .blend = false,
+	  .must_multiply = false,
+	  .desc = "Tests alpha properties with opaque fb.",
+	},
+	{ .name = "constant-alpha-min",
+	  .test = constant_alpha_min,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with minimum alpha value.",
+	},
+	{ .name = "constant-alpha-mid",
+	  .test = constant_alpha_mid,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with medium alpha value.",
+	},
+	{ .name = "constant-alpha-max",
+	  .test = constant_alpha_max,
+	  .blend = true,
+	  .must_multiply = false,
+	  .desc = "Tests plane alpha and blending properties with maximum alpha value.",
+	},
+};
+
+static void pipe_check(igt_display_t *display, enum pipe pipe)
  {
-	igt_fixture {
-		bool found = false;
-		igt_plane_t *plane;
-
-		igt_display_require_output_on_pipe(&data->display, pipe);
-		for_each_plane_on_pipe(&data->display, pipe, plane) {
-			if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
-				continue;
+	bool found = false;
+	igt_plane_t *plane;
 
-			found = true;
-			break;

tests/kms_plane_alpha_blend.c static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend, · line 584

Quoted 10 lines
tests/kms_plane_alpha_blend.c +6 -3
-		}
+	igt_display_require_output_on_pipe(display, pipe);
+	for_each_plane_on_pipe(display, pipe, plane) {
+		if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
+			continue;
 
-		igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n",
-			      kmstest_pipe_name(pipe));
+		found = true;
+		break;

Let's make this function as bool & return true if we found a valid plane else false. And execute igt_dynamic() based on this return value.

Quoted 38 lines
tests/kms_plane_alpha_blend.c +7 -26
  	}
 
-	igt_describe("Tests basic plane alpha properties.");
-	igt_subtest_f("pipe-%s-alpha-basic", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, true, basic_alpha);
+	igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n",
+		      kmstest_pipe_name(pipe));
 
-	igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
-		     "plane_alpha are swappable on pre-multiplied blend mode.");
-	igt_subtest_f("pipe-%s-alpha-7efc", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, true, alpha_7efc);
-
-	igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
-		     "plane_alpha are swappable on coverage blend mode.");
-	igt_subtest_f("pipe-%s-coverage-7efc", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, true, coverage_7efc);
-
-	igt_describe("Tests pipe coverage blending properties.");
-	igt_subtest_f("pipe-%s-coverage-vs-premult-vs-constant", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, coverage_premult_constant);
-
-	igt_describe("Tests the alpha property with transparent fb.");
-	igt_subtest_f("pipe-%s-alpha-transparent-fb", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, false, argb_transparent);
+}
 
-	igt_describe("Tests alpha properties with opaque fb.");
-	igt_subtest_f("pipe-%s-alpha-opaque-fb", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, false, false, argb_opaque);
+static void run_subtests(data_t *data)
+{
+	igt_output_t *output;
+	enum pipe pipe;
 
-	igt_describe("Tests plane alpha and blending properties with minimum alpha value.");
-	igt_subtest_f("pipe-%s-constant-alpha-min", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_min);

tests/kms_plane_alpha_blend.c static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend, · line 603

Quoted 10 lines
tests/kms_plane_alpha_blend.c +6 -3
+	for (int i = 0; i < ARRAY_SIZE(subtests); i++) {
+		igt_describe_f("%s\n", subtests[i].desc);
 
-	igt_describe("Tests plane alpha and blending properties with medium alpha value");
-	igt_subtest_f("pipe-%s-constant-alpha-mid", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_mid);
+		igt_subtest_with_dynamic(subtests[i].name) {
+			for_each_pipe(&data->display, pipe) {
+				pipe_check(&data->display, pipe);
+				output = igt_get_single_output_for_pipe(&data->display, pipe);

There is a possibility of (output == NULL), So best option is to use for_each_pipe_with_single_output().

tests/kms_plane_alpha_blend.c static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend, · line 607

Quoted 7 lines
tests/kms_plane_alpha_blend.c +3 -3
-	igt_describe("Tests plane alpha and blending properties with maximum alpha value");
-	igt_subtest_f("pipe-%s-constant-alpha-max", kmstest_pipe_name(pipe))
-		run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_max);
+				igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
+					run_test_on_pipe_planes(data, pipe, output, subtests[i].blend,
+								subtests[i].must_multiply, subtests[i].test);

There are few igt_require*() inside run_test_on_pipe_planes(). Those should be moved to outside (Just before calling igt_dynamic*()).

Also, as these are plane tests, we don't need to prepare the crtc for each plane. So we need some cleanup to optimize this logic.

for_each_plane() {
prepare_crtc();
test();
}

prepare_crtc();
for_each_plane() {
test();
}

- Bhanu

Quoted 23 lines
tests/kms_plane_alpha_blend.c +4 -4
+			}
+		}
+	}
  }
 
  igt_main
  {
  	data_t data = {};
-	enum pipe pipe;
 
  	igt_fixture {
  		data.gfx_fd = drm_open_driver_master(DRIVER_ANY);
@@ -576,9 +621,7 @@ igt_main
  		igt_require(data.display.is_atomic);
  	}
 
-	for_each_pipe_static(pipe)
-		igt_subtest_group
-			run_subtests(&data, pipe);
+	run_subtests(&data);
 
  	igt_fixture {
  		igt_display_reset(&data.display);
#3 lore raw
Quoted 121 lines · Bhanuprakash
Quoted 120 lines · Karthik B S

Covert the existing subtests to dynamic subtests at pipe/output level.

---
  tests/kms_plane_alpha_blend.c | 149 ++++++++++++++++++++++------------

  1 file changed, 96 insertions(+), 53 deletions(-)
tests/kms_plane_alpha_blend.c +2 -2
index bd064d1e..3e7ac7ec 100644
@@ -466,12 +466,11 @@ static void coverage_premult_constant(data_t 
 *data, enum pipe pipe, igt_plane_t
       igt_pipe_crc_stop(data->pipe_crc);
   }
   -static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, bool blend,
-                    bool must_multiply,
+static void run_test_on_pipe_planes(data_t *data, enum pipe pipe, 
 igt_output_t *output,
+                    bool blend, bool must_multiply,
                       void(*test)(data_t *, enum pipe, igt_plane_t *))
   {
       igt_display_t *display = &data->display;
-    igt_output_t *output = igt_get_single_output_for_pipe(display, 
 pipe);

      igt_plane_t *plane;
      bool found = false;
      bool multiply = false;

tests/kms_plane_alpha_blend.c +18 -0
@@ -506,68 +505,114 @@ static void run_test_on_pipe_planes(data_t 
 *data, enum pipe pipe, bool blend,
       igt_require_f(multiply, "Multiplied (plane x pixel) alpha not available\n");
   }
   -static void run_subtests(data_t *data, enum pipe pipe)
+static const struct {
+    const char *name;
+    void (*test)(data_t *, enum pipe, igt_plane_t *);
+    bool blend;
+    bool must_multiply;
+    const char *desc;
+} subtests[] = {
+    { .name = "alpha-basic",
+      .test = basic_alpha,
+      .blend = false,
+      .must_multiply = true,
+      .desc = "Tests basic plane alpha properties.",
+    },
+    { .name = "alpha-7efc",
+      .test = alpha_7efc,
+      .blend = false,
+      .must_multiply = true,
+      .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha 

and "
+          "plane_alpha are swappable on pre-multiplied blend mode.", +    },
+    { .name = "coverage-7efc",
+      .test = coverage_7efc,
+      .blend = true,
+      .must_multiply = true,
+      .desc = "Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+          "plane_alpha are swappable on coverage blend mode.", +    },
+    { .name = "coverage-vs-premult-vs-constant",
+      .test = coverage_premult_constant,
+      .blend = true,
+      .must_multiply = false,
+      .desc = "Tests pipe coverage blending properties.", +    },
+    { .name = "alpha-transparent-fb",
+      .test = argb_transparent,
+      .blend = false,
+      .must_multiply = false,
+      .desc = "Tests the alpha property with transparent fb.", +    },
+    { .name = "alpha-opaque-fb",
+      .test = argb_opaque,
+      .blend = false,
+      .must_multiply = false,
+      .desc = "Tests alpha properties with opaque fb.",
+    },
+    { .name = "constant-alpha-min",
+      .test = constant_alpha_min,
+      .blend = true,
+      .must_multiply = false,
+      .desc = "Tests plane alpha and blending properties with minimum alpha value.",
+    },
+    { .name = "constant-alpha-mid",
+      .test = constant_alpha_mid,
+      .blend = true,
+      .must_multiply = false,
+      .desc = "Tests plane alpha and blending properties with medium alpha value.",
+    },
+    { .name = "constant-alpha-max",
+      .test = constant_alpha_max,
+      .blend = true,
+      .must_multiply = false,
+      .desc = "Tests plane alpha and blending properties with maximum alpha value.",
+    },

tests/kms_plane_alpha_blend.c +3 -0
+};
+
+static void pipe_check(igt_display_t *display, enum pipe pipe)

  {
-    igt_fixture {
-        bool found = false;
-        igt_plane_t *plane;
-
- igt_display_require_output_on_pipe(&data->display, pipe); -        for_each_plane_on_pipe(&data->display, pipe, plane) { -            if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA)) -                continue;
+    bool found = false;
+    igt_plane_t *plane;
  -            found = true;
-            break;
-        }
+    igt_display_require_output_on_pipe(display, pipe); +    for_each_plane_on_pipe(display, pipe, plane) {

Quoted 8 lines
Quoted 6 lines

+        if (!igt_plane_has_prop(plane, IGT_PLANE_ALPHA))
+            continue;
  -        igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n", -                  kmstest_pipe_name(pipe));
+        found = true;
+        break;

Let's make this function as bool & return true if we found a valid plane else false. And execute igt_dynamic() based on this return value.

Hi,

Thank you for the review. Sure, will update this.

Quoted 50 lines
Quoted 50 lines

      }
  -    igt_describe("Tests basic plane alpha properties.");
-    igt_subtest_f("pipe-%s-alpha-basic", kmstest_pipe_name(pipe)) -        run_test_on_pipe_planes(data, pipe, false, true, basic_alpha); +    igt_require_f(found, "Found no plane on pipe %s with alpha blending supported\n",
+              kmstest_pipe_name(pipe));
  -    igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and " -             "plane_alpha are swappable on pre-multiplied blend mode.");
-    igt_subtest_f("pipe-%s-alpha-7efc", kmstest_pipe_name(pipe)) -        run_test_on_pipe_planes(data, pipe, false, true, alpha_7efc); -
-    igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
-             "plane_alpha are swappable on coverage blend mode."); -    igt_subtest_f("pipe-%s-coverage-7efc", kmstest_pipe_name(pipe)) -        run_test_on_pipe_planes(data, pipe, true, true, coverage_7efc); -
-    igt_describe("Tests pipe coverage blending properties.");
-    igt_subtest_f("pipe-%s-coverage-vs-premult-vs-constant", kmstest_pipe_name(pipe))
-        run_test_on_pipe_planes(data, pipe, true, false, coverage_premult_constant);
-
-    igt_describe("Tests the alpha property with transparent fb."); -    igt_subtest_f("pipe-%s-alpha-transparent-fb", kmstest_pipe_name(pipe))
-        run_test_on_pipe_planes(data, pipe, false, false, argb_transparent);
+}
  -    igt_describe("Tests alpha properties with opaque fb.");
-    igt_subtest_f("pipe-%s-alpha-opaque-fb", kmstest_pipe_name(pipe)) -        run_test_on_pipe_planes(data, pipe, false, false, argb_opaque);

tests/kms_plane_alpha_blend.c +4 -0
+static void run_subtests(data_t *data)
+{
+    igt_output_t *output;
+    enum pipe pipe;

  -    igt_describe("Tests plane alpha and blending properties with minimum alpha value."); -    igt_subtest_f("pipe-%s-constant-alpha-min",
kmstest_pipe_name(pipe))
-        run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_min);
+    for (int i = 0; i < ARRAY_SIZE(subtests); i++) {
+        igt_describe_f("%s\n", subtests[i].desc);
  -    igt_describe("Tests plane alpha and blending properties with medium alpha value"); -    igt_subtest_f("pipe-%s-constant-alpha-mid",
kmstest_pipe_name(pipe))
-        run_test_on_pipe_planes(data, pipe, true, false,

Quoted 8 lines
Quoted 6 lines

constant_alpha_mid);
+        igt_subtest_with_dynamic(subtests[i].name) { +            for_each_pipe(&data->display, pipe) { +                pipe_check(&data->display, pipe); +                output = igt_get_single_output_for_pipe(&data->display, pipe);

There is a possibility of (output == NULL), So best option is to use for_each_pipe_with_single_output().

Sure, will update this.

Quoted 13 lines
Quoted 12 lines

  -    igt_describe("Tests plane alpha and blending properties with maximum alpha value"); -    igt_subtest_f("pipe-%s-constant-alpha-max",
kmstest_pipe_name(pipe))
-        run_test_on_pipe_planes(data, pipe, true, false, constant_alpha_max);
+                igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
+                    run_test_on_pipe_planes(data, pipe, output, subtests[i].blend,
+                                subtests[i].must_multiply, subtests[i].test);

Quoted 2 lines

There are few igt_require*() inside run_test_on_pipe_planes(). Those should be moved to outside (Just before calling igt_dynamic*()).

Sure, will move this before dynamic and not trigger the dynamic subtest if requirement is not met.

Quoted 8 lines

Also, as these are plane tests, we don't need to prepare the crtc for each plane. So we need some cleanup to optimize this logic.

for_each_plane() {
  prepare_crtc();
  test();
}

Quoted 4 lines

prepare_crtc();
for_each_plane() {
  test();
}

Agreed, will update this.

Thanks,
Karthik.B.S

Quoted 23 lines

- Bhanu

Quoted 19 lines

+            }
+        }
+    }
  }
    igt_main
  {
      data_t data = {};
-    enum pipe pipe;
        igt_fixture {
          data.gfx_fd = drm_open_driver_master(DRIVER_ANY);

tests/kms_plane_alpha_blend.c +1 -2
@@ -576,9 +621,7 @@ igt_main
           igt_require(data.display.is_atomic);
       }
   -    for_each_pipe_static(pipe)
-        igt_subtest_group
-            run_subtests(&data, pipe);
+    run_subtests(&data);
         igt_fixture {
           igt_display_reset(&data.display);