All of lore.kernel.org
 help / color / mirror / Atom feed
From: venkata.sai.patnana@intel.com
To: igt-dev@lists.freedesktop.org
Cc: Nischal Varide <nischal.varide@intel.com>,
	Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH v2 i-g-t 16/23] tests/kms_dither: Validate dither after CC blocks
Date: Thu,  3 Jun 2021 20:10:15 +0530	[thread overview]
Message-ID: <20210603144022.28176-16-venkata.sai.patnana@intel.com> (raw)
In-Reply-To: <20210603144022.28176-1-venkata.sai.patnana@intel.com>

From: Bhanuprakash Modem <bhanuprakash.modem@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@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Nischal Varide <nischal.varide@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2021-06-03 14:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 14:40 [igt-dev] [PATCH v2 i-g-t 01/23] lib/igt_kms: Add plane color mgmt properties venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 02/23] kms_color_helper: Add helper functions for plane color mgmt venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 03/23] tests/kms_color: New subtests for Plane gamma venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 04/23] tests/kms_color: New subtests for Plane degamma venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 05/23] tests/kms_color: New subtests for Plane CTM venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 06/23] tests/kms_color_chamelium: New subtests for Plane gamma venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 07/23] tests/kms_color_chamelium: New subtests for Plane degamma venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 08/23] tests/kms_color_chamelium: New subtests for Plane CTM venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 09/23] lib/igt_kms: Add pipe color mgmt properties venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 10/23] kms_color_helper: Add helper functions to support logarithmic gamma mode venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 11/23] tests/kms_color: Extended IGT tests " venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 12/23] tests/kms_color_chamelium: " venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 13/23] tests/kms_color: Optimize plane ctm test venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 14/23] tests/kms_color_chamelium: " venkata.sai.patnana
2021-06-04  5:01   ` Modem, Bhanuprakash
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 15/23] tests/kms_dither: New IGT to validate crtc Dithering venkata.sai.patnana
2021-06-03 14:40 ` venkata.sai.patnana [this message]
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 17/23] tests/kms_dither: Dont assert if debugfs is not present venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 18/23] tests/device_reset: Unload snd driver before i915 unbind venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 19/23] tests/core_hotunplug: " venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 20/23] tests/kms_force_connector_basic: Skip prune stale mode venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 21/23] tests/kms: Create buffer object from LMEM for discrete venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 22/23] tests/kms_addfb_basic: Add invalid buffer object test " venkata.sai.patnana
2021-06-03 14:40 ` [igt-dev] [PATCH v2 i-g-t 23/23] tests/kms_dp_dsc: Read the debugfs only once venkata.sai.patnana
2021-06-03 15:20 ` [igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [v2,i-g-t,01/23] lib/igt_kms: Add plane color mgmt properties Patchwork
2021-06-03 15:25 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210603144022.28176-16-venkata.sai.patnana@intel.com \
    --to=venkata.sai.patnana@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=nischal.varide@intel.com \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.