[PATCH i-g-t v5 1/4] tests/intel/kms_pm_dc: Add time unit macros and update delay calculation

Kandpal, Suraj suraj.kandpal at intel.com
Wed Aug 28 05:53:48 UTC 2024



> -----Original Message-----
> From: Naladala, Ramanaidu <ramanaidu.naladala at intel.com>
> Sent: Tuesday, August 27, 2024 6:10 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Kandpal, Suraj <suraj.kandpal at intel.com>; B, Jeevan
> <jeevan.b at intel.com>; Naladala, Ramanaidu
> <ramanaidu.naladala at intel.com>
> Subject: [PATCH i-g-t v5 1/4] tests/intel/kms_pm_dc: Add time unit macros and
> update delay calculation
> 
> This change improves code readability and consistency in time unit
> conversions. Replace MSECS with more granular time units: SEC, MSEC, and
> USEC. Update the delay calculation in test_deep_pkgc_state to use the new
> MSEC 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..2ae9fd2a5 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 SEC 1
> +#define MSEC (SEC * 1000)
> +#define USEC (MSEC * 1000)

I don't see you using USEC anywhere, no need to define it in that case remove it

Rest LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal at intel.com>

> 
>  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 = (MSEC / (data->mode->vrefresh - 10));
> 
>  	igt_plane_set_fb(primary, &data->fb_rgb);
>  	igt_display_commit(&data->display);
> --
> 2.43.0



More information about the igt-dev mailing list