From: Raag Jadav <raag.jadav@intel.com>
To: lucas.demarchi@intel.com, rodrigo.vivi@intel.com,
matthew.d.roper@intel.com
Cc: igt-dev@lists.freedesktop.org, anshuman.gupta@intel.com,
badal.nilawar@intel.com, riana.tauro@intel.com,
Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH i-g-t v1] tests/intel/xe_gt_freq: Use spinner for throttle test
Date: Mon, 3 Mar 2025 15:27:12 +0530 [thread overview]
Message-ID: <20250303095712.274097-1-raag.jadav@intel.com> (raw)
Since throttling requires running workload on GPU, make use of spinner
to get consistent results from throttle API test.
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
tests/intel/xe_gt_freq.c | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/tests/intel/xe_gt_freq.c b/tests/intel/xe_gt_freq.c
index 1fb6d2b53..b501c62db 100644
--- a/tests/intel/xe_gt_freq.c
+++ b/tests/intel/xe_gt_freq.c
@@ -36,6 +36,12 @@
*/
#define SLPC_FREQ_LATENCY_US 100000
+enum spin_test {
+ SPIN_THROTTLE,
+ SPIN_FIXED_FREQ,
+ SPIN_RANGE_FREQ,
+};
+
static int set_freq(int fd, int gt_id, const char *freq_name, uint32_t freq)
{
int ret = -EAGAIN;
@@ -352,7 +358,7 @@ static void test_reset(int fd, int gt_id, int cycles)
}
}
-static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, bool fixed)
+static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, enum spin_test test)
{
struct drm_xe_sync sync[2] = {
{ .type = DRM_XE_SYNC_TYPE_SYNCOBJ, .flags = DRM_XE_SYNC_FLAG_SIGNAL, },
@@ -406,10 +412,17 @@ static void test_spin(int fd, struct drm_xe_engine_class_instance *eci, bool fix
igt_info("Running on GT %d Engine %s:%d\n", eci->gt_id,
xe_engine_class_string(eci->engine_class), eci->engine_instance);
- if (fixed)
+ switch (test) {
+ case SPIN_THROTTLE:
+ test_throttle_basic_api(fd, eci->gt_id);
+ break;
+ case SPIN_FIXED_FREQ:
test_freq_fixed(fd, eci->gt_id, false);
- else
+ break;
+ case SPIN_RANGE_FREQ:
test_freq_range(fd, eci->gt_id, false);
+ break;
+ };
xe_spin_end(spin);
@@ -454,8 +467,13 @@ igt_main
}
igt_subtest("throttle_basic_api") {
- xe_for_each_gt(fd, gt)
- test_throttle_basic_api(fd, gt);
+ xe_for_each_gt(fd, gt) {
+ xe_for_each_engine(fd, hwe) {
+ if (hwe->gt_id != gt)
+ continue;
+ test_spin(fd, hwe, SPIN_THROTTLE);
+ }
+ }
}
igt_subtest("freq_basic_api") {
@@ -476,7 +494,7 @@ igt_main
xe_for_each_engine(fd, hwe) {
if (hwe->gt_id != gt)
continue;
- test_spin(fd, hwe, true);
+ test_spin(fd, hwe, SPIN_FIXED_FREQ);
}
}
}
@@ -494,7 +512,7 @@ igt_main
xe_for_each_engine(fd, hwe) {
if (hwe->gt_id != gt)
continue;
- test_spin(fd, hwe, false);
+ test_spin(fd, hwe, SPIN_RANGE_FREQ);
}
}
}
--
2.34.1
next reply other threads:[~2025-03-03 9:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 9:57 Raag Jadav [this message]
2025-03-03 17:39 ` [PATCH i-g-t v1] tests/intel/xe_gt_freq: Use spinner for throttle test Rodrigo Vivi
2025-03-03 19:08 ` Raag Jadav
2025-03-03 21:58 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-03-03 22:19 ` ✗ i915.CI.BAT: failure " Patchwork
2025-03-04 1:15 ` ✗ Xe.CI.Full: " Patchwork
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=20250303095712.274097-1-raag.jadav@intel.com \
--to=raag.jadav@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=badal.nilawar@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@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