All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nidhi Gupta <nidhi1.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Nidhi Gupta <nidhi1.gupta@intel.com>
Subject: [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic
Date: Fri, 26 Aug 2022 11:14:34 +0530	[thread overview]
Message-ID: <20220826054435.875-2-nidhi1.gupta@intel.com> (raw)
In-Reply-To: <20220826054435.875-1-nidhi1.gupta@intel.com>

Convert the existing subtests to dynamic subtests.

v2: check all per-requisites before starting dynamic
    tests, since to avoid skip in igt_dynamic().
    (Bhanu)

Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/i915/kms_draw_crc.c | 54 ++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 21 deletions(-)

diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
index 33fefed4..48c7d931 100644
--- a/tests/i915/kms_draw_crc.c
+++ b/tests/i915/kms_draw_crc.c
@@ -177,15 +177,6 @@ static void draw_method_subtest(enum igt_draw_method method,
 {
 	igt_crc_t crc;
 
-	igt_skip_on(modifier == I915_FORMAT_MOD_4_TILED &&
-		    !HAS_4TILE(intel_get_drm_devid(drm_fd)));
-
-	igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
-	igt_skip_on(method == IGT_DRAW_MMAP_GTT &&
-		    !gem_has_mappable_ggtt(drm_fd));
-
-	igt_require(format_is_supported(formats[format_index], modifier));
-
 	/* Use IGT_DRAW_MMAP_GTT/WC on an untiled buffer as the parameter for
 	 * comparison. Cache the value so we don't recompute it for every single
 	 * subtest. */
@@ -331,22 +322,43 @@ igt_main
 {
 	enum igt_draw_method method;
 	int format_idx, modifier_idx;
+	uint64_t modifier;
 
 	igt_fixture
 		setup_environment();
 
-	for (format_idx = 0; format_idx < ARRAY_SIZE(formats); format_idx++) {
-	for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) {
-	for (modifier_idx = 0; modifier_idx < ARRAY_SIZE(modifiers); modifier_idx++) {
-		igt_describe("This subtest verfies igt_draw library works "
-			     "with different modifiers, DRM_FORMATS, DRAW_METHODS.");
-		igt_subtest_f("draw-method-%s-%s-%s",
-			      format_str(format_idx),
-			      igt_draw_get_method_name(method),
-			      modifier_str(modifier_idx))
-			draw_method_subtest(method, format_idx,
-					    modifiers[modifier_idx]);
-	} } }
+	igt_describe("This subtest verfies igt_draw library works "
+		     "with different modifiers, DRM_FORMATS, DRAW_METHODS.");
+	igt_subtest_with_dynamic("draw-method") {
+		for (format_idx = 0; format_idx < ARRAY_SIZE(formats); format_idx++) {
+			for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) {
+				for (modifier_idx = 0; modifier_idx < ARRAY_SIZE(modifiers); modifier_idx++) {
+					modifier = modifiers[modifier_idx];
+
+					if (modifier == I915_FORMAT_MOD_4_TILED &&
+					    !HAS_4TILE(intel_get_drm_devid(drm_fd)))
+						continue;
+
+					if (method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd))
+						continue;
+
+					if (method == IGT_DRAW_MMAP_GTT &&
+					    !gem_has_mappable_ggtt(drm_fd))
+						continue;
+
+					if (!format_is_supported(formats[format_idx], modifier))
+						continue;
+
+					igt_dynamic_f("%s-%s-%s",
+						      format_str(format_idx),
+						      igt_draw_get_method_name(method),
+						      modifier_str(modifier_idx))
+						draw_method_subtest(method, format_idx,
+								    modifier);
+				}
+			}
+		}
+	}
 
 	igt_describe("This subtest verifies CRC after filling fb with x-tiling "
 		     "or none.");
-- 
2.36.0

  reply	other threads:[~2022-08-26  5:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  5:44 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-26  5:44 ` Nidhi Gupta [this message]
2022-08-26  5:44 ` [igt-dev] [PATCH 2/2] " Nidhi Gupta
2022-08-26  6:25 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_draw_crc: Test Cleanup (rev9) Patchwork
2022-08-30  7:50 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2022-09-05 11:24 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-09-05 11:24 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-22  9:20 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-22  9:20 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-04  3:40 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-04  3:40 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-18 14:55   ` Juha-Pekka Heikkila
2022-08-03  4:20 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-03  4:20 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-03  7:04   ` Modem, Bhanuprakash
2022-08-03  4:15 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-03  4:15 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-02  6:53 [igt-dev] [PATCH 0/2] tests/i915/kms_draw_crc: Test Cleanup Nidhi Gupta
2022-08-02  6:53 ` [igt-dev] [PATCH 1/2] tests/i915/kms_draw_crc: Convert tests to dynamic Nidhi Gupta
2022-08-02  9:56   ` Modem, Bhanuprakash

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220826054435.875-2-nidhi1.gupta@intel.com \
    --to=nidhi1.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.