RE: [PATCH i-g-t v1] tests/kms_vrr: Allow low refresh modes with identical clocks

"B, Jeevan" <[email protected]> Tue, 28 Jul 2026 05:05:34 +0000
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <DM4PR11MB63124ED579931ACD962C6BA690CB2@DM4PR11MB6312.namprd11.prod.outlook.com>
Patch LGTM. 

Reviewed-by: Jeevan B <[email protected]>

> -----Original Message-----
> From: Naladala, Ramanaidu <[email protected]>
> Sent: Friday, July 24, 2026 1:31 AM
> To: [email protected]
> Cc: Golani, Mitulkumar Ajitkumar <[email protected]>;
> Nautiyal, Ankit K <[email protected]>; B, Jeevan <[email protected]>;
> Naladala, Ramanaidu <[email protected]>
> Subject: [PATCH i-g-t v1] tests/kms_vrr: Allow low refresh modes with identical
> clocks
> 
> Some panels expose multiple modes with the same resolution and pixel clock,
> varying only in vertical blanking timings to achieve different refresh rates.
> 
> The existing selection logic requires a strictly lower pixel clock, which incorrectly
> excludes valid low-refresh-rate modes when the clock remains unchanged.
> 
> For example:
> "2880x1800": 60  678528 2880 2928 2960 3040 1800 3711 3717 3720 0x48 0xa
> "2880x1800": 120 678528 2880 2928 2960 3040 1800 1851 1857 1860 0x40 0xa
> 
> Both modes share the same pixel clock (678528) and resolution, differing only in
> vertical timings. Under the old logic, the
> 60 Hz mode is skipped because its clock is not lower than the current mode.
> 
> Relax the constraint so that modes with identical clocks remain eligible and select
> the lowest refresh rate among same-resolution modes.
> 
> Fixes: 771fcec0819 ("tests/kms_vrr: Add new subtest to switch RR without
> modeset")
> Signed-off-by: Naladala Ramanaidu <[email protected]>
> ---
>  tests/kms_vrr.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 82eb8554a..27f18e8d0
> 100644
> --- a/tests/kms_vrr.c
> +++ b/tests/kms_vrr.c
> @@ -231,7 +231,6 @@ low_rr_mode_with_same_res(igt_output_t *output,
> unsigned int vrr_min)
>  	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];
> --
> 2.43.0