[igt-dev] [PATCH i-g-t 02/17] tests/kms_dither: Validate dither after CC blocks
From: <hidden>
Date: 2021-06-11 05:30:34
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Bhanuprakash Modem <redacted> Dithering after all CC blocks will be enabled only if the panel supports 12 BPC (or more) and the Framebuffer BPC is greater than 12 BPC. And legacy dither block (at the end of PIPE) should be disabled to avoid double dithering. This patch will extend the support to validate Dither after all color conversion (CC) blocks. Cc: Swati Sharma <redacted> Cc: Karthik B S <redacted> Cc: Uma Shankar <redacted> Cc: Nischal Varide <redacted> Cc: Petri Latvala <redacted> Signed-off-by: Bhanuprakash Modem <redacted> --- tests/kms_dither.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/tests/kms_dither.c b/tests/kms_dither.c
index c25d623f81..b1f0503a6c 100644
--- a/tests/kms_dither.c
+++ b/tests/kms_dither.c@@ -57,7 +57,8 @@ typedef struct data { typedef struct { unsigned int bpc; - unsigned int dither; + unsigned int legacy; + unsigned int cc1; } dither_status_t; /* Prepare test data. */
@@ -104,7 +105,13 @@ static dither_status_t get_dither_state(data_t *data) igt_assert_eq(sscanf(start_loc, "bpc: %u", &status.bpc), 1); igt_assert(start_loc = strstr(buf, "Dither: ")); - igt_assert_eq(sscanf(start_loc, "Dither: %u", &status.dither), 1); + igt_assert_eq(sscanf(start_loc, "Dither: %u", &status.legacy), 1); + + start_loc = strstr(buf, "Dither_CC1: "); + if (!start_loc) + status.cc1 = 0; + else + igt_assert_eq(sscanf(start_loc, "Dither_CC1: %u", &status.cc1), 1); return status; }
@@ -141,10 +148,10 @@ static void test_dithering(data_t *data, enum pipe pipe, */ status = get_dither_state(data); - igt_debug("FB BPC:%d, Panel BPC:%d, Pipe BPC:%d, Expected Dither:%s, Actual result:%s\n", - fb_bpc, output_bpc, status.bpc, - (fb_bpc > output_bpc) ? "Enable": "Disable", - status.dither ? "Enable": "Disable"); + igt_debug("FB BPC:%d, Panel BPC:%d, Pipe BPC:%d, " + "Dither at end of the pipe:%u, Dither after CC1:%u\n", + fb_bpc, output_bpc, status.bpc, + status.legacy, status.cc1); /* * We must update the Connector max_bpc property back
@@ -163,12 +170,25 @@ static void test_dithering(data_t *data, enum pipe pipe, output->name, status.bpc, output_bpc); /* Compute the result. */ - if (fb_bpc > output_bpc) - igt_assert_f(status.dither, "(fb_%dbpc > output_%dbpc): Dither should be enabled\n", - fb_bpc, output_bpc); - else - igt_assert_f(!status.dither, "(fb_%dbpc <= output_%dbpc): Dither should be disabled\n", + if (fb_bpc > output_bpc) { + if (output_bpc < IGT_CONNECTOR_BPC_12) + igt_assert_f((status.legacy && !status.cc1), + "(fb_%dbpc > output_%dbpc): Dither should be " + "enabled at end of the PIPE & " + "disbaled at the CC1.\n", + fb_bpc, output_bpc); + else + igt_assert_f((!status.legacy && status.cc1), + "(fb_%dbpc > output_%dbpc): Dither should be " + "disabled at end of the PIPE & " + "enabled at the CC1.\n", + fb_bpc, output_bpc); + } else { + igt_assert_f((!status.legacy && !status.cc1), + "(fb_%dbpc <= output_%dbpc): Dither should be " + "disabled at both places (end of the PIPE & CC1).\n", fb_bpc, output_bpc); + } return; }
@@ -218,6 +238,7 @@ igt_main } tests[] = { { IGT_FRAME_BUFFER_BPC_8, DRM_FORMAT_XRGB8888, IGT_CONNECTOR_BPC_6 }, { IGT_FRAME_BUFFER_BPC_8, DRM_FORMAT_XRGB8888, IGT_CONNECTOR_BPC_8 }, + { IGT_FRAME_BUFFER_BPC_16, DRM_FORMAT_XRGB16161616F, IGT_CONNECTOR_BPC_12 }, }; int i; data_t data = { 0 };
--
2.25.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev