public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 08/10] tests/kms_ccs: Work around CRC mismatch when mixing SDR/HDR planes
Date: Mon, 30 Dec 2019 05:40:38 +0200	[thread overview]
Message-ID: <20191230034040.21943-9-imre.deak@intel.com> (raw)
In-Reply-To: <20191230034040.21943-1-imre.deak@intel.com>

When using both an SDR and HDR plane, the CRC of the resulting image
will not match the CRC of the reference image where just an HDR plane is
used. To avoid this - most probably HW precision issue - make sure all
the planes we enable are of the same SDR/HDR type.

Cc: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 tests/kms_ccs.c | 35 ++++++++++++++++++++++++++++++-----
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 60cdd70c..a86a3470 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -24,6 +24,8 @@
 
 #include "igt.h"
 
+#define SDR_PLANE_BASE	3
+
 IGT_TEST_DESCRIPTION("Test render compression (RC), in which the main surface "
 		     "is complemented by a color control surface (CCS) that "
 		     "the display uses to interpret the compressed data.");
@@ -195,11 +197,35 @@ static void generate_fb(data_t *data, struct igt_fb *fb,
 	fb->fb_id = f.fb_id;
 }
 
+static igt_plane_t *first_sdr_plane(data_t *data)
+{
+	return igt_output_get_plane(data->output, SDR_PLANE_BASE);
+}
+
+static bool is_sdr_plane(const igt_plane_t *plane)
+{
+	return plane->index >= SDR_PLANE_BASE;
+}
+
+/*
+ * Mixing SDR and HDR planes results in a CRC mismatch, so use the first
+ * SDR/HDR plane as the main plane matching the SDR/HDR type of the sprite
+ * plane under test.
+ */
+static igt_plane_t *compatible_main_plane(data_t *data)
+{
+	if (data->plane && is_sdr_plane(data->plane) &&
+	    igt_format_is_yuv(data->format))
+		return first_sdr_plane(data);
+
+	return igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
+}
+
 static bool try_config(data_t *data, enum test_fb_flags fb_flags,
 		       igt_crc_t *crc)
 {
 	igt_display_t *display = &data->display;
-	igt_plane_t *primary;
+	igt_plane_t *primary = compatible_main_plane(data);
 	drmModeModeInfo *drm_mode = igt_output_get_mode(data->output);
 	enum igt_commit_style commit;
 	struct igt_fb fb, fb_sprite;
@@ -210,8 +236,9 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
 	else
 		commit = COMMIT_UNIVERSAL;
 
-	primary = igt_output_get_plane_type(data->output,
-					    DRM_PLANE_TYPE_PRIMARY);
+	if (primary == data->plane)
+		return false;
+
 	if (!igt_plane_has_format_mod(primary, data->format,
 				      data->ccs_modifier))
 		return false;
@@ -392,8 +419,6 @@ igt_main
 			igt_display_require_output_on_pipe(&data.display, data.pipe);
 
 			for_each_plane_on_pipe(&data.display, data.pipe, data.plane) {
-				if (data.plane->type == DRM_PLANE_TYPE_PRIMARY)
-					continue;
 				valid_tests += __test_output(&data);
 			}
 
-- 
2.23.1

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

  parent reply	other threads:[~2019-12-30  3:41 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30  3:40 [igt-dev] [PATCH i-g-t 00/10] lib: Add support and coverage for MC YUV formats Imre Deak
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 01/10] lib/igt_buf: Use compression type consistently Imre Deak
2019-12-30 12:00   ` Kahola, Mika
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 02/10] lib/igt_buf: Extend igt_buf to include two CCS surfaces Imre Deak
2019-12-30 12:02   ` Kahola, Mika
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 03/10] lib/igt_buf: Extend igt_buf to include two color surfaces Imre Deak
2019-12-30 12:06   ` Kahola, Mika
2019-12-30 12:58     ` Imre Deak
2019-12-30 17:58   ` [igt-dev] [PATCH i-g-t v2 " Imre Deak
2019-12-31  8:40     ` Kahola, Mika
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 04/10] lib: Add engine copy support for YUV formats Imre Deak
2019-12-30 13:23   ` Kahola, Mika
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 05/10] Revert "tests/kms_plane: Disable GEN12 media compression YUV tests" Imre Deak
2019-12-30 13:24   ` Kahola, Mika
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 06/10] tests/kms_ccs: Add support for testing multiple formats Imre Deak
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 07/10] tests/kms_ccs: Add GEN12 CCS media compression format modifier Imre Deak
2019-12-30  3:40 ` Imre Deak [this message]
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 09/10] tests/kms_ccs: Test YUV formats too Imre Deak
2019-12-30  3:40 ` [igt-dev] [PATCH i-g-t 10/10] tests/kms_ccs: Add option to check the CCS planes Imre Deak
2019-12-30 12:47   ` Juha-Pekka Heikkila
2019-12-30 13:12     ` Imre Deak
2019-12-30 13:34       ` Juha-Pekka Heikkila
2019-12-30 17:58   ` [igt-dev] [PATCH i-g-t v2 " Imre Deak
2019-12-30  4:12 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib: Add support and coverage for MC YUV formats Patchwork
2019-12-30  9:00   ` Imre Deak
2019-12-30  9:22     ` Vudum, Lakshminarayana
2019-12-30  9:18 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-12-30 12:50 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-12-30 13:23   ` Imre Deak
2019-12-30 15:53 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2019-12-30 19:02 ` [igt-dev] ✓ Fi.CI.BAT: success for lib: Add support and coverage for MC YUV formats (rev3) Patchwork
2019-12-31  8:45 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-12-31 12:49   ` Imre Deak

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=20191230034040.21943-9-imre.deak@intel.com \
    --to=imre.deak@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