[PATCH i-g-t 1/2] tests/intel/kms_pm_dc:Add basic checks achive deep-pkgc

Kandpal, Suraj suraj.kandpal at intel.com
Mon Jul 15 04:03:05 UTC 2024



> -----Original Message-----
> From: Naladala, Ramanaidu <ramanaidu.naladala at intel.com>
> Sent: Saturday, July 13, 2024 12:57 PM
> To: igt-dev at lists.freedesktop.org
> Cc: B, Jeevan <jeevan.b at intel.com>; Kandpal, Suraj
> <suraj.kandpal at intel.com>; Naladala, Ramanaidu
> <ramanaidu.naladala at intel.com>
> Subject: [PATCH i-g-t 1/2] tests/intel/kms_pm_dc:Add basic checks achive
> deep-pkgc
> 
> This patch will add the connector checks and test requirement checks for
> deep-pkgc
> 
> Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
> ---
>  tests/intel/kms_pm_dc.c | 35 +++++++++++++++++++++++++----------
>  1 file changed, 25 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c index
> e1318bfa6..bca5bfa58 100644
> --- a/tests/intel/kms_pm_dc.c
> +++ b/tests/intel/kms_pm_dc.c
> @@ -592,31 +592,46 @@ static unsigned int read_pkgc_counter(int
> debugfs_root_fd)  static void test_deep_pkgc_state(data_t *data)  {
>  	unsigned int pre_val = 0, cur_val = 0;
> -	time_t start = time(NULL), duration = 2, delay;
> +	time_t start = time(NULL), duration = 2, vb_delay, delay;
>  	enum pipe pipe;
>  	bool pkgc_flag = false;
> -	bool vrr_supported = false, flip = true;
> +	bool flip = true;
> 
>  	igt_display_t *display = &data->display;
>  	igt_plane_t *primary;
>  	igt_output_t *output = NULL;
> 
>  	for_each_pipe_with_valid_output(display, pipe, output) {
> -		/* Check VRR capabilities before setting up */
> +		/* Deep-Pkgc is a power feature it will support only on eDP
> +		 * and low power pipes so add a check for the eDP connector
> +		 */


Start the multiline comments in the next line as shown below
/*
  * Deep-Pkgc is a power
Also can you fix the comment to say "it will be supported on ..."
no need to mention so add a check as it is understood by your code.

> +		if (output->config.connector->connector_type !=
> DRM_MODE_CONNECTOR_eDP)
> +			igt_skip("No eDP output found, skipping the test.\n");
> +		/* DEEP PKG_C_LATENCY can be configured only for fixed
> refresh rates.
> +		 * It will be support NON-VRR or VRR with
> Vmax=Vmin=Flipline.
> +		 * Disable the VRR if panel supports VRR.
> +		 */

Same thing here for multiline comment 
Also fix "it will support ..."
Remove Disable VRR panel comment as its understood from your code.

>  		if (igt_output_has_prop(output,
> IGT_CONNECTOR_VRR_CAPABLE) &&
>  		    igt_output_get_prop(output,
> IGT_CONNECTOR_VRR_CAPABLE)) {
> -			vrr_supported = true;
> -			break;
> +			igt_pipe_set_prop_value(display, pipe,
> +					IGT_CRTC_VRR_ENABLED, false);

Shouldn't this be aligned with the opening brackets for readability

> +			igt_assert(igt_display_try_commit_atomic(display,
> +
> 	DRM_MODE_ATOMIC_ALLOW_MODESET,
> +						NULL) == 0);
>  		}

Same here

>  	}
> 
> -	/* Skip the test if no VRR capable output is found */
> -	if (!vrr_supported)
> -		igt_skip("No VRR capable output found, skipping the
> test.\n");
> -
>  	igt_display_reset(display);
> -
>  	igt_output_set_pipe(output, pipe);
> +	for_each_connector_mode(output) {
> +		data->mode = &output->config.connector->modes[j__];
> +		vb_delay = 1 * (MSECS / (data->mode->vrefresh));
> +		/* At least 5ms vblank time required to program higher
> +		 * watermark levels
> +		 */

Fix multiline comment as mentioned above

> +		if (vb_delay >  5000)
> +			break;
> +	}

If it is at least 5ms shouldn't the condition be >= 5000 also 5 * MSEC would be more readable

Regards,
Suraj Kandpal
> 
>  	data->output = output;
>  	data->mode = igt_output_get_mode(output);
> --
> 2.43.0



More information about the igt-dev mailing list