From: Lee Shawn C <shawn.c.lee@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Lee Shawn C <shawn.c.lee@intel.com>,
Naladala Ramanaidu <ramanaidu.naladala@intel.com>
Subject: [PATCH v11 2/2] tests/kms_vrr: add support for full range refresh rate testing
Date: Mon, 23 Nov 2026 07:24:09 +0000 [thread overview]
Message-ID: <20261123072409.294287-3-shawn.c.lee@intel.com> (raw)
In-Reply-To: <20261123072409.294287-1-shawn.c.lee@intel.com>
Currently, kms_vrr tests fixed step increments within the VRR range.
To better validate hardware stability and potential issues across the
entire spectrum, this patch adds a 'full-range' testing mode.
When the full-range flag is enabled, the test will:
1. Iterate from the maximum to the minimum refresh rate (stepping by 1).
2. For standard testing, maintain the existing behavior of incrementing
from minimum to maximum using the defined step size.
v2: Fix build failure by adding documentation for the new subtest.
v3: Remove unnecessary '!!' operator when assigning to bool.
v4: Add full-range (top-down/bottom-up) subtests to verify all supported
RR within VRR range.
v5: Fix build failure for the new subtest.
v6: Revert commit 862eb176244f ("tests/kms_vrr: Start virtual RR test
above midpoint to avoid mode fallback").
v7: Not allow to run full range test if eDP display did not support
multiple refresh rate.
v8: Add is_pixel_clock_identical() helper.
v9: Add ALLOW_MODESET flag to the initial commit request.
v10: Rebase on top of latest upstream master (commit 05c13a14f7f8).
v11: Differentiate top-down/bottom-up subtest descriptions, and use
igt_skip() instead of a silent return for panels without multiple
refresh rate support.
Cc: Naladala Ramanaidu <ramanaidu.naladala@intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
---
tests/kms_vrr.c | 115 ++++++++++++++++++++++++++++++++++++++----------
1 file changed, 92 insertions(+), 23 deletions(-)
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 0102afe203dc..3294db8ff4e3 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -64,9 +64,13 @@
* Description: Test to switch RR seamlessly without modeset.
* Mega feature: General Display Features
*
- * SUBTEST: seamless-rr-switch-virtual
- * Description: Test to create a Virtual Mode in VRR range and switch to it
- * without a full modeset.
+ * SUBTEST: seamless-rr-switch-virtual-top-down
+ * Description: Vrr seamless refresh rate switch for virtual modes, traversing
+ * the full range from the highest to the lowest refresh rate.
+ *
+ * SUBTEST: seamless-rr-switch-virtual-bottom-up
+ * Description: Vrr seamless refresh rate switch for virtual modes, traversing
+ * the full range from the lowest to the highest refresh rate.
*
* SUBTEST: lobf
* Description: Test to validate link-off between active frames in non-psr
@@ -115,9 +119,10 @@ enum {
TEST_FLIPLINE = 1 << 3,
TEST_SEAMLESS_VRR = 1 << 4,
TEST_SEAMLESS_DRRS = 1 << 5,
- TEST_SEAMLESS_VIRTUAL_RR = 1 << 6,
- TEST_FASTSET = 1 << 7,
- TEST_MAXMIN = 1 << 8,
+ TEST_SEAMLESS_VIRTUAL_RR_TOP_DOWN = 1 << 6,
+ TEST_SEAMLESS_VIRTUAL_RR_BOTTOM_UP = 1 << 7,
+ TEST_FASTSET = 1 << 8,
+ TEST_MAXMIN = 1 << 9,
TEST_LINK_OFF = 1 << 10,
TEST_NEGATIVE = 1 << 11,
TEST_FORCE_RR = 1 << 12,
@@ -296,13 +301,56 @@ low_rr_mode_with_same_res(igt_output_t *output, unsigned int vrr_min)
return mode;
}
-static void
-virtual_rr_vrr_range_mode(drmModeModeInfo *mode, float virtual_refresh_rate)
+static bool
+virtual_rr_vrr_range_mode(data_t *data, drmModeModeInfo *mode, float virtual_refresh_rate)
{
uint64_t clock_hz = mode->clock * 1000;
+ uint16_t virtual_vtotal;
+
+ virtual_vtotal = clock_hz / (mode->htotal * virtual_refresh_rate);
+ if (is_intel_device(data->drm_fd) && virtual_vtotal > 8192) {
+ igt_info("VTotal (%d) already exceed 8192 at %fHz\n",
+ virtual_vtotal, virtual_refresh_rate);
+ return false;
+ }
- mode->vtotal = clock_hz / (mode->htotal * virtual_refresh_rate);
+ mode->vsync_start = virtual_vtotal - (mode->vtotal - mode->vsync_start);
+ mode->vsync_end = virtual_vtotal - (mode->vtotal - mode->vsync_end);
+ mode->vtotal = virtual_vtotal;
mode->vrefresh = virtual_refresh_rate;
+ return true;
+}
+
+static bool
+is_edp_multiple_rr_panel(igt_output_t *output)
+{
+ drmModeConnector *connector = output->config.connector;
+ drmModeModeInfo *first;
+
+ if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) {
+ igt_debug("Connector %s is not eDP\n", output->name);
+ return false;
+ }
+
+ if (!connector->count_modes)
+ return false;
+
+ first = &connector->modes[0];
+
+ for (int i = 1; i < connector->count_modes; i++) {
+ drmModeModeInfo *mode = &connector->modes[i];
+
+ if (mode->vrefresh == first->vrefresh)
+ continue;
+
+ igt_debug("Multiple RR panel: %u kHz/%u Hz vs %u kHz/%u Hz (%s clock)\n",
+ first->clock, first->vrefresh,
+ mode->clock, mode->vrefresh,
+ mode->clock == first->clock ? "same" : "different");
+ return true;
+ }
+
+ return false;
}
/* Read min and max vrr range from the connector debugfs. */
@@ -991,11 +1039,16 @@ test_seamless_virtual_rr_basic(data_t *data, igt_crtc_t *crtc,
igt_output_t *output, uint32_t flags)
{
uint32_t result;
- unsigned int vrefresh;
+ int vrefresh;
uint64_t rate[] = {0};
- uint32_t step_size;
+ int start, end, step;
drmModeModeInfo virtual_mode;
+ if (!is_edp_multiple_rr_panel(output)) {
+ igt_skip("%s: This panel does not support seamless virtual RR switching.\n",
+ igt_output_name(output));
+ }
+
igt_info("Use HIGH_RR Mode as default\n");
kmstest_dump_mode(&data->switch_modes[HIGH_RR_MODE]);
@@ -1007,29 +1060,39 @@ test_seamless_virtual_rr_basic(data_t *data, igt_crtc_t *crtc,
* switch to highest refresh rate mode.
*/
igt_output_override_mode(output, &data->switch_modes[HIGH_RR_MODE]);
- igt_assert(igt_display_try_commit_atomic(&data->display, DRM_MODE_PAGE_FLIP_EVENT, NULL) == 0);
+ igt_assert(igt_display_try_commit_atomic(&data->display,
+ DRM_MODE_PAGE_FLIP_EVENT |
+ DRM_MODE_ATOMIC_ALLOW_MODESET,
+ NULL) == 0);
result = flip_and_measure(data, output, rate, 1, TEST_DURATION_NS);
igt_assert_f(result > 75,
"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 */
virtual_mode = *igt_output_get_mode(output);
- for (vrefresh = data->range.min + step_size; vrefresh < data->range.max; vrefresh += step_size) {
- virtual_rr_vrr_range_mode(&virtual_mode, vrefresh);
+ if (flags & TEST_SEAMLESS_VIRTUAL_RR_TOP_DOWN) {
+ start = data->range.max;
+ end = data->range.min;
+ step = -1;
+ } else {
+ start = data->range.min;
+ end = data->range.max;
+ step = 1;
+ }
+
+ for (vrefresh = start; step > 0 ? vrefresh <= end : vrefresh >= end; vrefresh += step) {
+ if (!virtual_rr_vrr_range_mode(data, &virtual_mode, vrefresh))
+ continue;
igt_info("Requesting Virtual Mode with Refresh Rate (%u Hz): \n", vrefresh);
kmstest_dump_mode(&virtual_mode);
igt_output_override_mode(output, &virtual_mode);
+
+ igt_assert(igt_display_try_commit_atomic(&data->display, DRM_MODE_ATOMIC_TEST_ONLY, NULL) == 0);
igt_assert(igt_display_try_commit_atomic(&data->display, 0, NULL) == 0);
rate[0] = igt_kms_frame_time_from_vrefresh(vrefresh);
@@ -1390,9 +1453,15 @@ int igt_main_args("drs:", long_opts, help_str, opt_handler, &data)
igt_subtest_with_dynamic("flip-basic-fastset")
run_vrr_test(&data, test_basic, TEST_FASTSET);
- igt_describe("Test to switch to any custom virtual mode in VRR range without modeset.");
- igt_subtest_with_dynamic("seamless-rr-switch-virtual")
- run_vrr_test(&data, test_seamless_virtual_rr_basic, TEST_SEAMLESS_VIRTUAL_RR);
+ igt_describe("Test to switch to all virtual modes in VRR range without modeset.");
+ igt_subtest_with_dynamic("seamless-rr-switch-virtual-top-down")
+ run_vrr_test(&data, test_seamless_virtual_rr_basic,
+ TEST_SEAMLESS_VIRTUAL_RR_TOP_DOWN);
+
+ igt_describe("Test to switch to all virtual modes in VRR range without modeset.");
+ igt_subtest_with_dynamic("seamless-rr-switch-virtual-bottom-up")
+ run_vrr_test(&data, test_seamless_virtual_rr_basic,
+ TEST_SEAMLESS_VIRTUAL_RR_BOTTOM_UP);
igt_describe("Test to validate the link-off between active frames in "
"non-PSR operation.");
--
2.53.0
next prev parent reply other threads:[~2026-11-23 7:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 7:24 [PATCH v11 0/2] tests/kms_vrr: Add full-range refresh rate testing Lee Shawn C
2026-11-23 7:24 ` [PATCH v11 1/2] Revert "tests/kms_vrr: Start virtual RR test above midpoint to avoid mode fallback" Lee Shawn C
2026-11-23 7:24 ` Lee Shawn C [this message]
2026-11-24 2:48 ` ✓ Xe.CI.BAT: success for tests/kms_vrr: Add full-range refresh rate testing (rev4) Patchwork
2026-11-24 3:10 ` ✓ i915.CI.BAT: " Patchwork
2026-11-24 5:06 ` ✗ Xe.CI.FULL: failure " 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=20261123072409.294287-3-shawn.c.lee@intel.com \
--to=shawn.c.lee@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ramanaidu.naladala@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