From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
Manasi Navare <navaremanasi@chromium.org>,
Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Subject: [i-g-t 3/4] tests/kms_vrr: Cleanup in creating the virtual mode
Date: Fri, 21 Jun 2024 14:17:10 +0530 [thread overview]
Message-ID: <20240621084711.68444-4-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240621084711.68444-1-bhanuprakash.modem@intel.com>
Cleanup the function to create the virtual mode, so
that it could be re-used.
Cc: Manasi Navare <navaremanasi@chromium.org>
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
tests/kms_vrr.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 2ea90cd8e..6f90f4729 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -229,16 +229,13 @@ low_rr_mode_with_same_res(igt_output_t *output, unsigned int vrr_min)
return mode;
}
-static drmModeModeInfo
-virtual_rr_vrr_range_mode(igt_output_t *output, unsigned int virtual_refresh_rate)
+static void
+virtual_rr_vrr_range_mode(drmModeModeInfo *mode, unsigned int virtual_refresh_rate)
{
- drmModeModeInfo mode = *igt_output_get_mode(output);
- uint64_t clock_hz = mode.clock * 1000;
+ uint64_t clock_hz = mode->clock * 1000;
- mode.vtotal = clock_hz / (mode.htotal * virtual_refresh_rate);
- mode.vrefresh = virtual_refresh_rate;
-
- return mode;
+ mode->vtotal = clock_hz / (mode->htotal * virtual_refresh_rate);
+ mode->vrefresh = virtual_refresh_rate;
}
static bool
@@ -741,6 +738,7 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu
unsigned int vrefresh;
uint64_t rate[] = {0};
uint32_t step_size;
+ drmModeModeInfo virtual_mode;
igt_info("Use HIGH_RR Mode as default\n");
kmstest_dump_mode(&data->switch_modes[HIGH_RR_MODE]);
@@ -767,8 +765,10 @@ test_seamless_virtual_rr_basic(data_t *data, enum pipe pipe, igt_output_t *outpu
step_size = (data->range.max - data->range.min) / 5;
/* Switch to Virtual RR */
+ virtual_mode = *igt_output_get_mode(output);
+
for (vrefresh = data->range.min + step_size; vrefresh < data->range.max; vrefresh += step_size) {
- drmModeModeInfo virtual_mode = virtual_rr_vrr_range_mode(output, vrefresh);
+ virtual_rr_vrr_range_mode(&virtual_mode, vrefresh);
igt_info("Requesting Virtual Mode with Refresh Rate (%u Hz): \n", vrefresh);
kmstest_dump_mode(&virtual_mode);
--
2.43.2
next prev parent reply other threads:[~2024-06-21 8:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 8:47 [i-g-t 0/4] VRR test Cleanup Bhanuprakash Modem
2024-06-21 8:47 ` [i-g-t 1/4] tests/kms_vrr: Skip low RR mode check for seamless-virtual subtest Bhanuprakash Modem
2024-06-24 9:26 ` Golani, Mitulkumar Ajitkumar
2024-06-21 8:47 ` [i-g-t 2/4] tests/kms_vrr: Fix hardcoded step size Bhanuprakash Modem
2024-06-24 12:12 ` Golani, Mitulkumar Ajitkumar
2024-06-21 8:47 ` Bhanuprakash Modem [this message]
2024-06-24 4:06 ` [i-g-t V2 3/4] tests/kms_vrr: Cleanup in creating the virtual mode Bhanuprakash Modem
2024-07-03 5:11 ` Golani, Mitulkumar Ajitkumar
2024-06-21 8:47 ` [i-g-t 4/4] tests/kms_vrr: Fix virtual mode for CMRR subtest Bhanuprakash Modem
2024-07-03 5:20 ` Golani, Mitulkumar Ajitkumar
2024-06-21 9:34 ` ✗ CI.xeBAT: failure for VRR test cleanup (rev4) Patchwork
2024-06-21 9:40 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-21 11:18 ` ✗ CI.xeFULL: failure " Patchwork
2024-06-22 14:04 ` ✗ Fi.CI.IGT: " Patchwork
2024-06-24 4:40 ` ✓ CI.xeBAT: success for VRR test cleanup (rev5) Patchwork
2024-06-24 4:50 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-24 5:39 ` ✓ CI.xeFULL: " Patchwork
2024-06-24 16:14 ` ✗ 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=20240621084711.68444-4-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=mitulkumar.ajitkumar.golani@intel.com \
--cc=navaremanasi@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox