[igt-dev] [PATCH] tests: Skip tests using LUTs when the driver doesn't support it.

Petri Latvala petri.latvala at intel.com
Wed Nov 17 11:22:57 UTC 2021


On Tue, Nov 16, 2021 at 12:31:31PM -0500, Mark Yacoub wrote:
> From: Mark Yacoub <markyacoub at google.com>
> 
> [Why]
> Some drivers such as msm do not support CTM and their CRTC doesn't have
> LUT props. Tests should skip relevant tests when it's not supported.
> 
> [How]
> Check for the LUT pipe prop before starting relevant subtest.
> 
> Tested on Trogdor (msm)
> 
> Signed-off-by: Mark Yacoub <markyacoub at chromium.org>
> ---
>  tests/kms_color.c |  8 ++++++++
>  tests/kms_plane.c | 52 ++++++++++++++++++++++++++++-------------------
>  2 files changed, 39 insertions(+), 21 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c
> index 775f3596..99a59cd8 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -905,6 +905,14 @@ igt_main
>  	}
>  
>  	for_each_pipe_static(pipe) {
> +		igt_fixture {
> +			igt_require_f(igt_pipe_has_prop(&data.display, pipe,
> +											IGT_CRTC_GAMMA_LUT) &&
> +								igt_pipe_has_prop(&data.display, pipe,
> +												IGT_CRTC_DEGAMMA_LUT),
> +							"Driver doesn't support CTM.\n");
> +		}

I went through the subtests and they mostly do this already for all
the props they're using. The only exception is *-legacy-gamma, in
test_pipe_legacy_gamma(). (notably, the legacy_gamma_reset() function
does check that the prop exists)



> +
>  		igt_subtest_group
>  			run_tests_for_pipe(&data, pipe);
>  
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 405d4c21..d82214ed 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -1090,28 +1090,38 @@ run_tests_for_pipe_plane(data_t *data)
>  		igt_require(data->display.pipes[pipe].n_planes > 0);
>  	}
>  
> -	igt_describe("verify the pixel formats for given plane and pipe");
> -	igt_subtest_with_dynamic_f("pixel-format") {
> -		count = 0;
> -		for_each_pipe(&data->display, pipe) {
> -			igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe))
> -				test_pixel_formats(data, pipe);
> -			if (is_pipe_limit_reached(++count))
> -				break;
> -		}
> -	}
> -	igt_describe("verify the pixel formats for given plane and pipe with source clamping");
> -	igt_subtest_with_dynamic_f("pixel-format-source-clamping") {
> -		count = 0;
> -		for_each_pipe(&data->display, pipe) {
> -			igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe)) {
> -				data->crop = 4;
> -				test_pixel_formats(data, pipe);
> +		igt_describe("Verify the pixel formats for given plane and pipe");
> +		igt_subtest_group {
> +			igt_fixture {
> +				igt_require_f(igt_pipe_has_prop(&data->display, pipe,
> +												IGT_CRTC_GAMMA_LUT) &&
> +								  igt_pipe_has_prop(&data->display, pipe,
> +													IGT_CRTC_DEGAMMA_LUT),
> +							  "Driver doesn't support CTM.\n");

These tests don't use these props, they use the SETGAMMA ioctl.


-- 
Petri Latvala


>  			}
> -			if (is_pipe_limit_reached(++count))
> -				break;
> -		}
> -	}
> +
> +			igt_subtest_with_dynamic_f("pixel-format") {
> +				count = 0;
> +				for_each_pipe(&data->display, pipe) {
> +					igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe))
> +						test_pixel_formats(data, pipe);
> +					if (is_pipe_limit_reached(++count))
> +						break;
> +				}
> +			}
> +		    igt_subtest_with_dynamic_f("pixel-format-source-clamping") {
> +				count = 0;
> +				for_each_pipe(&data->display, pipe) {
> +				    igt_dynamic_f("pipe-%s-planes", kmstest_pipe_name(pipe)) {
> +						data->crop = 4;
> +						test_pixel_formats(data, pipe);
> +				    }
> +				    if (is_pipe_limit_reached(++count))
> +						break;
> +				}
> +		    }
> +        }
> +
>  
>  	data->crop = 0;
>  	igt_describe("verify plane position using two planes to create a fully covered screen");
> -- 
> 2.34.0.rc1.387.gb447b232ab-goog
> 


More information about the igt-dev mailing list