All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [i-g-t] tests/kms_vrr: Fix the usage of VRR max refresh rate
Date: Mon, 28 Nov 2022 16:22:40 +0530	[thread overview]
Message-ID: <20221128105240.366559-1-bhanuprakash.modem@intel.com> (raw)

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@linux.intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@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

             reply	other threads:[~2022-11-28 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 10:52 Bhanuprakash Modem [this message]
2022-11-28 11:27 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_vrr: Fix the usage of VRR max refresh rate Patchwork
2022-11-28 13:05 ` [igt-dev] ✗ Fi.CI.IGT: 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=20221128105240.366559-1-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.