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: Sean Paul <seanpaul@chromium.org>
Subject: [i-g-t v4 8/9] tests/kms_vrr: Add a max/min test to oscillate between rates
Date: Tue, 19 Dec 2023 12:54:02 +0530	[thread overview]
Message-ID: <20231219072402.148738-1-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20231219020613.113772-9-bhanuprakash.modem@intel.com>

From: Sean Paul <seanpaul@chromium.org>

The new MAXMIN test will oscillate between the max and min
refresh rates every frame to stress test the panel. This is
useful for manual profiling of flicker.

v2:
- Added to the set
v3: (Bhanu)
- Rebase
- Add testplan documentation
v4: (Bhanu)
- Don't execute other stuff in max-min

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_vrr.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 7640ee0b6..fb812041e 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -66,6 +66,10 @@
  * Description: Test to switch RR seamlessly without modeset.
  * Functionality: adaptive_sync, drrs
  *
+ * SUBTEST: max-min
+ * Description: Oscillates between highest and lowest refresh each frame for
+ *              manual flicker profiling
+ *
  * SUBTEST: negative-basic
  * Description: Make sure that VRR should not be enabled on the Non-VRR panel.
  */
@@ -86,7 +90,8 @@ enum {
 	TEST_SEAMLESS_VRR = 1 << 4,
 	TEST_SEAMLESS_DRRS = 1 << 5,
 	TEST_FASTSET = 1 << 6,
-	TEST_NEGATIVE = 1 << 7,
+	TEST_MAXMIN = 1 << 7,
+	TEST_NEGATIVE = 1 << 8,
 };
 
 enum {
@@ -524,7 +529,7 @@ test_basic(data_t *data, enum pipe pipe, igt_output_t *output, uint32_t flags)
 			     (range.max + 5), rate[0], result);
 	}
 
-	if (flags & ~TEST_NEGATIVE) {
+	if (flags & ~(TEST_NEGATIVE | TEST_MAXMIN)) {
 		rate[0] = vtest_ns.rate_ns;
 		result = flip_and_measure(data, output, pipe, rate, 1, data->duration_ns);
 		igt_assert_f(result > 75,
@@ -540,6 +545,16 @@ test_basic(data_t *data, enum pipe pipe, igt_output_t *output, uint32_t flags)
 			     (range.min - 5), rate[0], result);
 	}
 
+	if (flags & TEST_MAXMIN) {
+		uint64_t maxmin_rates[] = {vtest_ns.max, vtest_ns.min};
+
+		result = flip_and_measure(data, output, pipe, maxmin_rates, 2, data->duration_ns);
+		igt_assert_f(result < 50,
+			     "Refresh rates (%u/%u Hz) %"PRIu64"ns/%"PRIu64"ns: Target VRR on threshold exceeded, result was %u%%\n",
+			     range.max, range.min, maxmin_rates[0], maxmin_rates[1], result);
+		return;
+	}
+
 	/*
 	 * If we request VRR on a non-VRR panel, it is unlikely to reject the
 	 * modeset. And the expected behavior is the same as disabling VRR on
@@ -781,6 +796,11 @@ igt_main_args("drs:", long_opts, help_str, opt_handler, &data)
 	igt_subtest_with_dynamic("negative-basic")
 		run_vrr_test(&data, test_basic, TEST_NEGATIVE);
 
+	igt_describe("Oscillates between highest and lowest refresh each frame for manual "
+		     "flicker profiling");
+	igt_subtest_with_dynamic("max-min")
+		run_vrr_test(&data, test_basic, TEST_MAXMIN);
+
 	igt_subtest_group {
 		igt_fixture
 			igt_require_intel(data.drm_fd);
-- 
2.40.0

  reply	other threads:[~2023-12-19  7:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  2:06 [i-g-t v3 0/9] tests/kms_vrr: Modify kms_vrr to allow flicker profiling Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 1/9] tests/kms_vrr: Move fb0 and fb1 to an array Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 2/9] tests/kms_vrr: Move vtest_ns into data_t Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 3/9] tests/kms_vrr: Allow test rate to be altered from the command line Bhanuprakash Modem
2023-12-19  4:56   ` [i-g-t v4 " Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 4/9] tests/kms_vrr: Allow test duration to be specified " Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 5/9] tests/kms_vrr: Change the pattern displayed in the test Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 6/9] tests/kms_vrr: Add ability to flip static image for flicker profiling Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 7/9] tests/kms_vrr: Allow for multiple rates in a test Bhanuprakash Modem
2023-12-19  2:06 ` [i-g-t v3 8/9] tests/kms_vrr: Add a max/min test to oscillate between rates Bhanuprakash Modem
2023-12-19  7:24   ` Bhanuprakash Modem [this message]
2023-12-19  2:06 ` [i-g-t v3 9/9] HAX/DO_NOT_MERGE: Test VRR only in BAT Bhanuprakash Modem
2023-12-19  6:07 ` ✓ CI.xeBAT: success for tests/kms_vrr: Modify kms_vrr to allow flicker profiling (rev4) Patchwork
2023-12-19  6:18 ` ✗ Fi.CI.BAT: failure " Patchwork
2023-12-19  8:45 ` ✗ Fi.CI.BAT: failure for tests/kms_vrr: Modify kms_vrr to allow flicker profiling (rev5) Patchwork
2023-12-19  8:52 ` ✓ CI.xeBAT: success " 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=20231219072402.148738-1-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=seanpaul@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