[i-g-t 3/3] tests/kms_vrr: Fix virtual mode creation
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Fri Jun 21 05:48:04 UTC 2024
Instead of tweaking the mode->vtotal, tweak the mode->clock
to create any virtual mode as there is a posibility of
mode->vtotal > vmax.
Cc: Manasi Navare <navaremanasi at chromium.org>
Cc: Mitul Golani <mitulkumar.ajitkumar.golani at intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
tests/kms_vrr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index 2ea90cd8e..00e9b94c3 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -233,9 +233,8 @@ static drmModeModeInfo
virtual_rr_vrr_range_mode(igt_output_t *output, unsigned int virtual_refresh_rate)
{
drmModeModeInfo mode = *igt_output_get_mode(output);
- uint64_t clock_hz = mode.clock * 1000;
- mode.vtotal = clock_hz / (mode.htotal * virtual_refresh_rate);
+ mode.clock = (mode.htotal * mode.vtotal * virtual_refresh_rate) / 1000;
mode.vrefresh = virtual_refresh_rate;
return mode;
--
2.43.2
More information about the Intel-gfx-trybot
mailing list