[igt-dev] [PATCH] tests: Skip tests using LUTs when the driver doesn't support it.
Jessica Zhang
quic_jesszhan at quicinc.com
Wed Nov 17 01:03:49 UTC 2021
Hi Mark,
On 11/16/2021 9:31 AM, 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");
> + }
> +
Spacing looks a little messy and makes the code hard to read. Please
reformat to something more legible.
> 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");
Same here.
Thanks,
Jessica Zhang
> }
> - 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");
More information about the igt-dev
mailing list