[igt-dev] [PATCH i-g-t 16/24] tests/kms_dither: Validate dither after CC blocks

venkata.sai.patnana at intel.com venkata.sai.patnana at intel.com
Thu Jun 3 12:20:19 UTC 2021


From: Bhanuprakash Modem <bhanuprakash.modem at intel.com>

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.

V2:
* Identify the dithering block, then check the status (Uma)

Cc: Swati Sharma <swati2.sharma at intel.com>
Cc: Karthik B S <karthik.b.s at intel.com>
Cc: Uma Shankar <uma.shankar at intel.com>
Cc: Nischal Varide <nischal.varide at intel.com>
Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
(cherry picked from commit 884a5ae9e1ba7187a4f13b59071db29cfdf855af)
---
 tests/kms_dither.c | 40 +++++++++++++++++++++++++++++-----------
 1 file changed, 29 insertions(+), 11 deletions(-)

diff --git a/tests/kms_dither.c b/tests/kms_dither.c
index c25d623f81..1ff07914f4 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,10 @@ 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);
+
+	igt_assert(start_loc = strstr(buf, "Dither_CC1: "));
+	igt_assert_eq(sscanf(start_loc, "Dither_CC1: %u", &status.cc1), 1);
 
 	return status;
 }
@@ -141,10 +145,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 +167,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 +235,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



More information about the igt-dev mailing list