Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 2/3] tests/kms_pipe_crc_basic: add nv12 crc sanity check
Date: Wed, 31 May 2023 13:15:29 +0530	[thread overview]
Message-ID: <20230531074530.367036-3-swati2.sharma@intel.com> (raw)
In-Reply-To: <20230531074530.367036-1-swati2.sharma@intel.com>

New CRC sanitycheck test case is added with NV12 format.
kms_plane@pixel-format test is validating all formats.
To improve BAT coverage we can have one planar format crc
sanity test.

v2: -improved documentation (Bhanu)
v3: -added check to skip format if not supported (CI)

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Jeevan B <jeevan.b@intel.com>
---
 tests/kms_pipe_crc_basic.c | 50 ++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 15 deletions(-)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 84c73fd7..9ce9f5e5 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -227,25 +227,31 @@ static void test_read_crc(data_t *data, enum pipe pipe,
 }
 
 /**
- * SUBTEST: compare-crc-sanitycheck
- * Description: Basic sanity check for CRC mismatches
+ * SUBTEST: compare-crc-sanitycheck-%s
+ * Description: Basic sanity check for CRC mismatches with %arg[1]
  * Test category: functionality test
  * Run type: BAT
  * Functionality: crc
  * Mega feature: General Display Features
+ *
+ * arg[1]:
+ *
+ * @xr24:	XR24 format
+ * @nv12:	NV12 format
  */
 
 /*
  * CRC-sanity test, to make sure there would be no CRC mismatches
  *
- * - Create two framebuffers (FB0 & FB1) with same color info
- * - Flip FB0 with the Primary plane & collect the CRC as ref CRC.
- * - Flip FB1 with the Primary plane, collect the CRC & compare with
+ * - Create two framebuffers (FB0 & FB1).
+ * - Flip FB0 with the primary plane & collect the CRC as ref CRC.
+ * - Flip FB1 with the primary plane, collect the CRC & compare with
  *   the ref CRC.
  *
  *   No CRC mismatch should happen
  */
-static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output)
+static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output,
+			     uint32_t plane_format)
 {
 	igt_display_t *display = &data->display;
 	igt_plane_t *primary;
@@ -259,7 +265,9 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output)
 
 	mode = igt_output_get_mode(output);
 
-	/* Create two framebuffers with the same color info. */
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	igt_skip_on(!igt_plane_has_format_mod(primary, plane_format, DRM_FORMAT_MOD_LINEAR));
+
 	igt_create_color_fb(data->drm_fd,
 			mode->hdisplay, mode->vdisplay,
 			DRM_FORMAT_XRGB8888,
@@ -267,14 +275,12 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output)
 			1.0, 1.0, 1.0,
 			&fb0);
 	igt_create_color_fb(data->drm_fd,
-			mode->hdisplay, mode->vdisplay,
-			DRM_FORMAT_XRGB8888,
+			mode->hdisplay, mode->vdisplay, plane_format,
 			DRM_FORMAT_MOD_LINEAR,
 			1.0, 1.0, 1.0,
 			&fb1);
 
-	/* Flip FB0 with the Primary plane & collect the CRC as ref CRC. */
-	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	/* Flip FB0 with the primary plane & collect the CRC as ref CRC. */
 	igt_plane_set_fb(primary, &fb0);
 	igt_display_commit(display);
 
@@ -282,7 +288,7 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output)
 				    IGT_PIPE_CRC_SOURCE_AUTO);
 	igt_pipe_crc_collect_crc(pipe_crc, &ref_crc);
 
-	/* Flip FB1 with the Primary plane & compare the CRC with ref CRC. */
+	/* Flip FB1 with the primary plane & compare the CRC with ref CRC. */
 	igt_plane_set_fb(primary, &fb1);
 	igt_display_commit(display);
 
@@ -475,8 +481,22 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 		}
 	}
 
-	igt_describe("Basic sanity check for CRC mismatches");
-	igt_subtest_with_dynamic("compare-crc-sanitycheck") {
+	igt_describe("Basic sanity check for CRC mismatches with XR24 format");
+	igt_subtest_with_dynamic("compare-crc-sanitycheck-xr24") {
+		for_each_pipe_with_single_output(&data.display, pipe, output) {
+			if (simulation_constraint(pipe))
+				continue;
+
+			if(!pipe_output_combo_valid(&data.display, pipe, output))
+				continue;
+
+			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
+				test_compare_crc(&data, pipe, output, DRM_FORMAT_XRGB8888);
+		}
+	}
+
+	igt_describe("Basic sanity check for CRC mismatches with NV12 format");
+	igt_subtest_with_dynamic("compare-crc-sanitycheck-nv12") {
 		for_each_pipe_with_single_output(&data.display, pipe, output) {
 			if (simulation_constraint(pipe))
 				continue;
@@ -485,7 +505,7 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 				continue;
 
 			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name)
-				test_compare_crc(&data, pipe, output);
+				test_compare_crc(&data, pipe, output, DRM_FORMAT_NV12);
 		}
 	}
 
-- 
2.25.1

  parent reply	other threads:[~2023-05-31  7:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  7:45 [igt-dev] [PATCH i-g-t v3 0/3] nv12 crc sanity check Swati Sharma
2023-05-31  7:45 ` [igt-dev] [PATCH i-g-t 1/3] lib/igt_fb: round rgb->yuv conversion results Swati Sharma
2023-06-02 11:57   ` Juha-Pekka Heikkila
2023-06-05 15:12   ` Kamil Konieczny
2023-06-05 15:56     ` Sharma, Swati2
2023-05-31  7:45 ` Swati Sharma [this message]
2023-06-02 11:57   ` [igt-dev] [PATCH i-g-t v3 2/3] tests/kms_pipe_crc_basic: add nv12 crc sanity check Juha-Pekka Heikkila
2023-05-31  7:45 ` [igt-dev] [PATCH i-g-t v2 3/3] intel-ci: update fastfeedback testlist Swati Sharma
2023-06-02 11:58   ` Juha-Pekka Heikkila
2023-05-31  7:57 ` [igt-dev] ✗ GitLab.Pipeline: warning for nv12 crc sanity check Patchwork
2023-05-31  8:24 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-06-01 15:13 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230531074530.367036-3-swati2.sharma@intel.com \
    --to=swati2.sharma@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