[igt-dev] [PATCH i-g-t] tests/kms_color: Optimize ctm test execution

Karthik B S karthik.b.s at intel.com
Thu Dec 23 09:26:41 UTC 2021


On 12/23/2021 12:48 PM, Bhanuprakash Modem wrote:
> Instead of iterating through all the delta, break the execution
> when we found a match. This will optimize the time required to
> execute ctm-0-* tests.
>
> Cc: Karthik B S <karthik.b.s at intel.com>
> Cc: Uma Shankar <uma.shankar at intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>

Looks good to me.

Reviewed-by: Karthik B S <karthik.b.s at intel.com>

> ---
>   tests/kms_color.c | 24 +++++++++++++++---------
>   1 file changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 775f35964f..854b8f3c31 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -754,9 +754,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
>   				expected_colors[1].g =
>   				expected_colors[2].b =
>   				0.25 + delta * (i - 2);
> -			success |= test_pipe_ctm(data, primary,
> -						 red_green_blue,
> -						 expected_colors, ctm);
> +			if (test_pipe_ctm(data, primary, red_green_blue,
> +					  expected_colors, ctm)) {
> +				success = true;
> +				break;
> +			}
>   		}
>   		igt_assert(success);
>   	}
> @@ -776,9 +778,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
>   				expected_colors[1].g =
>   				expected_colors[2].b =
>   				0.5 + delta * (i - 2);
> -			success |= test_pipe_ctm(data, primary,
> -						 red_green_blue,
> -						 expected_colors, ctm);
> +			if (test_pipe_ctm(data, primary, red_green_blue,
> +					  expected_colors, ctm)) {
> +				success = true;
> +				break;
> +			}
>   		}
>   		igt_assert(success);
>   	}
> @@ -798,9 +802,11 @@ run_tests_for_pipe(data_t *data, enum pipe p)
>   				expected_colors[1].g =
>   				expected_colors[2].b =
>   				0.75 + delta * (i - 3);
> -			success |= test_pipe_ctm(data, primary,
> -						 red_green_blue,
> -						 expected_colors, ctm);
> +			if (test_pipe_ctm(data, primary, red_green_blue,
> +						expected_colors, ctm)) {
> +				success = true;
> +				break;
> +			}
>   		}
>   		igt_assert(success);
>   	}




More information about the igt-dev mailing list