* [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state
@ 2023-07-19 14:46 Badal Nilawar
2023-07-19 15:49 ` [igt-dev] ○ CI.xeBAT: info for tests/xe: Verify actual frequency on the basis of GT state (rev4) Patchwork
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Badal Nilawar @ 2023-07-19 14:46 UTC (permalink / raw)
To: igt-dev
When GT is in RC6 actual frequency reported will be 0. So verify actual
on the basic of GT state.
v2:
- Rebased
- Move function xe_is_gt_in_c6, to check rc6 state, to igt_pm library
- Assert if freq reported is not 0 when idle (Ashutosh)
v3:
- Fix review comments (Ashutosh)
v4:
- Move igt_require to igt_main under idle test cases (Ashutosh)
- For idle case wait for C6 instead of usleep (Ashutosh)
v5:
- Remove igt_require from test_freq_range
Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests")
Signed-off-by: Badal Nilawar <badal.nilawar@intel.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
lib/igt_pm.c | 20 +++++++++++++++++
lib/igt_pm.h | 1 +
tests/xe/xe_guc_pc.c | 46 +++++++++++++++++++++++++++++---------
tests/xe/xe_pm_residency.c | 38 ++++++++++---------------------
4 files changed, 69 insertions(+), 36 deletions(-)
diff --git a/lib/igt_pm.c b/lib/igt_pm.c
index ba591f0f8..ccfa5178b 100644
--- a/lib/igt_pm.c
+++ b/lib/igt_pm.c
@@ -1417,3 +1417,23 @@ void igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val)
igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq"));
igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val);
}
+
+/**
+ * xe_is_gt_in_c6:
+ * @fd: pointer to xe drm fd
+ * @gt: gt number
+ *
+ * Check if GT is in C6 state
+ */
+bool xe_is_gt_in_c6(int fd, int gt)
+{
+ char gt_c_state[16];
+ int gt_fd;
+
+ gt_fd = xe_sysfs_gt_open(fd, gt);
+ igt_assert(gt_fd >= 0);
+ igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", gt_c_state) == 1);
+ close(gt_fd);
+
+ return strcmp(gt_c_state, "gt-c6") == 0;
+}
diff --git a/lib/igt_pm.h b/lib/igt_pm.h
index 71ec2f239..2fc7b98a1 100644
--- a/lib/igt_pm.h
+++ b/lib/igt_pm.h
@@ -89,5 +89,6 @@ bool i915_is_slpc_enabled(int drm_fd);
int igt_pm_get_runtime_suspended_time(struct pci_device *pci_dev);
int igt_pm_get_runtime_usage(struct pci_device *pci_dev);
void igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val);
+bool xe_is_gt_in_c6(int fd, int gt);
#endif /* IGT_PM_H */
diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c
index c34df8d60..d55790afd 100644
--- a/tests/xe/xe_guc_pc.c
+++ b/tests/xe/xe_guc_pc.c
@@ -218,7 +218,7 @@ static void test_freq_basic_api(int fd, int gt_id)
* Run type: FULL
*/
-static void test_freq_fixed(int fd, int gt_id)
+static void test_freq_fixed(int fd, int gt_id, bool gt_idle)
{
uint32_t rpn = get_freq(fd, gt_id, "rpn");
uint32_t rpe = get_freq(fd, gt_id, "rpe");
@@ -235,13 +235,26 @@ static void test_freq_fixed(int fd, int gt_id)
igt_assert(set_freq(fd, gt_id, "max", rpn) > 0);
usleep(ACT_FREQ_LATENCY_US);
igt_assert(get_freq(fd, gt_id, "cur") == rpn);
- igt_assert(get_freq(fd, gt_id, "act") == rpn);
+
+ if (gt_idle) {
+ /* Wait for GT to go in C6 as previous get_freq wakes up GT*/
+ igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10));
+ igt_assert(get_freq(fd, gt_id, "act") == 0);
+ } else {
+ igt_assert(get_freq(fd, gt_id, "act") == rpn);
+ }
igt_assert(set_freq(fd, gt_id, "min", rpe) > 0);
igt_assert(set_freq(fd, gt_id, "max", rpe) > 0);
usleep(ACT_FREQ_LATENCY_US);
igt_assert(get_freq(fd, gt_id, "cur") == rpe);
- igt_assert(get_freq(fd, gt_id, "act") == rpe);
+
+ if (gt_idle) {
+ igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10));
+ igt_assert(get_freq(fd, gt_id, "act") == 0);
+ } else {
+ igt_assert(get_freq(fd, gt_id, "act") == rpe);
+ }
igt_assert(set_freq(fd, gt_id, "min", rp0) > 0);
igt_assert(set_freq(fd, gt_id, "max", rp0) > 0);
@@ -253,6 +266,11 @@ static void test_freq_fixed(int fd, int gt_id)
*/
igt_assert(get_freq(fd, gt_id, "cur") == rp0);
+ if (gt_idle) {
+ igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10));
+ igt_assert(get_freq(fd, gt_id, "act") == 0);
+ }
+
igt_debug("Finished testing fixed request\n");
}
@@ -266,7 +284,7 @@ static void test_freq_fixed(int fd, int gt_id)
* Run type: FULL
*/
-static void test_freq_range(int fd, int gt_id)
+static void test_freq_range(int fd, int gt_id, bool gt_idle)
{
uint32_t rpn = get_freq(fd, gt_id, "rpn");
uint32_t rpe = get_freq(fd, gt_id, "rpe");
@@ -279,8 +297,14 @@ static void test_freq_range(int fd, int gt_id)
usleep(ACT_FREQ_LATENCY_US);
cur = get_freq(fd, gt_id, "cur");
igt_assert(rpn <= cur && cur <= rpe);
- act = get_freq(fd, gt_id, "act");
- igt_assert(rpn <= act && act <= rpe);
+
+ if (gt_idle) {
+ igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10));
+ igt_assert(get_freq(fd, gt_id, "act") == 0);
+ } else {
+ act = get_freq(fd, gt_id, "act");
+ igt_assert(rpn <= act && act <= rpe);
+ }
igt_debug("Finished testing range request\n");
}
@@ -385,7 +409,8 @@ igt_main
igt_subtest("freq_fixed_idle") {
xe_for_each_gt(fd, gt) {
- test_freq_fixed(fd, gt);
+ igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 10));
+ test_freq_fixed(fd, gt, true);
}
}
@@ -398,14 +423,15 @@ igt_main
igt_debug("Execution Finished\n");
}
/* While exec in threads above, let's check the freq */
- test_freq_fixed(fd, gt);
+ test_freq_fixed(fd, gt, false);
igt_waitchildren();
}
}
igt_subtest("freq_range_idle") {
xe_for_each_gt(fd, gt) {
- test_freq_range(fd, gt);
+ igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 10));
+ test_freq_range(fd, gt, true);
}
}
@@ -418,7 +444,7 @@ igt_main
igt_debug("Execution Finished\n");
}
/* While exec in threads above, let's check the freq */
- test_freq_range(fd, gt);
+ test_freq_range(fd, gt, false);
igt_waitchildren();
}
}
diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c
index a20c4449c..5c4516d03 100644
--- a/tests/xe/xe_pm_residency.c
+++ b/tests/xe/xe_pm_residency.c
@@ -28,6 +28,16 @@ const double tolerance = 0.1;
(tol) * 100.0, (tol) * 100.0, \
(double)(ref))
+/**
+ * SUBTEST: gt-c6-on-idle
+ * Description: Validate GT C6 state on idle
+ * Run type: BAT
+ *
+ * SUBTEST: idle-residency
+ * Description: basic residency test to validate idle residency
+ * measured over a time interval is within the tolerance
+ * Run type: FULL
+ */
IGT_TEST_DESCRIPTION("Tests for gtidle properties");
static unsigned int measured_usleep(unsigned int usec)
@@ -45,24 +55,6 @@ static unsigned int measured_usleep(unsigned int usec)
return igt_nsec_elapsed(&ts) / 1000;
}
-/**
- * SUBTEST: gt-c6-on-idle
- * Description: Validate GT C6 state on idle
- * Run type: BAT
- */
-static bool is_gt_in_c6(int fd, int gt)
-{
- char gt_c_state[16];
- int gt_fd;
-
- gt_fd = xe_sysfs_gt_open(fd, gt);
- igt_assert(gt_fd >= 0);
- igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", gt_c_state) == 1);
- close(gt_fd);
-
- return strcmp(gt_c_state, "gt-c6") == 0;
-}
-
static unsigned long read_idle_residency(int fd, int gt)
{
unsigned long residency = 0;
@@ -76,17 +68,11 @@ static unsigned long read_idle_residency(int fd, int gt)
return residency;
}
-/**
- * SUBTEST: idle-residency
- * Description: basic residency test to validate idle residency
- * measured over a time interval is within the tolerance
- * Run type: FULL
- */
static void test_idle_residency(int fd, int gt)
{
unsigned long elapsed_ms, residency_start, residency_end;
- igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n");
+ igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n");
residency_start = read_idle_residency(fd, gt);
elapsed_ms = measured_usleep(SLEEP_DURATION * 1000) / 1000;
@@ -110,7 +96,7 @@ igt_main
igt_describe("Validate GT C6 on idle");
igt_subtest("gt-c6-on-idle")
xe_for_each_gt(fd, gt)
- igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n");
+ igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n");
igt_describe("Validate idle residency measured over a time interval is within the tolerance");
igt_subtest("idle-residency")
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [igt-dev] ○ CI.xeBAT: info for tests/xe: Verify actual frequency on the basis of GT state (rev4) 2023-07-19 14:46 [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Badal Nilawar @ 2023-07-19 15:49 ` Patchwork 2023-07-19 15:54 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork 2023-07-20 7:59 ` [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Gupta, Anshuman 2 siblings, 0 replies; 6+ messages in thread From: Patchwork @ 2023-07-19 15:49 UTC (permalink / raw) To: Badal Nilawar; +Cc: igt-dev [-- Attachment #1: Type: text/plain, Size: 363 bytes --] == Series Details == Series: tests/xe: Verify actual frequency on the basis of GT state (rev4) URL : https://patchwork.freedesktop.org/series/120831/ State : info == Summary == Participating hosts: bat-pvc-2 bat-atsm-2 bat-dg2-oem2 bat-adlp-7 Missing hosts results[0]: Results: [IGTPW_9433](https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_9433/index.html) [-- Attachment #2: Type: text/html, Size: 879 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for tests/xe: Verify actual frequency on the basis of GT state (rev4) 2023-07-19 14:46 [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Badal Nilawar 2023-07-19 15:49 ` [igt-dev] ○ CI.xeBAT: info for tests/xe: Verify actual frequency on the basis of GT state (rev4) Patchwork @ 2023-07-19 15:54 ` Patchwork 2023-07-20 7:59 ` [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Gupta, Anshuman 2 siblings, 0 replies; 6+ messages in thread From: Patchwork @ 2023-07-19 15:54 UTC (permalink / raw) To: Badal Nilawar; +Cc: igt-dev [-- Attachment #1: Type: text/plain, Size: 12194 bytes --] == Series Details == Series: tests/xe: Verify actual frequency on the basis of GT state (rev4) URL : https://patchwork.freedesktop.org/series/120831/ State : failure == Summary == CI Bug Log - changes from CI_DRM_13396 -> IGTPW_9433 ==================================================== Summary ------- **FAILURE** Serious unknown changes coming with IGTPW_9433 absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_9433, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI. External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/index.html Participating hosts (42 -> 43) ------------------------------ Additional (2): fi-kbl-soraka bat-rpls-2 Missing (1): fi-snb-2520m Possible new issues ------------------- Here are the unknown changes that may have been introduced in IGTPW_9433: ### IGT changes ### #### Possible regressions #### * igt@debugfs_test@read_all_entries: - bat-mtlp-6: [PASS][1] -> [DMESG-WARN][2] [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/bat-mtlp-6/igt@debugfs_test@read_all_entries.html [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-mtlp-6/igt@debugfs_test@read_all_entries.html Known issues ------------ Here are the changes found in IGTPW_9433 that come from known issues: ### IGT changes ### #### Issues hit #### * igt@debugfs_test@basic-hwmon: - bat-rpls-2: NOTRUN -> [SKIP][3] ([i915#7456]) [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@debugfs_test@basic-hwmon.html * igt@fbdev@info: - bat-rpls-2: NOTRUN -> [SKIP][4] ([i915#1849] / [i915#2582]) [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@fbdev@info.html * igt@fbdev@read: - bat-rpls-2: NOTRUN -> [SKIP][5] ([i915#2582]) +3 similar issues [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@fbdev@read.html * igt@gem_huc_copy@huc-copy: - fi-kbl-soraka: NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#2190]) [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html * igt@gem_lmem_swapping@basic: - fi-kbl-soraka: NOTRUN -> [SKIP][7] ([fdo#109271] / [i915#4613]) +3 similar issues [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html * igt@gem_lmem_swapping@verify-random: - bat-rpls-2: NOTRUN -> [SKIP][8] ([i915#4613]) +3 similar issues [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@gem_lmem_swapping@verify-random.html * igt@gem_tiled_pread_basic: - bat-rpls-2: NOTRUN -> [SKIP][9] ([i915#3282]) [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@gem_tiled_pread_basic.html * igt@i915_pm_backlight@basic-brightness: - bat-rpls-2: NOTRUN -> [SKIP][10] ([i915#7561]) [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@i915_pm_backlight@basic-brightness.html * igt@i915_pm_rpm@basic-rte: - fi-cfl-guc: [PASS][11] -> [FAIL][12] ([i915#7940]) [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-cfl-guc/igt@i915_pm_rpm@basic-rte.html [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-cfl-guc/igt@i915_pm_rpm@basic-rte.html * igt@i915_pm_rps@basic-api: - bat-rpls-2: NOTRUN -> [SKIP][13] ([i915#6621]) [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@i915_pm_rps@basic-api.html * igt@i915_selftest@live@execlists: - fi-bsw-nick: [PASS][14] -> [ABORT][15] ([i915#7911] / [i915#7913]) [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-bsw-nick/igt@i915_selftest@live@execlists.html [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-bsw-nick/igt@i915_selftest@live@execlists.html * igt@i915_selftest@live@gt_heartbeat: - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][16] ([i915#5334] / [i915#7872]) [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-soraka/igt@i915_selftest@live@gt_heartbeat.html * igt@i915_selftest@live@gt_pm: - bat-rpls-2: NOTRUN -> [DMESG-FAIL][17] ([i915#4258] / [i915#7913]) [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@i915_selftest@live@gt_pm.html - fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][18] ([i915#1886] / [i915#7913]) [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html * igt@i915_selftest@live@requests: - bat-rpls-2: NOTRUN -> [ABORT][19] ([i915#7913] / [i915#7982]) [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@i915_selftest@live@requests.html * igt@i915_suspend@basic-s3-without-i915: - fi-kbl-7567u: [PASS][20] -> [INCOMPLETE][21] ([i915#4817]) [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-kbl-7567u/igt@i915_suspend@basic-s3-without-i915.html [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-7567u/igt@i915_suspend@basic-s3-without-i915.html * igt@kms_busy@basic: - bat-rpls-2: NOTRUN -> [SKIP][22] ([i915#1845]) +14 similar issues [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_busy@basic.html * igt@kms_chamelium_edid@hdmi-edid-read: - bat-rpls-2: NOTRUN -> [SKIP][23] ([i915#7828]) +7 similar issues [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_chamelium_edid@hdmi-edid-read.html * igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic: - fi-kbl-soraka: NOTRUN -> [SKIP][24] ([fdo#109271]) +15 similar issues [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-kbl-soraka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic.html * igt@kms_flip@basic-flip-vs-dpms: - bat-rpls-2: NOTRUN -> [SKIP][25] ([i915#3637]) +3 similar issues [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_flip@basic-flip-vs-dpms.html * igt@kms_force_connector_basic@force-load-detect: - bat-rpls-2: NOTRUN -> [SKIP][26] ([fdo#109285]) [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_force_connector_basic@force-load-detect.html * igt@kms_frontbuffer_tracking@basic: - bat-rpls-2: NOTRUN -> [SKIP][27] ([i915#1849]) [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_frontbuffer_tracking@basic.html * igt@kms_psr@sprite_plane_onoff: - bat-rpls-2: NOTRUN -> [SKIP][28] ([i915#1072]) +3 similar issues [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_psr@sprite_plane_onoff.html * igt@kms_setmode@basic-clone-single-crtc: - bat-rpls-2: NOTRUN -> [SKIP][29] ([i915#3555]) [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@kms_setmode@basic-clone-single-crtc.html * igt@prime_vgem@basic-fence-flip: - bat-rpls-2: NOTRUN -> [SKIP][30] ([fdo#109295] / [i915#1845] / [i915#3708]) [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@prime_vgem@basic-fence-flip.html * igt@prime_vgem@basic-write: - bat-rpls-2: NOTRUN -> [SKIP][31] ([fdo#109295] / [i915#3708]) +2 similar issues [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-2/igt@prime_vgem@basic-write.html #### Possible fixes #### * igt@core_auth@basic-auth: - bat-mtlp-6: [DMESG-WARN][32] -> [PASS][33] [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/bat-mtlp-6/igt@core_auth@basic-auth.html [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-mtlp-6/igt@core_auth@basic-auth.html * igt@i915_pm_rpm@basic-pci-d3-state: - fi-skl-guc: [FAIL][34] ([i915#7940]) -> [PASS][35] [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-skl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-skl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html * igt@i915_selftest@live@gt_heartbeat: - fi-glk-j4005: [DMESG-FAIL][36] ([i915#5334]) -> [PASS][37] [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-glk-j4005/igt@i915_selftest@live@gt_heartbeat.html * igt@i915_selftest@live@guc: - bat-rpls-1: [DMESG-WARN][38] ([i915#7852]) -> [PASS][39] [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/bat-rpls-1/igt@i915_selftest@live@guc.html [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-rpls-1/igt@i915_selftest@live@guc.html #### Warnings #### * igt@i915_module_load@load: - bat-adlp-11: [DMESG-WARN][40] ([i915#4423]) -> [ABORT][41] ([i915#4423]) [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/bat-adlp-11/igt@i915_module_load@load.html [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/bat-adlp-11/igt@i915_module_load@load.html * igt@i915_pm_rpm@basic-pci-d3-state: - fi-cfl-guc: [FAIL][42] ([i915#7691]) -> [FAIL][43] ([i915#7940]) [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13396/fi-cfl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html [43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/fi-cfl-guc/igt@i915_pm_rpm@basic-pci-d3-state.html {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271 [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285 [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295 [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072 [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845 [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849 [i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886 [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190 [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582 [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282 [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555 [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637 [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708 [i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258 [i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423 [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613 [i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817 [i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334 [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621 [i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456 [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561 [i915#7691]: https://gitlab.freedesktop.org/drm/intel/issues/7691 [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828 [i915#7852]: https://gitlab.freedesktop.org/drm/intel/issues/7852 [i915#7872]: https://gitlab.freedesktop.org/drm/intel/issues/7872 [i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911 [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913 [i915#7940]: https://gitlab.freedesktop.org/drm/intel/issues/7940 [i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982 Build changes ------------- * CI: CI-20190529 -> None * IGT: IGT_7394 -> IGTPW_9433 CI-20190529: 20190529 CI_DRM_13396: da1bb773ff84001b185e7bec54b32b89dff44f91 @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_9433: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/index.html IGT_7394: 3b0c82d7e9f1b8708d351243de7f227153793ede @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_9433/index.html [-- Attachment #2: Type: text/html, Size: 14638 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state 2023-07-19 14:46 [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Badal Nilawar 2023-07-19 15:49 ` [igt-dev] ○ CI.xeBAT: info for tests/xe: Verify actual frequency on the basis of GT state (rev4) Patchwork 2023-07-19 15:54 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork @ 2023-07-20 7:59 ` Gupta, Anshuman 2023-07-20 8:06 ` Nilawar, Badal 2 siblings, 1 reply; 6+ messages in thread From: Gupta, Anshuman @ 2023-07-20 7:59 UTC (permalink / raw) To: Nilawar, Badal, igt-dev@lists.freedesktop.org, Konieczny, Kamil > -----Original Message----- > From: Nilawar, Badal <badal.nilawar@intel.com> > Sent: Wednesday, July 19, 2023 8:16 PM > To: igt-dev@lists.freedesktop.org > Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman > <anshuman.gupta@intel.com>; Dixit, Ashutosh <ashutosh.dixit@intel.com>; > Belgaumkar, Vinay <vinay.belgaumkar@intel.com> > Subject: [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT > state > > When GT is in RC6 actual frequency reported will be 0. So verify actual on the > basic of GT state. > > v2: > - Rebased > - Move function xe_is_gt_in_c6, to check rc6 state, to igt_pm library > - Assert if freq reported is not 0 when idle (Ashutosh) > v3: > - Fix review comments (Ashutosh) > v4: > - Move igt_require to igt_main under idle test cases (Ashutosh) > - For idle case wait for C6 instead of usleep (Ashutosh) > v5: > - Remove igt_require from test_freq_range > > Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests") > Signed-off-by: Badal Nilawar <badal.nilawar@intel.com> > Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > --- > lib/igt_pm.c | 20 +++++++++++++++++ > lib/igt_pm.h | 1 + > tests/xe/xe_guc_pc.c | 46 +++++++++++++++++++++++++++++--------- > tests/xe/xe_pm_residency.c | 38 ++++++++++--------------------- > 4 files changed, 69 insertions(+), 36 deletions(-) > > diff --git a/lib/igt_pm.c b/lib/igt_pm.c index ba591f0f8..ccfa5178b 100644 > --- a/lib/igt_pm.c > +++ b/lib/igt_pm.c > @@ -1417,3 +1417,23 @@ void igt_pm_ignore_slpc_efficient_freq(int i915, > int gtfd, bool val) > igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq")); > igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val); } > + > +/** > + * xe_is_gt_in_c6: It should follow the igt_pm naming convention. Though major concern is around igt_pm library, can we have driver specific functions() ? xe_is_gt_in_c6() is xe specific. @Konieczny, Kamil could you please provide your input. Thanks, Anshuman. > + * @fd: pointer to xe drm fd > + * @gt: gt number > + * > + * Check if GT is in C6 state > + */ > +bool xe_is_gt_in_c6(int fd, int gt) > +{ > + char gt_c_state[16]; > + int gt_fd; > + > + gt_fd = xe_sysfs_gt_open(fd, gt); > + igt_assert(gt_fd >= 0); > + igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", > gt_c_state) == 1); > + close(gt_fd); > + > + return strcmp(gt_c_state, "gt-c6") == 0; } > diff --git a/lib/igt_pm.h b/lib/igt_pm.h index 71ec2f239..2fc7b98a1 100644 > --- a/lib/igt_pm.h > +++ b/lib/igt_pm.h > @@ -89,5 +89,6 @@ bool i915_is_slpc_enabled(int drm_fd); int > igt_pm_get_runtime_suspended_time(struct pci_device *pci_dev); int > igt_pm_get_runtime_usage(struct pci_device *pci_dev); void > igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val); > +bool xe_is_gt_in_c6(int fd, int gt); > > #endif /* IGT_PM_H */ > diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c index > c34df8d60..d55790afd 100644 > --- a/tests/xe/xe_guc_pc.c > +++ b/tests/xe/xe_guc_pc.c > @@ -218,7 +218,7 @@ static void test_freq_basic_api(int fd, int gt_id) > * Run type: FULL > */ > > -static void test_freq_fixed(int fd, int gt_id) > +static void test_freq_fixed(int fd, int gt_id, bool gt_idle) > { > uint32_t rpn = get_freq(fd, gt_id, "rpn"); > uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -235,13 +235,26 @@ > static void test_freq_fixed(int fd, int gt_id) > igt_assert(set_freq(fd, gt_id, "max", rpn) > 0); > usleep(ACT_FREQ_LATENCY_US); > igt_assert(get_freq(fd, gt_id, "cur") == rpn); > - igt_assert(get_freq(fd, gt_id, "act") == rpn); > + > + if (gt_idle) { > + /* Wait for GT to go in C6 as previous get_freq wakes up > GT*/ > + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > + igt_assert(get_freq(fd, gt_id, "act") == 0); > + } else { > + igt_assert(get_freq(fd, gt_id, "act") == rpn); > + } > > igt_assert(set_freq(fd, gt_id, "min", rpe) > 0); > igt_assert(set_freq(fd, gt_id, "max", rpe) > 0); > usleep(ACT_FREQ_LATENCY_US); > igt_assert(get_freq(fd, gt_id, "cur") == rpe); > - igt_assert(get_freq(fd, gt_id, "act") == rpe); > + > + if (gt_idle) { > + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > + igt_assert(get_freq(fd, gt_id, "act") == 0); > + } else { > + igt_assert(get_freq(fd, gt_id, "act") == rpe); > + } > > igt_assert(set_freq(fd, gt_id, "min", rp0) > 0); > igt_assert(set_freq(fd, gt_id, "max", rp0) > 0); @@ -253,6 +266,11 > @@ static void test_freq_fixed(int fd, int gt_id) > */ > igt_assert(get_freq(fd, gt_id, "cur") == rp0); > > + if (gt_idle) { > + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > + igt_assert(get_freq(fd, gt_id, "act") == 0); > + } > + > igt_debug("Finished testing fixed request\n"); } > > @@ -266,7 +284,7 @@ static void test_freq_fixed(int fd, int gt_id) > * Run type: FULL > */ > > -static void test_freq_range(int fd, int gt_id) > +static void test_freq_range(int fd, int gt_id, bool gt_idle) > { > uint32_t rpn = get_freq(fd, gt_id, "rpn"); > uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -279,8 +297,14 @@ > static void test_freq_range(int fd, int gt_id) > usleep(ACT_FREQ_LATENCY_US); > cur = get_freq(fd, gt_id, "cur"); > igt_assert(rpn <= cur && cur <= rpe); > - act = get_freq(fd, gt_id, "act"); > - igt_assert(rpn <= act && act <= rpe); > + > + if (gt_idle) { > + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > + igt_assert(get_freq(fd, gt_id, "act") == 0); > + } else { > + act = get_freq(fd, gt_id, "act"); > + igt_assert(rpn <= act && act <= rpe); > + } > > igt_debug("Finished testing range request\n"); } @@ -385,7 +409,8 > @@ igt_main > > igt_subtest("freq_fixed_idle") { > xe_for_each_gt(fd, gt) { > - test_freq_fixed(fd, gt); > + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, > 10)); > + test_freq_fixed(fd, gt, true); > } > } > > @@ -398,14 +423,15 @@ igt_main > igt_debug("Execution Finished\n"); > } > /* While exec in threads above, let's check the freq > */ > - test_freq_fixed(fd, gt); > + test_freq_fixed(fd, gt, false); > igt_waitchildren(); > } > } > > igt_subtest("freq_range_idle") { > xe_for_each_gt(fd, gt) { > - test_freq_range(fd, gt); > + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, > 10)); > + test_freq_range(fd, gt, true); > } > } > > @@ -418,7 +444,7 @@ igt_main > igt_debug("Execution Finished\n"); > } > /* While exec in threads above, let's check the freq > */ > - test_freq_range(fd, gt); > + test_freq_range(fd, gt, false); > igt_waitchildren(); > } > } > diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c > index a20c4449c..5c4516d03 100644 > --- a/tests/xe/xe_pm_residency.c > +++ b/tests/xe/xe_pm_residency.c > @@ -28,6 +28,16 @@ const double tolerance = 0.1; > (tol) * 100.0, (tol) * 100.0, \ > (double)(ref)) > > +/** > + * SUBTEST: gt-c6-on-idle > + * Description: Validate GT C6 state on idle > + * Run type: BAT > + * > + * SUBTEST: idle-residency > + * Description: basic residency test to validate idle residency > + * measured over a time interval is within the tolerance > + * Run type: FULL > + */ > IGT_TEST_DESCRIPTION("Tests for gtidle properties"); > > static unsigned int measured_usleep(unsigned int usec) @@ -45,24 +55,6 > @@ static unsigned int measured_usleep(unsigned int usec) > return igt_nsec_elapsed(&ts) / 1000; > } > > -/** > - * SUBTEST: gt-c6-on-idle > - * Description: Validate GT C6 state on idle > - * Run type: BAT > - */ > -static bool is_gt_in_c6(int fd, int gt) -{ > - char gt_c_state[16]; > - int gt_fd; > - > - gt_fd = xe_sysfs_gt_open(fd, gt); > - igt_assert(gt_fd >= 0); > - igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", > gt_c_state) == 1); > - close(gt_fd); > - > - return strcmp(gt_c_state, "gt-c6") == 0; > -} > - > static unsigned long read_idle_residency(int fd, int gt) { > unsigned long residency = 0; > @@ -76,17 +68,11 @@ static unsigned long read_idle_residency(int fd, int gt) > return residency; > } > > -/** > - * SUBTEST: idle-residency > - * Description: basic residency test to validate idle residency > - * measured over a time interval is within the tolerance > - * Run type: FULL > - */ > static void test_idle_residency(int fd, int gt) { > unsigned long elapsed_ms, residency_start, residency_end; > > - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n"); > + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), "GT not in > +C6\n"); > > residency_start = read_idle_residency(fd, gt); > elapsed_ms = measured_usleep(SLEEP_DURATION * 1000) / 1000; > @@ -110,7 +96,7 @@ igt_main > igt_describe("Validate GT C6 on idle"); > igt_subtest("gt-c6-on-idle") > xe_for_each_gt(fd, gt) > - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), > "GT not in C6\n"); > + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), > "GT not in > +C6\n"); > > igt_describe("Validate idle residency measured over a time interval is > within the tolerance"); > igt_subtest("idle-residency") > -- > 2.25.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state 2023-07-20 7:59 ` [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Gupta, Anshuman @ 2023-07-20 8:06 ` Nilawar, Badal 2023-07-20 8:20 ` Gupta, Anshuman 0 siblings, 1 reply; 6+ messages in thread From: Nilawar, Badal @ 2023-07-20 8:06 UTC (permalink / raw) To: Gupta, Anshuman, igt-dev@lists.freedesktop.org, Konieczny, Kamil On 20-07-2023 13:29, Gupta, Anshuman wrote: > > >> -----Original Message----- >> From: Nilawar, Badal <badal.nilawar@intel.com> >> Sent: Wednesday, July 19, 2023 8:16 PM >> To: igt-dev@lists.freedesktop.org >> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman >> <anshuman.gupta@intel.com>; Dixit, Ashutosh <ashutosh.dixit@intel.com>; >> Belgaumkar, Vinay <vinay.belgaumkar@intel.com> >> Subject: [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT >> state >> >> When GT is in RC6 actual frequency reported will be 0. So verify actual on the >> basic of GT state. >> >> v2: >> - Rebased >> - Move function xe_is_gt_in_c6, to check rc6 state, to igt_pm library >> - Assert if freq reported is not 0 when idle (Ashutosh) >> v3: >> - Fix review comments (Ashutosh) >> v4: >> - Move igt_require to igt_main under idle test cases (Ashutosh) >> - For idle case wait for C6 instead of usleep (Ashutosh) >> v5: >> - Remove igt_require from test_freq_range >> >> Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests") >> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com> >> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> >> --- >> lib/igt_pm.c | 20 +++++++++++++++++ >> lib/igt_pm.h | 1 + >> tests/xe/xe_guc_pc.c | 46 +++++++++++++++++++++++++++++--------- >> tests/xe/xe_pm_residency.c | 38 ++++++++++--------------------- >> 4 files changed, 69 insertions(+), 36 deletions(-) >> >> diff --git a/lib/igt_pm.c b/lib/igt_pm.c index ba591f0f8..ccfa5178b 100644 >> --- a/lib/igt_pm.c >> +++ b/lib/igt_pm.c >> @@ -1417,3 +1417,23 @@ void igt_pm_ignore_slpc_efficient_freq(int i915, >> int gtfd, bool val) >> igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq")); >> igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val); } >> + >> +/** >> + * xe_is_gt_in_c6: > It should follow the igt_pm naming convention. > Though major concern is around igt_pm library, can we have driver specific functions() ? xe_is_gt_in_c6() is xe specific. > @Konieczny, Kamil could you please provide your input. I saw some of the i915 functions present in igt_pm lib and there is no saperate lib for i915_pm. With that convetion I added xe pm function to this lib. Otherwise xe_pm lib can be created for above function. Regards, Badal > > Thanks, > Anshuman. >> + * @fd: pointer to xe drm fd >> + * @gt: gt number >> + * >> + * Check if GT is in C6 state >> + */ >> +bool xe_is_gt_in_c6(int fd, int gt) >> +{ >> + char gt_c_state[16]; >> + int gt_fd; >> + >> + gt_fd = xe_sysfs_gt_open(fd, gt); >> + igt_assert(gt_fd >= 0); >> + igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", >> gt_c_state) == 1); >> + close(gt_fd); >> + >> + return strcmp(gt_c_state, "gt-c6") == 0; } >> diff --git a/lib/igt_pm.h b/lib/igt_pm.h index 71ec2f239..2fc7b98a1 100644 >> --- a/lib/igt_pm.h >> +++ b/lib/igt_pm.h >> @@ -89,5 +89,6 @@ bool i915_is_slpc_enabled(int drm_fd); int >> igt_pm_get_runtime_suspended_time(struct pci_device *pci_dev); int >> igt_pm_get_runtime_usage(struct pci_device *pci_dev); void >> igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val); >> +bool xe_is_gt_in_c6(int fd, int gt); >> >> #endif /* IGT_PM_H */ >> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c index >> c34df8d60..d55790afd 100644 >> --- a/tests/xe/xe_guc_pc.c >> +++ b/tests/xe/xe_guc_pc.c >> @@ -218,7 +218,7 @@ static void test_freq_basic_api(int fd, int gt_id) >> * Run type: FULL >> */ >> >> -static void test_freq_fixed(int fd, int gt_id) >> +static void test_freq_fixed(int fd, int gt_id, bool gt_idle) >> { >> uint32_t rpn = get_freq(fd, gt_id, "rpn"); >> uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -235,13 +235,26 @@ >> static void test_freq_fixed(int fd, int gt_id) >> igt_assert(set_freq(fd, gt_id, "max", rpn) > 0); >> usleep(ACT_FREQ_LATENCY_US); >> igt_assert(get_freq(fd, gt_id, "cur") == rpn); >> - igt_assert(get_freq(fd, gt_id, "act") == rpn); >> + >> + if (gt_idle) { >> + /* Wait for GT to go in C6 as previous get_freq wakes up >> GT*/ >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); >> + igt_assert(get_freq(fd, gt_id, "act") == 0); >> + } else { >> + igt_assert(get_freq(fd, gt_id, "act") == rpn); >> + } >> >> igt_assert(set_freq(fd, gt_id, "min", rpe) > 0); >> igt_assert(set_freq(fd, gt_id, "max", rpe) > 0); >> usleep(ACT_FREQ_LATENCY_US); >> igt_assert(get_freq(fd, gt_id, "cur") == rpe); >> - igt_assert(get_freq(fd, gt_id, "act") == rpe); >> + >> + if (gt_idle) { >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); >> + igt_assert(get_freq(fd, gt_id, "act") == 0); >> + } else { >> + igt_assert(get_freq(fd, gt_id, "act") == rpe); >> + } >> >> igt_assert(set_freq(fd, gt_id, "min", rp0) > 0); >> igt_assert(set_freq(fd, gt_id, "max", rp0) > 0); @@ -253,6 +266,11 >> @@ static void test_freq_fixed(int fd, int gt_id) >> */ >> igt_assert(get_freq(fd, gt_id, "cur") == rp0); >> >> + if (gt_idle) { >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); >> + igt_assert(get_freq(fd, gt_id, "act") == 0); >> + } >> + >> igt_debug("Finished testing fixed request\n"); } >> >> @@ -266,7 +284,7 @@ static void test_freq_fixed(int fd, int gt_id) >> * Run type: FULL >> */ >> >> -static void test_freq_range(int fd, int gt_id) >> +static void test_freq_range(int fd, int gt_id, bool gt_idle) >> { >> uint32_t rpn = get_freq(fd, gt_id, "rpn"); >> uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -279,8 +297,14 @@ >> static void test_freq_range(int fd, int gt_id) >> usleep(ACT_FREQ_LATENCY_US); >> cur = get_freq(fd, gt_id, "cur"); >> igt_assert(rpn <= cur && cur <= rpe); >> - act = get_freq(fd, gt_id, "act"); >> - igt_assert(rpn <= act && act <= rpe); >> + >> + if (gt_idle) { >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); >> + igt_assert(get_freq(fd, gt_id, "act") == 0); >> + } else { >> + act = get_freq(fd, gt_id, "act"); >> + igt_assert(rpn <= act && act <= rpe); >> + } >> >> igt_debug("Finished testing range request\n"); } @@ -385,7 +409,8 >> @@ igt_main >> >> igt_subtest("freq_fixed_idle") { >> xe_for_each_gt(fd, gt) { >> - test_freq_fixed(fd, gt); >> + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, >> 10)); >> + test_freq_fixed(fd, gt, true); >> } >> } >> >> @@ -398,14 +423,15 @@ igt_main >> igt_debug("Execution Finished\n"); >> } >> /* While exec in threads above, let's check the freq >> */ >> - test_freq_fixed(fd, gt); >> + test_freq_fixed(fd, gt, false); >> igt_waitchildren(); >> } >> } >> >> igt_subtest("freq_range_idle") { >> xe_for_each_gt(fd, gt) { >> - test_freq_range(fd, gt); >> + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, >> 10)); >> + test_freq_range(fd, gt, true); >> } >> } >> >> @@ -418,7 +444,7 @@ igt_main >> igt_debug("Execution Finished\n"); >> } >> /* While exec in threads above, let's check the freq >> */ >> - test_freq_range(fd, gt); >> + test_freq_range(fd, gt, false); >> igt_waitchildren(); >> } >> } >> diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c >> index a20c4449c..5c4516d03 100644 >> --- a/tests/xe/xe_pm_residency.c >> +++ b/tests/xe/xe_pm_residency.c >> @@ -28,6 +28,16 @@ const double tolerance = 0.1; >> (tol) * 100.0, (tol) * 100.0, \ >> (double)(ref)) >> >> +/** >> + * SUBTEST: gt-c6-on-idle >> + * Description: Validate GT C6 state on idle >> + * Run type: BAT >> + * >> + * SUBTEST: idle-residency >> + * Description: basic residency test to validate idle residency >> + * measured over a time interval is within the tolerance >> + * Run type: FULL >> + */ >> IGT_TEST_DESCRIPTION("Tests for gtidle properties"); >> >> static unsigned int measured_usleep(unsigned int usec) @@ -45,24 +55,6 >> @@ static unsigned int measured_usleep(unsigned int usec) >> return igt_nsec_elapsed(&ts) / 1000; >> } >> >> -/** >> - * SUBTEST: gt-c6-on-idle >> - * Description: Validate GT C6 state on idle >> - * Run type: BAT >> - */ >> -static bool is_gt_in_c6(int fd, int gt) -{ >> - char gt_c_state[16]; >> - int gt_fd; >> - >> - gt_fd = xe_sysfs_gt_open(fd, gt); >> - igt_assert(gt_fd >= 0); >> - igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", >> gt_c_state) == 1); >> - close(gt_fd); >> - >> - return strcmp(gt_c_state, "gt-c6") == 0; >> -} >> - >> static unsigned long read_idle_residency(int fd, int gt) { >> unsigned long residency = 0; >> @@ -76,17 +68,11 @@ static unsigned long read_idle_residency(int fd, int gt) >> return residency; >> } >> >> -/** >> - * SUBTEST: idle-residency >> - * Description: basic residency test to validate idle residency >> - * measured over a time interval is within the tolerance >> - * Run type: FULL >> - */ >> static void test_idle_residency(int fd, int gt) { >> unsigned long elapsed_ms, residency_start, residency_end; >> >> - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n"); >> + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), "GT not in >> +C6\n"); >> >> residency_start = read_idle_residency(fd, gt); >> elapsed_ms = measured_usleep(SLEEP_DURATION * 1000) / 1000; >> @@ -110,7 +96,7 @@ igt_main >> igt_describe("Validate GT C6 on idle"); >> igt_subtest("gt-c6-on-idle") >> xe_for_each_gt(fd, gt) >> - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), >> "GT not in C6\n"); >> + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), >> "GT not in >> +C6\n"); >> >> igt_describe("Validate idle residency measured over a time interval is >> within the tolerance"); >> igt_subtest("idle-residency") >> -- >> 2.25.1 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state 2023-07-20 8:06 ` Nilawar, Badal @ 2023-07-20 8:20 ` Gupta, Anshuman 0 siblings, 0 replies; 6+ messages in thread From: Gupta, Anshuman @ 2023-07-20 8:20 UTC (permalink / raw) To: Nilawar, Badal, igt-dev@lists.freedesktop.org, Konieczny, Kamil > -----Original Message----- > From: Nilawar, Badal <badal.nilawar@intel.com> > Sent: Thursday, July 20, 2023 1:37 PM > To: Gupta, Anshuman <anshuman.gupta@intel.com>; igt- > dev@lists.freedesktop.org; Konieczny, Kamil <kamil.konieczny@intel.com> > Cc: Tauro, Riana <riana.tauro@intel.com>; Dixit, Ashutosh > <ashutosh.dixit@intel.com>; Belgaumkar, Vinay > <vinay.belgaumkar@intel.com> > Subject: Re: [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of > GT state > > > > On 20-07-2023 13:29, Gupta, Anshuman wrote: > > > > > >> -----Original Message----- > >> From: Nilawar, Badal <badal.nilawar@intel.com> > >> Sent: Wednesday, July 19, 2023 8:16 PM > >> To: igt-dev@lists.freedesktop.org > >> Cc: Tauro, Riana <riana.tauro@intel.com>; Gupta, Anshuman > >> <anshuman.gupta@intel.com>; Dixit, Ashutosh > >> <ashutosh.dixit@intel.com>; Belgaumkar, Vinay > >> <vinay.belgaumkar@intel.com> > >> Subject: [PATCH i-g-t v5] tests/xe: Verify actual frequency on the > >> basis of GT state > >> > >> When GT is in RC6 actual frequency reported will be 0. So verify > >> actual on the basic of GT state. > >> > >> v2: > >> - Rebased > >> - Move function xe_is_gt_in_c6, to check rc6 state, to igt_pm library > >> - Assert if freq reported is not 0 when idle (Ashutosh) > >> v3: > >> - Fix review comments (Ashutosh) > >> v4: > >> - Move igt_require to igt_main under idle test cases (Ashutosh) > >> - For idle case wait for C6 instead of usleep (Ashutosh) > >> v5: > >> - Remove igt_require from test_freq_range > >> > >> Fixes: acaaca0bf317 ("tests/xe: Add Xe IGT tests") > >> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com> > >> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> > >> --- > >> lib/igt_pm.c | 20 +++++++++++++++++ > >> lib/igt_pm.h | 1 + > >> tests/xe/xe_guc_pc.c | 46 +++++++++++++++++++++++++++++------ > --- > >> tests/xe/xe_pm_residency.c | 38 ++++++++++--------------------- > >> 4 files changed, 69 insertions(+), 36 deletions(-) > >> > >> diff --git a/lib/igt_pm.c b/lib/igt_pm.c index ba591f0f8..ccfa5178b > >> 100644 > >> --- a/lib/igt_pm.c > >> +++ b/lib/igt_pm.c > >> @@ -1417,3 +1417,23 @@ void igt_pm_ignore_slpc_efficient_freq(int > >> i915, int gtfd, bool val) > >> igt_require(igt_sysfs_has_attr(gtfd, "slpc_ignore_eff_freq")); > >> igt_sysfs_set_u32(gtfd, "slpc_ignore_eff_freq", val); } > >> + > >> +/** > >> + * xe_is_gt_in_c6: > > It should follow the igt_pm naming convention. > > Though major concern is around igt_pm library, can we have driver specific > functions() ? xe_is_gt_in_c6() is xe specific. > > @Konieczny, Kamil could you please provide your input. > I saw some of the i915 functions present in igt_pm lib and there is no > saperate lib for i915_pm. With that convetion I added xe pm function to this > lib. Otherwise xe_pm lib can be created for above function. Move this to lib/xe/xe_util.c ? Igt_pm.c is a generic pci pm related lib with few exception like slpc and dmc. Thanks, Anshuman Gupta. > Regards, > Badal > > > > Thanks, > > Anshuman. > >> + * @fd: pointer to xe drm fd > >> + * @gt: gt number > >> + * > >> + * Check if GT is in C6 state > >> + */ > >> +bool xe_is_gt_in_c6(int fd, int gt) > >> +{ > >> + char gt_c_state[16]; > >> + int gt_fd; > >> + > >> + gt_fd = xe_sysfs_gt_open(fd, gt); > >> + igt_assert(gt_fd >= 0); > >> + igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", > >> gt_c_state) == 1); > >> + close(gt_fd); > >> + > >> + return strcmp(gt_c_state, "gt-c6") == 0; } > >> diff --git a/lib/igt_pm.h b/lib/igt_pm.h index 71ec2f239..2fc7b98a1 > >> 100644 > >> --- a/lib/igt_pm.h > >> +++ b/lib/igt_pm.h > >> @@ -89,5 +89,6 @@ bool i915_is_slpc_enabled(int drm_fd); int > >> igt_pm_get_runtime_suspended_time(struct pci_device *pci_dev); int > >> igt_pm_get_runtime_usage(struct pci_device *pci_dev); void > >> igt_pm_ignore_slpc_efficient_freq(int i915, int gtfd, bool val); > >> +bool xe_is_gt_in_c6(int fd, int gt); > >> > >> #endif /* IGT_PM_H */ > >> diff --git a/tests/xe/xe_guc_pc.c b/tests/xe/xe_guc_pc.c index > >> c34df8d60..d55790afd 100644 > >> --- a/tests/xe/xe_guc_pc.c > >> +++ b/tests/xe/xe_guc_pc.c > >> @@ -218,7 +218,7 @@ static void test_freq_basic_api(int fd, int gt_id) > >> * Run type: FULL > >> */ > >> > >> -static void test_freq_fixed(int fd, int gt_id) > >> +static void test_freq_fixed(int fd, int gt_id, bool gt_idle) > >> { > >> uint32_t rpn = get_freq(fd, gt_id, "rpn"); > >> uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -235,13 +235,26 @@ > >> static void test_freq_fixed(int fd, int gt_id) > >> igt_assert(set_freq(fd, gt_id, "max", rpn) > 0); > >> usleep(ACT_FREQ_LATENCY_US); > >> igt_assert(get_freq(fd, gt_id, "cur") == rpn); > >> - igt_assert(get_freq(fd, gt_id, "act") == rpn); > >> + > >> + if (gt_idle) { > >> + /* Wait for GT to go in C6 as previous get_freq wakes up > >> GT*/ > >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > >> + igt_assert(get_freq(fd, gt_id, "act") == 0); > >> + } else { > >> + igt_assert(get_freq(fd, gt_id, "act") == rpn); > >> + } > >> > >> igt_assert(set_freq(fd, gt_id, "min", rpe) > 0); > >> igt_assert(set_freq(fd, gt_id, "max", rpe) > 0); > >> usleep(ACT_FREQ_LATENCY_US); > >> igt_assert(get_freq(fd, gt_id, "cur") == rpe); > >> - igt_assert(get_freq(fd, gt_id, "act") == rpe); > >> + > >> + if (gt_idle) { > >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > >> + igt_assert(get_freq(fd, gt_id, "act") == 0); > >> + } else { > >> + igt_assert(get_freq(fd, gt_id, "act") == rpe); > >> + } > >> > >> igt_assert(set_freq(fd, gt_id, "min", rp0) > 0); > >> igt_assert(set_freq(fd, gt_id, "max", rp0) > 0); @@ -253,6 +266,11 > >> @@ static void test_freq_fixed(int fd, int gt_id) > >> */ > >> igt_assert(get_freq(fd, gt_id, "cur") == rp0); > >> > >> + if (gt_idle) { > >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > >> + igt_assert(get_freq(fd, gt_id, "act") == 0); > >> + } > >> + > >> igt_debug("Finished testing fixed request\n"); } > >> > >> @@ -266,7 +284,7 @@ static void test_freq_fixed(int fd, int gt_id) > >> * Run type: FULL > >> */ > >> > >> -static void test_freq_range(int fd, int gt_id) > >> +static void test_freq_range(int fd, int gt_id, bool gt_idle) > >> { > >> uint32_t rpn = get_freq(fd, gt_id, "rpn"); > >> uint32_t rpe = get_freq(fd, gt_id, "rpe"); @@ -279,8 +297,14 @@ > >> static void test_freq_range(int fd, int gt_id) > >> usleep(ACT_FREQ_LATENCY_US); > >> cur = get_freq(fd, gt_id, "cur"); > >> igt_assert(rpn <= cur && cur <= rpe); > >> - act = get_freq(fd, gt_id, "act"); > >> - igt_assert(rpn <= act && act <= rpe); > >> + > >> + if (gt_idle) { > >> + igt_assert(igt_wait(xe_is_gt_in_c6(fd, gt_id), 1000, 10)); > >> + igt_assert(get_freq(fd, gt_id, "act") == 0); > >> + } else { > >> + act = get_freq(fd, gt_id, "act"); > >> + igt_assert(rpn <= act && act <= rpe); > >> + } > >> > >> igt_debug("Finished testing range request\n"); } @@ -385,7 +409,8 > >> @@ igt_main > >> > >> igt_subtest("freq_fixed_idle") { > >> xe_for_each_gt(fd, gt) { > >> - test_freq_fixed(fd, gt); > >> + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, > >> 10)); > >> + test_freq_fixed(fd, gt, true); > >> } > >> } > >> > >> @@ -398,14 +423,15 @@ igt_main > >> igt_debug("Execution Finished\n"); > >> } > >> /* While exec in threads above, let's check the freq > */ > >> - test_freq_fixed(fd, gt); > >> + test_freq_fixed(fd, gt, false); > >> igt_waitchildren(); > >> } > >> } > >> > >> igt_subtest("freq_range_idle") { > >> xe_for_each_gt(fd, gt) { > >> - test_freq_range(fd, gt); > >> + igt_require(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, > >> 10)); > >> + test_freq_range(fd, gt, true); > >> } > >> } > >> > >> @@ -418,7 +444,7 @@ igt_main > >> igt_debug("Execution Finished\n"); > >> } > >> /* While exec in threads above, let's check the freq > */ > >> - test_freq_range(fd, gt); > >> + test_freq_range(fd, gt, false); > >> igt_waitchildren(); > >> } > >> } > >> diff --git a/tests/xe/xe_pm_residency.c b/tests/xe/xe_pm_residency.c > >> index a20c4449c..5c4516d03 100644 > >> --- a/tests/xe/xe_pm_residency.c > >> +++ b/tests/xe/xe_pm_residency.c > >> @@ -28,6 +28,16 @@ const double tolerance = 0.1; > >> (tol) * 100.0, (tol) * 100.0, \ > >> (double)(ref)) > >> > >> +/** > >> + * SUBTEST: gt-c6-on-idle > >> + * Description: Validate GT C6 state on idle > >> + * Run type: BAT > >> + * > >> + * SUBTEST: idle-residency > >> + * Description: basic residency test to validate idle residency > >> + * measured over a time interval is within the tolerance > >> + * Run type: FULL > >> + */ > >> IGT_TEST_DESCRIPTION("Tests for gtidle properties"); > >> > >> static unsigned int measured_usleep(unsigned int usec) @@ -45,24 > >> +55,6 @@ static unsigned int measured_usleep(unsigned int usec) > >> return igt_nsec_elapsed(&ts) / 1000; > >> } > >> > >> -/** > >> - * SUBTEST: gt-c6-on-idle > >> - * Description: Validate GT C6 state on idle > >> - * Run type: BAT > >> - */ > >> -static bool is_gt_in_c6(int fd, int gt) -{ > >> - char gt_c_state[16]; > >> - int gt_fd; > >> - > >> - gt_fd = xe_sysfs_gt_open(fd, gt); > >> - igt_assert(gt_fd >= 0); > >> - igt_assert(igt_sysfs_scanf(gt_fd, "gtidle/idle_status", "%s", > >> gt_c_state) == 1); > >> - close(gt_fd); > >> - > >> - return strcmp(gt_c_state, "gt-c6") == 0; > >> -} > >> - > >> static unsigned long read_idle_residency(int fd, int gt) { > >> unsigned long residency = 0; > >> @@ -76,17 +68,11 @@ static unsigned long read_idle_residency(int fd, int > gt) > >> return residency; > >> } > >> > >> -/** > >> - * SUBTEST: idle-residency > >> - * Description: basic residency test to validate idle residency > >> - * measured over a time interval is within the tolerance > >> - * Run type: FULL > >> - */ > >> static void test_idle_residency(int fd, int gt) { > >> unsigned long elapsed_ms, residency_start, residency_end; > >> > >> - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), "GT not in C6\n"); > >> + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), "GT not in > >> +C6\n"); > >> > >> residency_start = read_idle_residency(fd, gt); > >> elapsed_ms = measured_usleep(SLEEP_DURATION * 1000) / 1000; > @@ > >> -110,7 +96,7 @@ igt_main > >> igt_describe("Validate GT C6 on idle"); > >> igt_subtest("gt-c6-on-idle") > >> xe_for_each_gt(fd, gt) > >> - igt_assert_f(igt_wait(is_gt_in_c6(fd, gt), 1000, 1), > >> "GT not in C6\n"); > >> + igt_assert_f(igt_wait(xe_is_gt_in_c6(fd, gt), 1000, 1), > >> "GT not in > >> +C6\n"); > >> > >> igt_describe("Validate idle residency measured over a time > >> interval is within the tolerance"); > >> igt_subtest("idle-residency") > >> -- > >> 2.25.1 > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-20 8:20 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-19 14:46 [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Badal Nilawar 2023-07-19 15:49 ` [igt-dev] ○ CI.xeBAT: info for tests/xe: Verify actual frequency on the basis of GT state (rev4) Patchwork 2023-07-19 15:54 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork 2023-07-20 7:59 ` [igt-dev] [PATCH i-g-t v5] tests/xe: Verify actual frequency on the basis of GT state Gupta, Anshuman 2023-07-20 8:06 ` Nilawar, Badal 2023-07-20 8:20 ` Gupta, Anshuman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox