Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	Manasi Navare <navaremanasi@chromium.org>
Subject: [PATCH i-g-t 2/3] tests/kms_vrr: Fix hardcoded step size
Date: Thu,  6 Jun 2024 11:22:04 +0530	[thread overview]
Message-ID: <20240606055205.3296434-3-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240606055205.3296434-1-bhanuprakash.modem@intel.com>

In seamless-virtual subtest we are trying different Vrefresh
values between Vmin & Vmax by incrementing the Vrefresh by
by 10 Hz (hardcoded).

With this approach:
- We'll achieve less no. of refresh rates if VRR range is low
    Ex: We can achieve only 1 step between 40 to 60 Hz.
- Execution time will increase in case of high VRR range.
    Ex: We need 30 steps to reach 60 Hz to 360 Hz.

Instead of hardcoding the step size (10 Hz), allow test to
execute fixed number of steps (say 5 steps to reach Vmin to
Vmax) will guarantee to test (5) different refresh rates
between Vmin & Vmax irrespective of the VRR range.

Cc: Manasi Navare <navaremanasi@chromium.org>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_vrr.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 9245305f8..dec49eb12 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -665,6 +665,7 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu
 	uint32_t result;
 	unsigned int vrefresh;
 	uint64_t rate[] = {0};
+	uint32_t step_size;
 
 	igt_info("Use HIGH_RR Mode as default\n");
 	kmstest_dump_mode(&data->switch_modes[HIGH_RR_MODE]);
@@ -684,8 +685,14 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu
 		     "Refresh rate (%u Hz) %"PRIu64"ns: Target threshold not reached, result was %u%%\n",
 		     data->switch_modes[HIGH_RR_MODE].vrefresh, rate[0], result);
 
+	/*
+	 * Calculate step size by considering the no. of steps required to
+	 * reach Vmin to Vmax as 5.
+	 */
+	step_size = (data->range.max - data->range.min) / 5;
+
 	/* Switch to Virtual RR */
-	for (vrefresh = data->range.min + 10; vrefresh < data->range.max; vrefresh += 10) {
+	for (vrefresh = data->range.min + step_size; vrefresh < data->range.max; vrefresh += step_size) {
 		drmModeModeInfo virtual_mode = virtual_rr_vrr_range_mode(output, vrefresh);
 
 		igt_info("Requesting Virtual Mode with Refresh Rate (%u Hz): \n", vrefresh);
-- 
2.43.2


  parent reply	other threads:[~2024-06-06  5:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  5:52 [PATCH i-g-t 0/3] VRR test cleanup Bhanuprakash Modem
2024-06-06  5:52 ` [PATCH i-g-t 1/3] tests/kms_vrr: Skip low RR mode check for seamless-virtual subtest Bhanuprakash Modem
2024-06-06  5:52 ` Bhanuprakash Modem [this message]
2024-06-06  5:52 ` [PATCH i-g-t 3/3] HAX: Run VRR subtests in BAT Bhanuprakash Modem
2024-06-06  6:35 ` ✓ CI.xeBAT: success for VRR test cleanup Patchwork
2024-06-06  6:36 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-06-06 14:45 ` ✗ CI.xeFULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240606055205.3296434-3-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=navaremanasi@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox