Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: santhosh.reddy.guddati@intel.com,
	Naladala Ramanaidu <ramanaidu.naladala@intel.com>
Subject: [PATCH i-g-t v2 1/2] tests/kms_vrr: Start virtual RR test above midpoint to avoid mode fallback
Date: Thu,  6 Nov 2025 10:17:32 +0530	[thread overview]
Message-ID: <20251106044733.1502397-2-ramanaidu.naladala@intel.com> (raw)
In-Reply-To: <20251106044733.1502397-1-ramanaidu.naladala@intel.com>

Starting from low_rr + step_size could cause the driver to fall back
to a lower physical mode due to proximity to the lower bound of the
VRR range. This results in an unintended clock change, which violates
the expectation of seamless VRR behavior.

To address this, the test now starts from above the midpoint of the
VRR range when multiple modes are available. This ensures the virtual
refresh rate remains safely within the active mode's VRR range and
avoids triggering a mode switch.

v2: Change logic to ternary operation. (Santhosh)

Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
---
 tests/kms_vrr.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index bcb756202..57691ccd5 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -851,7 +851,16 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu
 	/* Switch to Virtual RR */
 	virtual_mode = *igt_output_get_mode(output);
 
-	for (vrefresh = data->range.min + step_size; vrefresh < data->range.max; vrefresh += step_size) {
+	/*
+	 * Start virtual RR testing from above the midpoint of the VRR range when multiple
+	 * modes are available. This avoids the driver mode adjustment. which can cause an
+	 * unintended clock change.
+	 */
+	vrefresh = (output->config.connector->count_modes > 1) ?
+		   (((data->range.max + data->range.min) / 2) + step_size) :
+		   data->range.min + step_size;
+
+	for ( ; vrefresh < data->range.max; vrefresh += step_size) {
 		virtual_rr_vrr_range_mode(&virtual_mode, vrefresh);
 
 		igt_info("Requesting Virtual Mode with Refresh Rate (%u Hz): \n", vrefresh);
-- 
2.43.0


  reply	other threads:[~2025-11-06  4:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  4:47 [PATCH i-g-t v2 0/2] LRR test to start above midpoint for multi-mode panels Naladala Ramanaidu
2025-11-06  4:47 ` Naladala Ramanaidu [this message]
2025-11-06  4:59   ` [PATCH i-g-t v2 1/2] tests/kms_vrr: Start virtual RR test above midpoint to avoid mode fallback Reddy Guddati, Santhosh
2025-11-06  4:47 ` [PATCH i-g-t v2 2/2] HAX patch do not merge Naladala Ramanaidu
2025-11-06  7:40 ` ✗ i915.CI.BAT: failure for LRR test to start above midpoint for multi-mode panels (rev2) Patchwork
2025-11-06  7:42 ` ✓ Xe.CI.BAT: success " Patchwork
2025-11-07  0:55 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-07  8:54 ` ✓ i915.CI.BAT: success " Patchwork
2025-11-07  9:00 ` Patchwork
2025-11-07  9:13 ` Patchwork
2025-11-07 23:43 ` ✗ i915.CI.Full: failure " Patchwork
2025-11-10  8:53 ` ✓ i915.CI.Full: success " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-11-06  4:41 [PATCH i-g-t v1] tests/kms_vrr: Fix potential NULL dereference in test_cleanup Naladala Ramanaidu
2025-11-06  4:41 ` [PATCH i-g-t v2 1/2] tests/kms_vrr: Start virtual RR test above midpoint to avoid mode fallback Naladala Ramanaidu

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=20251106044733.1502397-2-ramanaidu.naladala@intel.com \
    --to=ramanaidu.naladala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=santhosh.reddy.guddati@intel.com \
    /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