All of lore.kernel.org
 help / color / mirror / Atom feed
From: <vitaly.prosyak@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: <kamil.konieczny@linux.intel.com>, <pawel.sikora@intel.com>,
	<jani.nikula@linux.intel.com>, <jesse.zhang@amd.com>,
	<christian.koenig@amd.com>, <alexander.deucher@amd.com>,
	Vitaly Prosyak <vitaly.prosyak@amd.com>,
	Krzysztof Karas <krzysztof.karas@intel.com>
Subject: [PATCH v5 3/4] lib/igt_core: Enable automatic platform filtering in subtest execution
Date: Wed, 5 Aug 2026 16:35:28 -0400	[thread overview]
Message-ID: <20260805203608.148375-4-vitaly.prosyak@amd.com> (raw)
In-Reply-To: <20260805203608.148375-1-vitaly.prosyak@amd.com>

From: Vitaly Prosyak <vitaly.prosyak@amd.com>

Hook platform filtering into __igt_run_subtest() so tests automatically
skip subtests based on platform rules without requiring manual
igt_platform_require() calls in each subtest.

This means tests only need to call platform_filter_init() once in their
igt_fixture, and all subtests are automatically checked against the
platform filtering rules before execution.

Example test code:
  igt_fixture {
      amd_platform_filter_init(&gpu_info);
  }

  igt_subtest(my-test) {
      // Automatic skip if platform rules match - no manual call needed!
      test_code();
  }

v3 changes:
 - This is now patch 4/6 (was 5/7 in v2) due to squashing of patches 1+2
   per Kamil Konieczny's review feedback
 - No code changes from v2

Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jesse Zhang <jesse.zhang@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
---
 lib/igt_core.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index a7c097d9e..60a432888 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -80,6 +80,7 @@
 #include "igt_rc.h"
 #include "igt_list.h"
 #include "igt_map.h"
+#include "igt_platform_filter.h"
 #include "igt_device_scan.h"
 #include "igt_thread.h"
 #include "igt_vec.h"
@@ -1572,7 +1573,6 @@ bool __igt_run_subtest(const char *subtest_name, const char *file, const int lin
 		return false;
 	}
 
-
 	if (skip_subtests_henceforth) {
 		_subtest_result_message(_SUBTEST_TYPE_NORMAL, subtest_name,
 					skip_subtests_henceforth == SKIP ? "SKIP" : "FAIL",
@@ -1580,6 +1580,22 @@ bool __igt_run_subtest(const char *subtest_name, const char *file, const int lin
 		return false;
 	}
 
+	/* Automatic platform filtering - if initialized, check if subtest should be skipped */
+	if (igt_platform_filter_is_initialized()) {
+		enum skip_source source;
+		const char *reason;
+
+		if (igt_platform_should_skip(igt_test_name(), subtest_name,
+					      &source, &reason)) {
+			_subtest_result_message(_SUBTEST_TYPE_NORMAL, subtest_name,
+						"SKIP", 0.0);
+			igt_info("Platform filtering (%s): %s\n",
+				 source == SKIP_SOURCE_BUILTIN ? "built-in" :
+				 source == SKIP_SOURCE_CONFIG ? "config" : "env",
+				 reason);
+			return false;
+		}
+	}
 	igt_kmsg(KMSG_INFO "%s: starting subtest %s\n",
 		 command_str, subtest_name);
 	igt_trace("%s: starting subtest %s\n", command_str, subtest_name);
-- 
2.43.0


  parent reply	other threads:[~2026-08-05 20:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 20:35 [PATCH v5 0/4] Add platform filtering framework for IGT tests vitaly.prosyak
2026-08-05 20:35 ` [PATCH v5 1/4] lib: Add generic platform filtering framework vitaly.prosyak
2026-08-05 20:35 ` [PATCH v5 2/4] lib/amdgpu: Add AMD platform filtering backend vitaly.prosyak
2026-08-05 20:35 ` vitaly.prosyak [this message]
2026-08-05 20:35 ` [PATCH v5 4/4] docs: Update platform filtering documentation per review feedback vitaly.prosyak
2026-08-06  9:50 ` ✓ i915.CI.BAT: success for Add platform filtering framework for IGT tests (rev2) Patchwork
2026-08-06  9:58 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-06 16:11 ` ✗ i915.CI.Full: failure " Patchwork
2026-08-06 19:27 ` ✓ Xe.CI.FULL: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-08-06  2:36 [PATCH v5 0/4] lib: Add generic platform filtering framework for IGT vitaly.prosyak
2026-08-06  2:36 ` [PATCH v5 3/4] lib/igt_core: Enable automatic platform filtering in subtest execution vitaly.prosyak
2026-08-05 20:28 [PATCH v5 0/4] Add platform filtering framework for IGT tests vitaly.prosyak
2026-08-05 20:28 ` [PATCH v5 3/4] lib/igt_core: Enable automatic platform filtering in subtest execution vitaly.prosyak

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=20260805203608.148375-4-vitaly.prosyak@amd.com \
    --to=vitaly.prosyak@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jesse.zhang@amd.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=pawel.sikora@intel.com \
    /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.