[PATCH v4 0/5] Generic platform filtering framework with AMD backend

<[email protected]>
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
From: Vitaly Prosyak <[email protected]>

This series implements a vendor-agnostic platform filtering framework
for IGT, allowing test skipping based on platform characteristics.

Changes in v4 (addressing Krzysztof Karas detailed review of v3):
====================================================================
- Fixed documentation comment placement - ALL moved before functions
- Reorganized commit message for clarity (v4 changes listed first)
- Added prominent note that patch 1/5 is generic (no vendor code)
- Proper [PATCH v4 X/Y] format using git format-patch --subject-prefix
- Addressed process feedback: waited 12 days between v3 and v4

Code quality fixes in v4:
- lib/igt_platform_filter.c: Moved 4 doc comments before functions
  (igt_platform_should_skip, igt_platform_require, 
   igt_platform_filter_dump, igt_platform_filter_dump_to_file)
- All commit messages: Separated "vN changes" from "design rationale"
- Patch 1/5: Added prominent note about generic/vendor-agnostic nature

Changes in v3 (addressing Kamil Konieczny's review):
=====================================================
- Squashed header and implementation into single commit
- Removed "Function prototypes..." comment from header
- Added comprehensive documentation (patch 5/5)
- Automatic filtering via __igt_run_subtest() hook (patch 4/5)
- Fixed code style (SPDX, include order, checkpatch clean)
- Removed unnecessary newlines before single-statement returns

Key features (unchanged since v3):
===================================
- Vendor-agnostic callback-based design (any vendor can plug in)
- Three-tier priority: built-in > config file > env variable
- Automatic filtering via __igt_run_subtest() hook (no manual calls)
- Comprehensive documentation with real-world examples

Design rationale (from original RFC discussion):
=================================================

This implementation addresses feedback from multiple reviewers on the
original RFC patch series.

Jani Nikula requested vendor-agnostic design:
  "I would have expected an attempt to make an IGT shared filtering
   system generic enough to plug into any vendor's platforms."

   Resolution: Implemented platform_filter_ops callback structure
   allowing any vendor (Intel, AMD, Qualcomm, etc.) to provide their
   own backend without modifying core framework.

Kamil Konieczny requested config file as primary method:
  "Add also example with config file as env vars are not convenient
   for large tests lists"

   Resolution: Patch 5/5 documentation shows config file as
   RECOMMENDED method with wildcards, real-world examples, and
   best practices.

Kamil Konieczny requested automatic filtering:
  "imho you can get test name in require, no need to repeat it"

   Resolution: Went further - patch 4/5 adds __igt_run_subtest() hook.
   Tests don't call igt_platform_require() at all - filtering is
   completely automatic. Zero manual calls needed in subtests.

Series structure:
=================
Patch 1/5: Generic framework (vendor-agnostic, NO AMD code)
Patch 2/5: AMD backend implementation (separate from core)
Patch 3/5: Initialization check (safety layer)
Patch 4/5: Automatic filtering hook (__igt_run_subtest)
Patch 5/5: Documentation (config examples, API usage)

Testing:
========
Tested on:
- AMD Navi48 (family_id 0x96, chip_rev 0x02)
- AMD Navi10 (family_id 0x8F, chip_rev 0x00)

All three priority levels verified working.
Automatic filtering verified - no manual calls needed.
checkpatch.pl clean.
No compiler warnings.

Cc: Jani Nikula <[email protected]>
Cc: Kamil Konieczny <[email protected]>
Cc: Krzysztof Karas <[email protected]>
Cc: Jesse Zhang <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>

Vitaly Prosyak (5):
  lib: Add generic platform filtering framework
  lib/amdgpu: Add AMD platform filtering backend
  lib: Add platform filter initialization check for automatic filtering
  lib/igt_core: Enable automatic platform filtering in subtest
    execution
  docs: Update platform filtering documentation per review feedback

 docs/platform_filtering.md    | 245 +++++++++++++++++
 lib/amdgpu/amd_platform.c     | 187 +++++++++++++
 lib/amdgpu/amd_platform.h     |  32 +++
 lib/amdgpu/meson.build        |   2 +
 lib/igt_core.c                |  17 +-
 lib/igt_platform_filter.c     | 565 ++++++++++++++++++++++++++++++++++++++
 lib/igt_platform_filter.h     | 122 ++++++++
 lib/meson.build               |   1 +
 8 files changed, 1170 insertions(+), 1 deletion(-)
 create mode 100644 docs/platform_filtering.md
 create mode 100644 lib/amdgpu/amd_platform.c
 create mode 100644 lib/amdgpu/amd_platform.h
 create mode 100644 lib/igt_platform_filter.c
 create mode 100644 lib/igt_platform_filter.h

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.