public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH v3 0/2] tests/kms_pipe_crc_basic: Sanity check for CRC mismatches
@ 2020-08-06 18:07 Bhanuprakash Modem
  2020-08-06 10:56 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_pipe_crc_basic: Sanity check for CRC mismatches (rev7) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Bhanuprakash Modem @ 2020-08-06 18:07 UTC (permalink / raw)
  To: bhanuprakash.modem, igt-dev

This series will add a crc-sanity test to verify the CRC mechanism is
clean from the platform and add the subtest to fast-feedback list.

Bhanuprakash Modem (2):
  tests/kms_pipe_crc_basic: Sanity check for CRC mismatches
  intel-ci: Add compare CRC sanity test to BAT

 tests/intel-ci/fast-feedback.testlist |  3 ++
 tests/kms_pipe_crc_basic.c            | 73 +++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)

-- 
2.20.1

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [igt-dev] [PATCH v2] tests/kms_pipe_crc_basic: Sanity check for CRC mismatches
@ 2020-08-06 12:44 Bhanuprakash Modem
  2020-08-06 18:04 ` [igt-dev] [PATCH v1 2/2] intel-ci: Add compare CRC sanity test to BAT Bhanuprakash Modem
  0 siblings, 1 reply; 11+ messages in thread
From: Bhanuprakash Modem @ 2020-08-06 12:44 UTC (permalink / raw)
  To: bhanuprakash.modem, igt-dev; +Cc: Petri Latvala

We’ve seen multiple CRC related issues on older platforms and
pre-silicon environment, most of the time we end up with debugging.

This patch works as a crc-sanity test, which can verify that the
CRC mechanism is clean from the platform side before debugging the
actual CRC mismatches or other CRC related issues.

This patch will create two framebuffers (fb0 & fb1) with the same
color info, flip fb0 with primary plane & collect CRC as reference.
Then flip fb1 with primary plane, collect the CRC and compare with
the reference CRC. There should be no CRC mismatch.

v2:
* Run subtest to all pipes (Karthik & Swati)
* Fix commit message & few comments (Karthik)
* Use meaningful name for functions (Swati)
* Remove unwanted checks (Karthik)

Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Karthik B S <karthik.b.s@intel.com>
Cc: Jeevan B <jeevan.b@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_pipe_crc_basic.c | 73 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index cb93c1ad..599047cb 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -154,6 +154,75 @@ static void test_read_crc(data_t *data, enum pipe pipe, unsigned flags)
 	}
 }
 
+/*
+ * 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
+ *   the ref CRC.
+ *
+ *   No CRC mismatch should happen
+ */
+static void test_compare_crc(data_t *data, enum pipe pipe)
+{
+	igt_display_t *display = &data->display;
+	igt_plane_t *primary;
+	drmModeModeInfo *mode;
+	igt_crc_t ref_crc, crc;
+	igt_pipe_crc_t *pipe_crc = NULL;
+	struct igt_fb fb0, fb1;
+	igt_output_t *output = igt_get_single_output_for_pipe(display, pipe);
+
+	igt_require_f(output, "No connector found for pipe %s\n",
+			kmstest_pipe_name(pipe));
+
+	igt_require_pipe(display, pipe);
+	igt_display_reset(display);
+	igt_output_set_pipe(output, pipe);
+
+	mode = igt_output_get_mode(output);
+
+	/* Create two framebuffers with the same color info. */
+	igt_create_color_fb(data->drm_fd,
+			mode->hdisplay, mode->vdisplay,
+			DRM_FORMAT_XRGB8888,
+			LOCAL_DRM_FORMAT_MOD_NONE,
+			1.0, 1.0, 1.0,
+			&fb0);
+	igt_create_color_fb(data->drm_fd,
+			mode->hdisplay, mode->vdisplay,
+			DRM_FORMAT_XRGB8888,
+			LOCAL_DRM_FORMAT_MOD_NONE,
+			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);
+	igt_plane_set_fb(primary, &fb0);
+	igt_display_commit(display);
+
+	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+				    INTEL_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. */
+	igt_plane_set_fb(primary, &fb1);
+	igt_display_commit(display);
+
+	igt_pipe_crc_collect_crc(pipe_crc, &crc);
+	igt_assert_crc_equal(&crc, &ref_crc);
+
+	/* Clean-up */
+	igt_pipe_crc_free(pipe_crc);
+	igt_plane_set_fb(primary, NULL);
+	igt_output_set_pipe(output, PIPE_NONE);
+	igt_display_commit(display);
+
+	igt_remove_fb(data->drm_fd, &fb0);
+	igt_remove_fb(data->drm_fd, &fb1);
+}
+
 data_t data = {0, };
 
 igt_main
@@ -209,6 +278,10 @@ igt_main
 
 			igt_disallow_hang(data.drm_fd, hang);
 		}
+
+		igt_describe("Basic sanity check for CRC mismatches");
+		igt_subtest_f("compare-crc-basic-%s", kmstest_pipe_name(pipe))
+			test_compare_crc(&data, pipe);
 	}
 
 	igt_fixture {
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-08-06 16:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-06 18:07 [igt-dev] [PATCH v3 0/2] tests/kms_pipe_crc_basic: Sanity check for CRC mismatches Bhanuprakash Modem
2020-08-06 10:56 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_pipe_crc_basic: Sanity check for CRC mismatches (rev7) Patchwork
2020-08-06 13:12 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-08-06 13:19   ` Petri Latvala
2020-08-06 16:37     ` Vudum, Lakshminarayana
2020-08-06 18:07 ` [igt-dev] [PATCH v3 1/2] tests/kms_pipe_crc_basic: Sanity check for CRC mismatches Bhanuprakash Modem
2020-08-06 18:07 ` [igt-dev] [PATCH v1 2/2] intel-ci: Add compare CRC sanity test to BAT Bhanuprakash Modem
2020-08-06 18:24   ` [igt-dev] [PATCH v2] " Bhanuprakash Modem
2020-08-06 10:45     ` Sharma, Swati2
  -- strict thread matches above, loose matches on Subject: below --
2020-08-06 12:44 [igt-dev] [PATCH v2] tests/kms_pipe_crc_basic: Sanity check for CRC mismatches Bhanuprakash Modem
2020-08-06 18:04 ` [igt-dev] [PATCH v1 2/2] intel-ci: Add compare CRC sanity test to BAT Bhanuprakash Modem
2020-08-06 10:20   ` Petri Latvala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox