[PATCH i-g-t v5 1/4] tests/intel/kms_pm_dc: Add time unit macros and update delay calculation
Naladala Ramanaidu
ramanaidu.naladala at intel.com
Thu Aug 22 18:42:30 UTC 2024
This change improves code readability and consistency in time unit
conversions. Introduce new macros for time units: SECS(s), MSECS(s),
and USECS(s). Update the delay calculation in test_deep_pkgc_state
to use the new MSECS macro.
Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
---
tests/intel/kms_pm_dc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 1aef1e02d..e2a0a6b25 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -93,7 +93,9 @@
#define PACKAGE_CSTATE_PATH "pmc_core/package_cstate_show"
#define KMS_POLL_DISABLE 0
#define DC9_RESETS_DC_COUNTERS(devid) (!(IS_DG1(devid) || IS_DG2(devid) || AT_LEAST_DISPLAY(devid, 14)))
-#define MSECS (1000000ul)
+#define SECS(s) s
+#define MSECS(s) (s * 1000)
+#define USECS(s) (s * 1000000)
IGT_TEST_DESCRIPTION("Tests to validate display power DC states.");
@@ -623,7 +625,7 @@ static void test_deep_pkgc_state(data_t *data)
primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
pre_val = read_pkgc_counter(data->debugfs_root_fd);
- delay = 1 * (MSECS / (data->mode->vrefresh - 10));
+ delay = 1 * (MSECS(1) / (data->mode->vrefresh - 10));
igt_plane_set_fb(primary, &data->fb_rgb);
igt_display_commit(&data->display);
--
2.43.0
More information about the Intel-gfx-trybot
mailing list