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

Bhanuprakash Modem bhanuprakash.modem at intel.com
Mon Nov 28 10:52:40 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.

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 68c4f264..41e88818 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -215,11 +215,13 @@ 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 = (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 igt-dev mailing list