diff options
author | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2024-06-24 09:36:11 +0530 |
---|---|---|
committer | Bhanuprakash Modem <bhanuprakash.modem@intel.com> | 2024-07-03 11:58:48 +0530 |
commit | 2210dc1efeaa3b304c8008163bd2483de557d49c (patch) | |
tree | 96ab928231d5c15c614ea9e7420de984eaeb1b27 | |
parent | f61ff748b6f615e43668ddd4fee67d2ad2f52e75 (diff) |
tests/kms_vrr: Cleanup in creating the virtual mode
Cleanup the function to create the virtual mode, so
that it could be re-used.
V2: - Fix argument type (Bhanu)
Cc: Manasi Navare <navaremanasi@chromium.org>
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
-rw-r--r-- | tests/kms_vrr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 2ea90cd8e..7e8885f16 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, float 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); |