[PATCH i-g-t 2/2] tests/intel/kms_pm_dc: Improvise the deep-pkgc
B, Jeevan
jeevan.b at intel.com
Mon Jul 15 04:48:23 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 2/2] tests/intel/kms_pm_dc: Improvise the deep-pkgc
>
> Add tuned delays to check deep-pkgc pkgc10 counters
>
> Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
> ---
> tests/intel/kms_pm_dc.c | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c index
> bca5bfa58..2155b4625 100644
> --- a/tests/intel/kms_pm_dc.c
> +++ b/tests/intel/kms_pm_dc.c
> @@ -592,7 +592,7 @@ 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, vb_delay, delay;
> + time_t start = time(NULL), duration = 4, vb_delay, delay;
> enum pipe pipe;
> bool pkgc_flag = false;
> bool flip = true;
> @@ -618,6 +618,7 @@ static void test_deep_pkgc_state(data_t *data)
> igt_assert(igt_display_try_commit_atomic(display,
>
> DRM_MODE_ATOMIC_ALLOW_MODESET,
> NULL) == 0);
> + break;
> }
> }
>
> @@ -638,23 +639,26 @@ static void test_deep_pkgc_state(data_t *data)
> setup_videoplayback(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));
> -
> igt_plane_set_fb(primary, &data->fb_rgb);
> igt_display_commit(&data->display);
> + /* Waiting for the vblank to sync the frame time */
> + igt_wait_for_vblank_count(data->drm_fd, data-
> >display.pipes[pipe].crtc_offset, 1);
> + /* measure delay for half frame */
> + delay = vb_delay*0.5;
> + usleep(delay);
> + pre_val = read_pkgc_counter(data->debugfs_root_fd);
>
> while (time(NULL) - start < duration) {
> flip = !flip;
> igt_plane_set_fb(primary, flip ? &data->fb_rgb : &data->fb_rgr);
> igt_display_commit(&data->display);
> -
> - cur_val = read_pkgc_counter(data->debugfs_root_fd);
> + /* For every 1ms polling for pkgc10 counter change till 1 frame
> time */
> + igt_wait((cur_val = read_pkgc_counter(data->debugfs_root_fd))
> > pre_val,
> + vb_delay*2, 5);
> if (cur_val > pre_val) {
> pkgc_flag = true;
> break;
> }
> - usleep(delay);
> }
>
> cleanup_dc3co_fbs(data);
> --
Please merge the patches into one.
> 2.43.0
More information about the igt-dev
mailing list