Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest
Date: Tue, 11 Apr 2023 19:15:51 +0300	[thread overview]
Message-ID: <20230411161555.10001-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20230411161555.10001-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

i915 CHV CSC code has a bug where it treats the hardware
CSC coefficient as sign-magnitude instead of the two's
complement value that it is. None of the current tests
manage to notice this.

Add a testcase that uses suitable negative coefficients
to catch the issue. With CHV's s4.12 coefficients the
-0.25 ends up as -7.75 and the results won't match.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index d430ee12aaa3..35083122dfbf 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -959,6 +959,11 @@ run_tests_for_pipe(data_t *data)
 		{ 0.0, 1.0, 0.0 },
 		{ 0.0, 0.0, 1.0 },
 	};
+	static const color_t colors_cmy[] = {
+		{ 0.0, 1.0, 1.0 },
+		{ 1.0, 0.0, 1.0 },
+		{ 1.0, 1.0, 0.0 }
+	};
 	static const struct {
 		const char *name;
 		int iter;
@@ -1040,6 +1045,16 @@ run_tests_for_pipe(data_t *data)
 		  },
 		  .desc = "Check the color transformation for 0.75 transparency",
 		},
+		{ .name = "ctm-signed",
+		  .fb_colors = colors_cmy,
+		  .iter = 3,
+		  .ctm = {
+			  -0.25,  0.75,  0.75,
+			   0.75, -0.25,  0.75,
+			   0.75,  0.75, -0.25,
+		  },
+		  .desc = "Check the color transformation for correct signed handling",
+		},
 	};
 	int i;
 
-- 
2.39.2

  parent reply	other threads:[~2023-04-11 16:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
2023-05-04 21:21   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers Ville Syrjala
2023-05-04 21:23   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const Ville Syrjala
2023-05-04 21:26   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb Ville Syrjala
2023-05-04 21:28   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors" Ville Syrjala
2023-05-04 21:39   ` Shankar, Uma
2023-04-11 16:15 ` Ville Syrjala [this message]
2023-05-04 21:43   ` [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values Ville Syrjala
2023-05-04 21:44   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level Ville Syrjala
2023-05-04 21:46   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 9/9] tests/intel-ci/fast-feedback: Run ctm tests Ville Syrjala
2023-04-11 17:51 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2) 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=20230411161555.10001-7-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox