diff options
author | Sean Paul <seanpaul@chromium.org> | 2024-02-29 10:42:50 +0530 |
---|---|---|
committer | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2024-03-04 10:18:19 +0530 |
commit | fe3411eea0f6c77abba02e64188df609cdf14f2e (patch) | |
tree | 15e488a462c565155730519c6a36eee4f157a935 /tests/kms_vrr.c | |
parent | 183d5a69dbed938893de2059e22f5668b2776dff (diff) |
tests/kms_vrr: Add a max/min test to oscillate between rates
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
v5: (Bhanu)
- Adjust Pass/Fail criteria
- Tweak min rate for Intel h/w
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>
Diffstat (limited to 'tests/kms_vrr.c')
-rw-r--r-- | tests/kms_vrr.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 6d516d8fc..15c62b34b 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 { @@ -537,7 +542,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, @@ -553,6 +558,19 @@ test_basic(data_t *data, enum pipe pipe, igt_output_t *output, uint32_t flags) (range.min - 10), rate[0], result); } + if (flags & TEST_MAXMIN) { + unsigned int range_min = + /* For Intel h/w tweak the min rate, as h/w will terminate the vblank at Vmax. */ + is_intel_device(data->drm_fd) ? (range.min + 2) : range.min; + uint64_t maxmin_rates[] = {vtest_ns.max, rate_from_refresh(range_min)}; + + result = flip_and_measure(data, output, pipe, maxmin_rates, 2, data->duration_ns); + igt_assert_f(result > 75, + "Refresh rates (%u/%u Hz) %"PRIu64"ns/%"PRIu64"ns: Target VRR on threshold not reached, 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 @@ -802,6 +820,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); |