Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <vitaly.prosyak@amd.com>
To: <igt-dev@lists.freedesktop.org>
Cc: "Vitaly Prosyak" <vitaly.prosyak@amd.com>,
	"Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Jesse Zhang" <jesse.zhang@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Krzysztof Karas" <krzysztof.karas@intel.com>
Subject: [PATCH 5/7] lib/igt_core: Enable automatic platform filtering in subtest execution
Date: Fri, 3 Jul 2026 10:08:25 -0400	[thread overview]
Message-ID: <20260703141115.69015-5-vitaly.prosyak@amd.com> (raw)
In-Reply-To: <20260703141115.69015-1-vitaly.prosyak@amd.com>

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

Integrate platform filtering into the IGT framework by adding automatic
checks in __igt_run_subtest() before each subtest executes.

How automatic filtering works:
- If platform filtering initialized (via vendor platform_filter_init),
  automatically check each subtest before execution
- If subtest matches skip rule, print SKIP with reason and source
- If not initialized, behave as before (backward compatible)

This eliminates the need for manual igt_platform_require() calls in
every subtest. Tests only need to call platform_filter_init() once
in igt_fixture() to enable automatic filtering for all subtests.

Skip messages show the filtering source for debugging:
  Platform filtering (config): SWDEV-12345 - Known issue

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>
Cc: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
---
 lib/igt_core.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index a7c097d9e..d2a6d79f5 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"
@@ -1580,6 +1581,23 @@ 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.54.0


  parent reply	other threads:[~2026-07-03 14:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 14:08 [PATCH 1/7] lib: Add vendor-agnostic platform filtering interface vitaly.prosyak
2026-07-03 14:08 ` [PATCH 2/7] lib: Implement generic platform filtering framework vitaly.prosyak
2026-07-03 14:08 ` [PATCH 3/7] lib/amdgpu: Add AMD platform filtering backend vitaly.prosyak
2026-07-03 14:08 ` [PATCH 4/7] lib: Add platform filter initialization check for automatic filtering vitaly.prosyak
2026-07-03 14:08 ` vitaly.prosyak [this message]
2026-07-03 14:08 ` [PATCH 6/7] docs: Add comprehensive platform filtering documentation vitaly.prosyak
2026-07-03 14:08 ` [PATCH 7/7] tests/amdgpu: Integrate platform filtering into amd_basic vitaly.prosyak
2026-07-03 15:42 ` ✓ Xe.CI.BAT: success for series starting with [1/7] lib: Add vendor-agnostic platform filtering interface Patchwork
2026-07-03 15:59 ` ✓ i915.CI.BAT: " Patchwork
2026-07-04  2:47 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-04  7:04 ` ✗ i915.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-06-30  3:23 [PATCH 1/7] " vitaly.prosyak
2026-06-30  3:23 ` [PATCH 5/7] 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=20260703141115.69015-5-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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox