home/psoham/UPSTREAM/
Subsystems (2)
If the engine accuracy test is run with other processes using the DRM device, the GPU engine activity may be higher than expected. Which may lead to false positives in the test, even if the engine activity is reported correctly.
To help identify this issue, a check for other processes using the DRM device is provided and a warning message is printed if any such processes are found and the very test is skipped.
Signed-off-by Soham Purkait <[email protected]>
--- tests/intel/xe_pmu.c | 25 +++++++++++++++++++++++++ tests/meson.build | 1 + 2 files changed, 26 insertions(+)
tests/intel/xe_pmu.c +25 -0
@@ -95,6 +95,7 @@*/ #include "igt.h" +#include "igt_drm_clients.h" #include "igt_perf.h" #include "igt_sriov_device.h" #include "igt_sysfs.h"
@@ -507,6 +508,30 @@ static void accuracy(int fd, struct drm_xe_engine_class_instance *eci,uint64_t config, before[2 ], after[2 ];int link[2 ], pmu_fd[2 ];double engine_activity, expected; +unsigned long wait =100000 ; +struct igt_drm_client_proc *procs =NULL ; +int num_clients =0 ; + +/* Wait for other processes using the DRM device ends */ +for (int pass =0 ; pass <50 ; pass++) { +if (!igt_drm_get_client_procs (fd,getpid (),NULL )) +break ; +usleep (wait); + } + + num_clients =igt_drm_get_client_procs (fd,getpid (), &procs); + +/* Check if still any process is using the DRM device */ +if (num_clients) { +for (unsigned int i =0 ; i < num_clients; i++) { +igt_warn ("%s (pid=%u client=%lu) is using DRM device.\n" , + procs[i].print_name, procs[i].pid, procs[i].id); + } +free (procs); + procs =NULL ; +igt_skip ("As other processes are using the DRM device, " +"cannot ensure the reliability of this test.\n" ); + } cycle_us = min_test_us / target_iter; active_us = cycle_us * target_percentage /100 ;
tests/meson.build +1 -0
@@ -422,6 +422,7 @@ extra_dependencies = { 'sw_sync': [ libatomic ], 'xe_fault_injection': [ lib_igt_xe_oa ], 'xe_oa': [ lib_igt_xe_oa ], + 'xe_pmu': [ lib_igt_drm_clients ], 'xe_compute': [ igt_deps,lib_igt_perf,lib_igt_profiling,math ], }
Signature · 12 lines
2.43.0
home/psoham/UPSTREAM/v1-0003-HAX-Add-engine-accuracy-tests-to-xe-fast-feedback.patch 0000664 0001750 0001750 00000001720 15162511175 027040 0 ustar psoham psoham From 45d3e5f0c0b46007fb6ac9fb6149328927f8eb1b Mon Sep 17 00:00:00 2001
From: Soham Purkait <[email protected]>
Date: Mon, 16 Mar 2026 14:51:32 +0530
Subject: [PATCH i-g-t v1 3/3] HAX: Add engine accuracy tests to
xe-fast-feedback.testlist
Signed-off-by: Soham Purkait <[email protected]>
---
tests/intel-ci/xe.fast-feedback.testlist | 3 +++
1 file changed, 3 insertions(+)tests/intel-ci/xe.fast-feedback.testlist +3 -0
@@ -163,6 +163,9 @@ igt@xe_mmap@cpu-caching igt@xe_mmap@system igt@xe_mmap@vram igt@xe_mmap@vram-system +igt@xe_pmu@engine-activity-accuracy-2 +igt@xe_pmu@engine-activity-accuracy-50 +igt@xe_pmu@engine-activity-accuracy-90 igt@xe_pm_residency@gt-c6-on-idle igt@xe_prime_self_import@basic-with_one_bo igt@xe_prime_self_import@basic-with_fd_dup
Signature · 21 lines
2.43.0
home/psoham/UPSTREAM/v1-0001-lib-igt_drm_clients-Add-helper-to-list-and-count-.patch 0000664 0001750 0001750 00000007705 15162511175 027250 0 ustar psoham psoham From f8bf09da6e3d9474ff1d7ef0159fcd8667627eba Mon Sep 17 00:00:00 2001
From: Soham Purkait <[email protected]>
Date: Mon, 30 Mar 2026 16:49:38 +0530
Subject: [PATCH i-g-t v1 1/3] lib/igt_drm_clients: Add helper to list and
count the DRM client processes
Add a helper that scans all DRM clients for a card fd, optionally
populating a list of client processes as an array of
struct igt_drm_client_proc, and always returns the count of client
processes excluding the caller process.
This allows callers (like tests) to find other DRM clients which are
using the card.
Signed-off-by: Soham Purkait <[email protected]>
---
lib/igt_drm_clients.c | 93 +++++++++++++++++++++++++++++++++++++++++++
lib/igt_drm_clients.h | 10 +++++
2 files changed, 103 insertions(+)lib/igt_drm_clients.c +93 -0
96 lines not on this page · raw message
lib/igt_drm_clients.h +10 -0
@@ -54,6 +54,12 @@ struct igt_drm_client_regions {char **names;/* Array of region names, either auto-detected or from the passed in region map. */ }; +struct igt_drm_client_proc { +unsigned int pid; +unsigned long id; +char print_name[64 ]; +}; +struct igt_drm_clients ;struct igt_drm_client {
@@ -119,4 +125,8 @@ struct igt_drm_clients * igt_drm_clients_sort(struct igt_drm_clients *clients, int (*cmp)(const void *, const void *, void *)); +int igt_drm_get_client_procs (int card_fd, +pid_t self_pid, +struct igt_drm_client_proc **procs); +#endif /* IGT_DRM_CLIENTS_H */
Signature · 34 lines
2.43.0
home/psoham/UPSTREAM/v1-0000-cover-letter.patch 0000664 0001750 0001750 00000002444 15162512676 020453 0 ustar psoham psoham From 45d3e5f0c0b46007fb6ac9fb6149328927f8eb1b Mon Sep 17 00:00:00 2001
From: Soham Purkait <[email protected]>
Date: Mon, 30 Mar 2026 20:40:53 +0530
Subject: [PATCH i-g-t v1 0/3] tests/intel/xe_pmu: Guard engine accuracy tests against busy DRM clients
The engine-activity accuracy subtests are sensitive to unrelated
DRM clients on the same card. When other processes keep the device busy,
the measured engine activity can be higher than expected and trigger
false failures.
This series improves the robustness of the subtest by first introducing
a helper to enumerate DRM client processes associated with a given card
fd, and subsequently using it in engine accuracy tests to detect competing
clients triggering a warning, and skipping the test.
Soham Purkait (3):
lib/igt_drm_clients: Add helper to list and count the DRM client
processes
tests/intel/xe_pmu: Check if other processes are using the DRM device
HAX: Add engine accuracy tests to xe-fast-feedback.testlist
lib/igt_drm_clients.c | 93 ++++++++++++++++++++++++
lib/igt_drm_clients.h | 10 +++
tests/intel-ci/xe.fast-feedback.testlist | 3 +
tests/intel/xe_pmu.c | 25 +++++++
tests/meson.build | 1 +
5 files changed, 132 insertions(+)
--
2.43.0