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, ville.syrjala@linux.intel.com,
	mitulkumar.ajitkumar.golani@intel.com
Subject: [igt-dev] [i-g-t V6 06/10] tests/kms_vrr: Add a helper to get the low refresh mode
Date: Thu,  7 Dec 2023 12:18:56 +0530	[thread overview]
Message-ID: <20231207064900.3328723-7-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20231207064900.3328723-1-bhanuprakash.modem@intel.com>

To switch the refresh rate seamlessly, add a new helper to
identify the mode with the same resolution but low vrefresh
and clock.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_vrr.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index db82cd008..f3cd18dcd 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -166,6 +166,24 @@ output_mode_with_maxrate(igt_output_t *output, unsigned int vrr_max)
 	return mode;
 }
 
+static drmModeModeInfo
+low_rr_mode_with_same_res(igt_output_t *output, unsigned int vrr_min)
+{
+	int i;
+	drmModeConnectorPtr connector = output->config.connector;
+	drmModeModeInfo mode = *igt_output_get_mode(output);
+
+	for (i = 0; i < connector->count_modes; i++)
+		if (connector->modes[i].hdisplay == mode.hdisplay &&
+		    connector->modes[i].vdisplay == mode.vdisplay &&
+		    connector->modes[i].clock < mode.clock &&
+		    connector->modes[i].vrefresh < mode.vrefresh &&
+		    connector->modes[i].vrefresh >= vrr_min)
+			mode = connector->modes[i];
+
+	return mode;
+}
+
 /* Read min and max vrr range from the connector debugfs. */
 static range_t
 get_vrr_range(data_t *data, igt_output_t *output)
-- 
2.40.0

  parent reply	other threads:[~2023-12-07  7:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  6:48 [igt-dev] [i-g-t V6 00/10] tests/kms_vrr: Add new subtest to switch RR without modeset Bhanuprakash Modem
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 01/10] tests/kms_vrr: Use lib helper to print connector modes Bhanuprakash Modem
2023-12-07 14:08   ` Golani, Mitulkumar Ajitkumar
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 02/10] tests/kms_vrr: Clear VRR before exit Bhanuprakash Modem
2023-12-07 14:12   ` Golani, Mitulkumar Ajitkumar
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 03/10] tests/kms_vrr: Move all config constaints to new function Bhanuprakash Modem
2023-12-07 16:04   ` Golani, Mitulkumar Ajitkumar
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 04/10] tests/kms_vrr: Fix bigjoiner constraint Bhanuprakash Modem
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 05/10] tests/kms_vrr: Fix the logic to calculate expected rate Bhanuprakash Modem
2023-12-11  6:56   ` Golani, Mitulkumar Ajitkumar
2023-12-07  6:48 ` Bhanuprakash Modem [this message]
2023-12-07 14:42   ` [i-g-t V6 06/10] tests/kms_vrr: Add a helper to get the low refresh mode Golani, Mitulkumar Ajitkumar
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 07/10] tests/kms_vrr: Add new subtest to switch RR without modeset Bhanuprakash Modem
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 08/10] tests/kms_vrr: Add new subtest for DRRS " Bhanuprakash Modem
2023-12-11  8:35   ` Golani, Mitulkumar Ajitkumar
2023-12-11 11:18     ` Modem, Bhanuprakash
2023-12-07  6:48 ` [igt-dev] [i-g-t V6 09/10] tests/kms_vrr: New subtest for toggle VRR during fastsets Bhanuprakash Modem
2023-12-07 10:40   ` Srinivas, Vidya
2023-12-11  8:51     ` Golani, Mitulkumar Ajitkumar
2023-12-07  6:49 ` [igt-dev] [i-g-t V6 10/10] HAX: DO_NOT_MERGE: test only vrr tests Bhanuprakash Modem
2023-12-07  7:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_vrr: Add new subtest to switch RR without modeset (rev7) Patchwork
2023-12-07  8:01 ` [igt-dev] ✗ CI.xeBAT: " 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=20231207064900.3328723-7-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=mitulkumar.ajitkumar.golani@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /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