[i-g-t V6 03/10] tests/kms_vrr: Move all config constaints to new function

Golani, Mitulkumar Ajitkumar mitulkumar.ajitkumar.golani at intel.com
Thu Dec 7 16:04:38 UTC 2023



> -----Original Message-----
> From: Modem, Bhanuprakash <bhanuprakash.modem at intel.com>
> Sent: Thursday, December 7, 2023 12:19 PM
> To: igt-dev at lists.freedesktop.org; ville.syrjala at linux.intel.com; Golani,
> Mitulkumar Ajitkumar <mitulkumar.ajitkumar.golani at intel.com>
> Cc: Modem, Bhanuprakash <bhanuprakash.modem at intel.com>
> Subject: [i-g-t V6 03/10] tests/kms_vrr: Move all config constaints to new
> function
> 
> No functional change, cleanup only. Move all config checks to new function.
> 
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  tests/kms_vrr.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c index 13e7f3ca6..df241aa6c
> 100644
> --- a/tests/kms_vrr.c
> +++ b/tests/kms_vrr.c
> @@ -483,6 +483,21 @@ static void test_cleanup(data_t *data, enum pipe
> pipe, igt_output_t *output)
>  	igt_remove_fb(data->drm_fd, &data->fb0);  }
> 
> +static bool config_constraint(igt_output_t *output, uint32_t flags) {
> +	if (!has_vrr(output))
> +		return false;
> +
> +	/* For Negative tests, panel should be non-vrr. */
> +	if ((flags & TEST_NEGATIVE) && vrr_capable(output))
> +		return false;
> +
> +	if ((flags & ~TEST_NEGATIVE) && !vrr_capable(output))
> +		return false;
> +
> +	return true;
> +}
> +
>  /* Runs tests on outputs that are VRR capable. */  static void
> run_vrr_test(data_t *data, test_t test, uint32_t flags) @@ -492,14 +507,7
> @@ run_vrr_test(data_t *data, test_t test, uint32_t flags)
>  	for_each_connected_output(&data->display, output) {
>  		enum pipe pipe;
> 
> -		if (!has_vrr(output))
> -			continue;
> -
> -		/* For Negative tests, panel should be non-vrr. */
> -		if ((flags & TEST_NEGATIVE) && vrr_capable(output))
> -			continue;
> -
> -		if ((flags & ~TEST_NEGATIVE) && !vrr_capable(output))
> +		if (!config_constraint(output, flags))

Change LGTM. Thanks

Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani at intel.com>
>  			continue;
> 
>  		for_each_pipe(&data->display, pipe) {
> --
> 2.40.0



More information about the igt-dev mailing list