[i-g-t] tests/kms_vrr: Fix the usage of VRR max refresh rate

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Nov 28 14:12:01 UTC 2022


The max refresh rate of VRR is likely to be lower than the Vrefresh
of the selected mode. So, to test the VRR choose vrr_max as max
refresh rate if Vrefresh is greater than vrr_max, otherwise Vrefresh.

V2: Fix crash in negative tests

Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Manasi Navare <manasi.d.navare at intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_vrr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 68c4f264..b2049dd9 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -215,11 +215,14 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
 
 	/* Override mode with max vrefresh.
 	 *   - vrr_min range should be less than the override mode vrefresh.
-	 *   - Limit the vrr_max range with the override mode vrefresh.
+	 *   - Limit the vrr_max range with the override mode vrefresh if
+	 *     vrr_max is greater than vrefresh else vrefresh.
 	 */
 	mode = output_mode_with_maxrate(output, data->range.max);
 	igt_require(mode.vrefresh > data->range.min);
-	data->range.max = mode.vrefresh;
+	data->range.max = (vrr_capable(output) &&
+			  (mode.vrefresh > data->range.max)) ?
+				data->range.max : mode.vrefresh;
 	igt_output_override_mode(output, &mode);
 
 	/* Prepare resources */
-- 
2.38.1



More information about the Intel-gfx-trybot mailing list