All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/
@ 2022-10-19 16:30 Ville Syrjala
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 2/3] tests/crc: s/"auto"/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Ville Syrjala @ 2022-10-19 16:30 UTC (permalink / raw)
  To: igt-dev

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

The "auto" crc source should be a drm wide thing by now.
Replace the INTEL_ prefix with IGT_.

v2: Convert more things

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_debugfs.c                     | 4 ++--
 lib/igt_debugfs.h                     | 2 +-
 tests/amdgpu/amd_color.c              | 2 +-
 tests/amdgpu/amd_max_bpc.c            | 2 +-
 tests/i915/gem_pxp.c                  | 3 ++-
 tests/i915/i915_pipe_stress.c         | 2 +-
 tests/i915/kms_big_fb.c               | 4 ++--
 tests/i915/kms_ccs.c                  | 3 ++-
 tests/i915/kms_draw_crc.c             | 2 +-
 tests/i915/kms_fbcon_fbt.c            | 2 +-
 tests/i915/kms_flip_scaled_crc.c      | 2 +-
 tests/i915/kms_flip_tiling.c          | 3 ++-
 tests/i915/kms_frontbuffer_tracking.c | 3 ++-
 tests/i915/kms_mmap_write_crc.c       | 2 +-
 tests/i915/kms_pwrite_crc.c           | 2 +-
 tests/kms_async_flips.c               | 2 +-
 tests/kms_atomic.c                    | 2 +-
 tests/kms_atomic_transition.c         | 3 ++-
 tests/kms_color.c                     | 2 +-
 tests/kms_cursor_crc.c                | 2 +-
 tests/kms_cursor_edge_walk.c          | 2 +-
 tests/kms_cursor_legacy.c             | 6 ++++--
 tests/kms_display_modes.c             | 4 ++--
 tests/kms_hdr.c                       | 2 +-
 tests/kms_multipipe_modeset.c         | 2 +-
 tests/kms_pipe_crc_basic.c            | 8 +++++---
 tests/kms_plane.c                     | 3 ++-
 tests/kms_plane_alpha_blend.c         | 3 ++-
 tests/kms_plane_cursor.c              | 2 +-
 tests/kms_plane_lowres.c              | 2 +-
 tests/kms_plane_multiple.c            | 3 ++-
 tests/kms_prime.c                     | 3 ++-
 tests/kms_rotation_crc.c              | 5 +++--
 tests/kms_universal_plane.c           | 3 ++-
 tools/intel_display_crc.c             | 3 ++-
 35 files changed, 58 insertions(+), 42 deletions(-)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index fa1e3b699730..fc4697b0af4a 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -761,7 +761,7 @@ pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
  *
  * Returns: A pipe CRC object for the given @pipe and @source. The library
  * assumes that the source is always available since recent kernels support at
- * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere.
+ * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
  */
 igt_pipe_crc_t *
 igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
@@ -779,7 +779,7 @@ igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
  *
  * Returns: A pipe CRC object for the given @pipe and @source. The library
  * assumes that the source is always available since recent kernels support at
- * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere.
+ * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
  */
 igt_pipe_crc_t *
 igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 37e85067b60b..05d29f171610 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -97,7 +97,7 @@ typedef struct {
 	uint32_t crc[DRM_MAX_CRC_NR];
 } igt_crc_t;
 
-#define INTEL_PIPE_CRC_SOURCE_AUTO "auto"
+#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
 #define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
 
 bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
diff --git a/tests/amdgpu/amd_color.c b/tests/amdgpu/amd_color.c
index 6d313bae74b5..defe57bd4fb8 100644
--- a/tests/amdgpu/amd_color.c
+++ b/tests/amdgpu/amd_color.c
@@ -192,7 +192,7 @@ static void test_init(data_t *data)
 		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
 
 	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(data->output, data->pipe_id);
 
diff --git a/tests/amdgpu/amd_max_bpc.c b/tests/amdgpu/amd_max_bpc.c
index 982a91e294c8..effe830a29d0 100644
--- a/tests/amdgpu/amd_max_bpc.c
+++ b/tests/amdgpu/amd_max_bpc.c
@@ -83,7 +83,7 @@ static void test_init(data_t *data)
 		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
 
 	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(data->output, data->pipe_id);
 
diff --git a/tests/i915/gem_pxp.c b/tests/i915/gem_pxp.c
index 65618556b03c..a75275217743 100644
--- a/tests/i915/gem_pxp.c
+++ b/tests/i915/gem_pxp.c
@@ -1110,7 +1110,8 @@ static void test_display_protected_crc(int i915, igt_display_t *display)
 	for_each_connected_output(display, output) {
 		mode = igt_output_get_mode(output);
 		pipe = &display->pipes[output->pending_pipe];
-		pipe_crc = igt_pipe_crc_new(i915, pipe->pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		pipe_crc = igt_pipe_crc_new(i915, pipe->pipe,
+					    IGT_PIPE_CRC_SOURCE_AUTO);
 		plane = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
 		igt_require(igt_pipe_connector_valid(pipe->pipe, output));
 		igt_output_set_pipe(output, pipe->pipe);
diff --git a/tests/i915/i915_pipe_stress.c b/tests/i915/i915_pipe_stress.c
index 3949d5c38363..6ce2ce1de23d 100644
--- a/tests/i915/i915_pipe_stress.c
+++ b/tests/i915/i915_pipe_stress.c
@@ -776,7 +776,7 @@ static void prepare_test(struct data *data)
 			igt_info("Using mode: \n");
 			kmstest_dump_mode(data->highest_mode[i]);
 			data->pipe_crc[i] = igt_pipe_crc_new(data->drm_fd, i,
-							     INTEL_PIPE_CRC_SOURCE_AUTO);
+							     IGT_PIPE_CRC_SOURCE_AUTO);
 		} else
 			data->pipe_crc[i] = NULL;
 
diff --git a/tests/i915/kms_big_fb.c b/tests/i915/kms_big_fb.c
index eb40e9cdf110..0beba0e18fe3 100644
--- a/tests/i915/kms_big_fb.c
+++ b/tests/i915/kms_big_fb.c
@@ -455,7 +455,7 @@ static bool test_pipe(data_t *data)
 			    COMMIT_ATOMIC : COMMIT_UNIVERSAL);
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	for_each_plane_on_pipe(&data->display, data->pipe, data->plane) {
 		ret = test_plane(data);
@@ -516,7 +516,7 @@ max_hw_stride_async_flip_test(data_t *data)
 	generate_pattern(data, &data->big_fb_flip[1], 640, 480);
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 	igt_pipe_crc_start(data->pipe_crc);
 
 	igt_plane_set_fb(primary, &data->big_fb);
diff --git a/tests/i915/kms_ccs.c b/tests/i915/kms_ccs.c
index 6721da493af5..9be3fa25267d 100644
--- a/tests/i915/kms_ccs.c
+++ b/tests/i915/kms_ccs.c
@@ -555,7 +555,8 @@ static int test_ccs(data_t *data)
 	enum test_fb_flags fb_flags = 0;
 
 	if (data->flags & TEST_CRC) {
-		data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
+						  IGT_PIPE_CRC_SOURCE_AUTO);
 
 		if (try_config(data, fb_flags | FB_COMPRESSED, &ref_crc) &&
 		    try_config(data, fb_flags, &crc)) {
diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
index b99f348d401e..c2ac4721de72 100644
--- a/tests/i915/kms_draw_crc.c
+++ b/tests/i915/kms_draw_crc.c
@@ -69,7 +69,7 @@ static void find_modeset_params(void)
 		if (!mode)
 			continue;
 
-		pipe_crc = igt_pipe_crc_new(drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		pipe_crc = igt_pipe_crc_new(drm_fd, pipe, IGT_PIPE_CRC_SOURCE_AUTO);
 		/*Only one pipe/output is enough*/
 		break;
 	}
diff --git a/tests/i915/kms_fbcon_fbt.c b/tests/i915/kms_fbcon_fbt.c
index 98c452c4f097..831ec867aefb 100644
--- a/tests/i915/kms_fbcon_fbt.c
+++ b/tests/i915/kms_fbcon_fbt.c
@@ -119,7 +119,7 @@ static bool fbc_check_cursor_blinking(struct drm_info *drm)
 	bool ret;
 	int i;
 
-	pipe_crc = igt_pipe_crc_new(drm->fd, PIPE_A, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc = igt_pipe_crc_new(drm->fd, PIPE_A, IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_pipe_crc_start(pipe_crc);
 	igt_pipe_crc_drain(pipe_crc);
diff --git a/tests/i915/kms_flip_scaled_crc.c b/tests/i915/kms_flip_scaled_crc.c
index 364f622ba699..10465ca757b1 100644
--- a/tests/i915/kms_flip_scaled_crc.c
+++ b/tests/i915/kms_flip_scaled_crc.c
@@ -537,7 +537,7 @@ static void test_flip_to_scaled(data_t *data, uint32_t index,
 		igt_pipe_crc_free(data->pipe_crc);
 	}
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_plane_set_position(primary, 0, 0);
 	igt_plane_set_fb(primary, &data->small_fb);
diff --git a/tests/i915/kms_flip_tiling.c b/tests/i915/kms_flip_tiling.c
index 0d8cc341c0b9..1183feb6333f 100644
--- a/tests/i915/kms_flip_tiling.c
+++ b/tests/i915/kms_flip_tiling.c
@@ -59,7 +59,8 @@ static void pipe_crc_new(data_t *data, int pipe)
 	if (data->pipe_crc)
 		return;
 
-	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 	igt_assert(data->pipe_crc);
 	igt_pipe_crc_start(data->pipe_crc);
 }
diff --git a/tests/i915/kms_frontbuffer_tracking.c b/tests/i915/kms_frontbuffer_tracking.c
index f2fd0352dcae..5b47999e879a 100644
--- a/tests/i915/kms_frontbuffer_tracking.c
+++ b/tests/i915/kms_frontbuffer_tracking.c
@@ -1259,7 +1259,8 @@ static void init_blue_crc(enum pixel_format format, enum tiling_type tiling)
 	igt_display_commit(&drm.display);
 
 	if (!pipe_crc) {
-		pipe_crc = igt_pipe_crc_new(drm.fd, prim_mode_params.pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+		pipe_crc = igt_pipe_crc_new(drm.fd, prim_mode_params.pipe,
+					    IGT_PIPE_CRC_SOURCE_AUTO);
 		igt_assert(pipe_crc);
 	}
 
diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
index b693c276b2c3..c36547fced9c 100644
--- a/tests/i915/kms_mmap_write_crc.c
+++ b/tests/i915/kms_mmap_write_crc.c
@@ -193,7 +193,7 @@ static void prepare_crtc(data_t *data)
 		igt_pipe_crc_free(data->pipe_crc);
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* get reference crc for the white fb */
 	igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
diff --git a/tests/i915/kms_pwrite_crc.c b/tests/i915/kms_pwrite_crc.c
index 7df4b36924fa..c84a184d84cc 100644
--- a/tests/i915/kms_pwrite_crc.c
+++ b/tests/i915/kms_pwrite_crc.c
@@ -129,7 +129,7 @@ static void prepare_crtc(data_t *data)
 		igt_pipe_crc_free(data->pipe_crc);
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* get reference crc for the white fb */
 	igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 695aea74d4f3..7cb71f6b441a 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -504,7 +504,7 @@ static void test_crc(data_t *data)
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
 					  kmstest_get_pipe_from_crtc_id(data->drm_fd, data->crtc_id),
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_pipe_crc_start(data->pipe_crc);
 	igt_pipe_crc_get_single(data->pipe_crc, &data->ref_crc);
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c
index 831ba2587292..2a3fb74becec 100644
--- a/tests/kms_atomic.c
+++ b/tests/kms_atomic.c
@@ -418,7 +418,7 @@ plane_immutable_zpos(igt_display_t *display, igt_pipe_t *pipe,
 
 	/* create the pipe_crc object for this pipe */
 	pipe_crc = igt_pipe_crc_new(pipe->display->drm_fd, pipe->pipe,
-				    INTEL_PIPE_CRC_SOURCE_AUTO);
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* get reference crc */
 	igt_pipe_crc_start(pipe_crc);
diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index 25757131de56..6d2ebbbff1d9 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -832,7 +832,8 @@ retry:
 		j += 1;
 
 		if (is_i915_device(data->drm_fd))
-			data->pipe_crcs[i] = igt_pipe_crc_new(data->drm_fd, i, INTEL_PIPE_CRC_SOURCE_AUTO);
+			data->pipe_crcs[i] = igt_pipe_crc_new(data->drm_fd, i,
+							      IGT_PIPE_CRC_SOURCE_AUTO);
 
 		for_each_valid_output_on_pipe(&data->display, i, output) {
 			if (output->pending_pipe != PIPE_NONE)
diff --git a/tests/kms_color.c b/tests/kms_color.c
index d5df98408c2b..e4dc2465ec9d 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -693,7 +693,7 @@ static void test_setup(data_t *data, enum pipe p)
 	data->primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
 					  data->primary->pipe->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_display_require_output_on_pipe(&data->display, p);
 	data->output = igt_get_single_output_for_pipe(&data->display, p);
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 2d6b43f764dc..d51c1f90a352 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -502,7 +502,7 @@ static void prepare_crtc(data_t *data, int cursor_w, int cursor_h)
 	if (data->pipe_crc)
 		igt_pipe_crc_free(data->pipe_crc);
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* x/y position where the cursor is still fully visible */
 	data->left = 0;
diff --git a/tests/kms_cursor_edge_walk.c b/tests/kms_cursor_edge_walk.c
index 74187613276e..e653b9ab962d 100644
--- a/tests/kms_cursor_edge_walk.c
+++ b/tests/kms_cursor_edge_walk.c
@@ -255,7 +255,7 @@ static void prepare_crtc(data_t *data)
 
 	/* create the pipe_crc object for this pipe */
 	data->pipe_crc = igt_pipe_crc_new_nonblock(data->drm_fd, data->pipe,
-						   INTEL_PIPE_CRC_SOURCE_AUTO);
+						   IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* get reference crc w/o cursor */
 	igt_pipe_crc_start(data->pipe_crc);
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index 1ad92eaae881..0a8a31976046 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -1360,7 +1360,8 @@ static void flip_vs_cursor_crc(igt_display_t *display, bool atomic)
 
 	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
-	pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	cursor = set_cursor_on_pipe(display, pipe, &cursor_fb);
 	igt_display_commit2(display, COMMIT_UNIVERSAL);
@@ -1432,7 +1433,8 @@ static void flip_vs_cursor_busy_crc(igt_display_t *display, bool atomic)
 
 	igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
-	pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc = igt_pipe_crc_new(display->drm_fd, pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	cursor = set_cursor_on_pipe(display, pipe, &cursor_fb);
 	igt_display_commit2(display, COMMIT_UNIVERSAL);
diff --git a/tests/kms_display_modes.c b/tests/kms_display_modes.c
index eff30cbb1e69..e4191811e8ef 100644
--- a/tests/kms_display_modes.c
+++ b/tests/kms_display_modes.c
@@ -60,8 +60,8 @@ static void run_extendedmode_basic(data_t *data, int pipe1, int pipe2)
 	mode[0] = igt_output_get_mode(extended_output[0]);
 	mode[1] = igt_output_get_mode(extended_output[1]);
 
-	pipe_crc[0] = igt_pipe_crc_new(data->drm_fd, pipe1, INTEL_PIPE_CRC_SOURCE_AUTO);
-	pipe_crc[1] = igt_pipe_crc_new(data->drm_fd, pipe2, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc[0] = igt_pipe_crc_new(data->drm_fd, pipe1, IGT_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc[1] = igt_pipe_crc_new(data->drm_fd, pipe2, IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_create_color_fb(data->drm_fd, mode[0]->hdisplay, mode[0]->vdisplay,
 			     DRM_FORMAT_XRGB8888, 0, 1, 0, 0, &fbs[0]);
diff --git a/tests/kms_hdr.c b/tests/kms_hdr.c
index c18acb60f99e..655c3e14f7ef 100644
--- a/tests/kms_hdr.c
+++ b/tests/kms_hdr.c
@@ -127,7 +127,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
 		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_PRIMARY);
 
 	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(data->output, data->pipe_id);
 	igt_output_set_prop_value(data->output, IGT_CONNECTOR_MAX_BPC, 10);
diff --git a/tests/kms_multipipe_modeset.c b/tests/kms_multipipe_modeset.c
index 6358d9306bc6..1fdfb9a9f7a2 100644
--- a/tests/kms_multipipe_modeset.c
+++ b/tests/kms_multipipe_modeset.c
@@ -67,7 +67,7 @@ static void run_test(data_t *data, int valid_outputs)
 		mode = NULL;
 
 		pipe_crcs[i] = igt_pipe_crc_new(display->drm_fd, i,
-						INTEL_PIPE_CRC_SOURCE_AUTO);
+						IGT_PIPE_CRC_SOURCE_AUTO);
 
 		igt_output_set_pipe(output, i);
 		mode = igt_output_get_mode(output);
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 2985de51c33c..13dd549bd602 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -107,7 +107,8 @@ static void test_read_crc(data_t *data, enum pipe pipe,
 		if (flags & TEST_NONBLOCK) {
 			igt_pipe_crc_t *pipe_crc;
 
-			pipe_crc = igt_pipe_crc_new_nonblock(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+			pipe_crc = igt_pipe_crc_new_nonblock(data->drm_fd, pipe,
+							     IGT_PIPE_CRC_SOURCE_AUTO);
 			igt_wait_for_vblank(data->drm_fd, display->pipes[pipe].crtc_offset);
 			igt_pipe_crc_start(pipe_crc);
 
@@ -122,7 +123,8 @@ static void test_read_crc(data_t *data, enum pipe pipe,
 		} else {
 			igt_pipe_crc_t *pipe_crc;
 
-			pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+			pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+						    IGT_PIPE_CRC_SOURCE_AUTO);
 			igt_pipe_crc_start(pipe_crc);
 
 			n_crcs = igt_pipe_crc_get_crcs(pipe_crc, N_CRCS, &crcs);
@@ -206,7 +208,7 @@ static void test_compare_crc(data_t *data, enum pipe pipe, igt_output_t *output)
 	igt_display_commit(display);
 
 	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
-				    INTEL_PIPE_CRC_SOURCE_AUTO);
+				    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. */
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index eb943e13f408..8a54ba6645c8 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -76,7 +76,8 @@ static color_t blue  = { 0.0f, 0.0f, 1.0f };
 static void test_init(data_t *data, enum pipe pipe)
 {
 	igt_require(data->display.pipes[pipe].n_planes > 0);
-	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 	igt_display_reset(&data->display);
 }
 
diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index 31f1fd0d3ff2..ccf1d65796ef 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -176,7 +176,8 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe)
 
 	/* create the pipe_crc object for this pipe */
 	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	mode = igt_output_get_mode(output);
 	w = mode->hdisplay;
diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
index e9abfd7888d6..f5dfd9bde9fe 100644
--- a/tests/kms_plane_cursor.c
+++ b/tests/kms_plane_cursor.c
@@ -87,7 +87,7 @@ static void test_init(data_t *data, enum pipe pipe_id, igt_output_t *output)
 
 	igt_require_pipe_crc(data->drm_fd);
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe_id,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	/* Overlay rectangle for a rect in the center of the screen */
 	data->or.x = data->mode->hdisplay / 4;
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c
index bb6cffac0911..6dfc147c270f 100644
--- a/tests/kms_plane_lowres.c
+++ b/tests/kms_plane_lowres.c
@@ -278,7 +278,7 @@ static void run_test(data_t *data, uint64_t modifier)
 			igt_output_set_pipe(data->output, data->pipe);
 
 			data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-							  INTEL_PIPE_CRC_SOURCE_AUTO);
+							  IGT_PIPE_CRC_SOURCE_AUTO);
 
 			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), data->output->name)
 				test_planes_on_pipe(data, modifier);
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 637d63f0bd4e..75659015942e 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -68,7 +68,8 @@ struct {
  */
 static void test_init(data_t *data, enum pipe pipe, int n_planes)
 {
-	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	data->plane = calloc(n_planes, sizeof(*data->plane));
 	igt_assert_f(data->plane != NULL, "Failed to allocate memory for planes\n");
diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 3df690e0497e..097c2f2a5036 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -237,7 +237,8 @@ static void test_crc(int exporter_fd, int importer_fd)
 	output = setup_display(importer_fd, &display, &pipe);
 
 	mode = igt_output_get_mode(output);
-	pipe_crc = igt_pipe_crc_new(importer_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc = igt_pipe_crc_new(importer_fd, pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	for (i = 0; i < ARRAY_SIZE(colors); i++) {
 		prepare_scratch(exporter_fd, &scratch, mode, colors[i].color);
diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 740e01eb5f1d..72c20d5a42e6 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -225,7 +225,8 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	 */
 	if (!is_amdgpu_device(data->gfx_fd))
 		igt_display_commit2(display, COMMIT_ATOMIC);
-	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
+				          IGT_PIPE_CRC_SOURCE_AUTO);
 
 	if (!is_amdgpu_device(data->gfx_fd) && start_crc)
 		igt_pipe_crc_start(data->pipe_crc);
@@ -815,7 +816,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 		p[1].plane = igt_output_get_plane_type(output, DRM_PLANE_TYPE_OVERLAY);
 
 		data->pipe_crc = igt_pipe_crc_new(data->gfx_fd, pipe,
-						  INTEL_PIPE_CRC_SOURCE_AUTO);
+						  IGT_PIPE_CRC_SOURCE_AUTO);
 		igt_pipe_crc_start(data->pipe_crc);
 
 		for (i = 0; i < ARRAY_SIZE(planeconfigs); i++) {
diff --git a/tests/kms_universal_plane.c b/tests/kms_universal_plane.c
index e732b09a9a80..dd8fa19373a8 100644
--- a/tests/kms_universal_plane.c
+++ b/tests/kms_universal_plane.c
@@ -68,7 +68,8 @@ functional_test_init(functional_test_t *test, igt_output_t *output, enum pipe pi
 	data_t *data = test->data;
 	drmModeModeInfo *mode;
 
-	test->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	test->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(output, pipe);
 
diff --git a/tools/intel_display_crc.c b/tools/intel_display_crc.c
index d1b28ea77371..61291fc2aa88 100644
--- a/tools/intel_display_crc.c
+++ b/tools/intel_display_crc.c
@@ -67,7 +67,8 @@ static void print_crcs(display_crc_t *ctx)
 	char *crc_str;
 	int i;
 
-	pipe_crc = igt_pipe_crc_new(ctx->fd, ctx->pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	pipe_crc = igt_pipe_crc_new(ctx->fd, ctx->pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	for (i = 0; i < ctx->n_crcs; i++) {
 		igt_pipe_crc_collect_crc(pipe_crc, &crc);
-- 
2.35.1

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

* [igt-dev] [PATCH i-g-t v3 2/3] tests/crc: s/"auto"/IGT_PIPE_CRC_SOURCE_AUTO/
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
@ 2022-10-19 16:30 ` Ville Syrjala
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs Ville Syrjala
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Ville Syrjala @ 2022-10-19 16:30 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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

Replace the hand rolled "auto" string with the
define we have for it.

Simple cocci job:
@@
@@
 igt_pipe_crc_new(...,
- "auto"
+ IGT_PIPE_CRC_SOURCE_AUTO
 )

v2: Convert more stuff

Suggested-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/amdgpu/amd_dp_dsc.c  | 3 ++-
 tests/amdgpu/amd_hotplug.c | 3 ++-
 tests/amdgpu/amd_plane.c   | 3 ++-
 tests/amdgpu/amd_psr.c     | 3 ++-
 tests/kms_bw.c             | 3 ++-
 tests/kms_pipe_crc_basic.c | 3 ++-
 tests/nouveau_crc.c        | 7 ++++---
 7 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/tests/amdgpu/amd_dp_dsc.c b/tests/amdgpu/amd_dp_dsc.c
index 8a18df3bcd6e..e6b5a43be6fb 100644
--- a/tests/amdgpu/amd_dp_dsc.c
+++ b/tests/amdgpu/amd_dp_dsc.c
@@ -69,7 +69,8 @@ static void test_init(data_t *data)
 		data->primary[i] = igt_pipe_get_plane_type(
 				data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
 		data->pipe_crc[i] =
-				igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
+				igt_pipe_crc_new(data->fd, data->pipe_id[i],
+						 IGT_PIPE_CRC_SOURCE_AUTO);
 	}
 
 	for (i = 0, n = 0; i < display->n_outputs && n < display->n_pipes; ++i) {
diff --git a/tests/amdgpu/amd_hotplug.c b/tests/amdgpu/amd_hotplug.c
index 7e6b63db6323..736040a2c18e 100644
--- a/tests/amdgpu/amd_hotplug.c
+++ b/tests/amdgpu/amd_hotplug.c
@@ -59,7 +59,8 @@ static void test_init(data_t *data)
 		data->cursor[i] = igt_pipe_get_plane_type(
 			data->pipe[i], DRM_PLANE_TYPE_CURSOR);
 		data->pipe_crc[i] =
-			igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
+			igt_pipe_crc_new(data->fd, data->pipe_id[i],
+					 IGT_PIPE_CRC_SOURCE_AUTO);
 	}
 
 	for (i = 0, n = 0; i < display->n_outputs && n < max_pipes; ++i) {
diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c
index 4b2bee492255..b9eec677dc4a 100644
--- a/tests/amdgpu/amd_plane.c
+++ b/tests/amdgpu/amd_plane.c
@@ -162,7 +162,8 @@ static void test_init(data_t *data)
 		data->cursor[i] = igt_pipe_get_plane_type(
 			data->pipe[i], DRM_PLANE_TYPE_CURSOR);
 		data->pipe_crc[i] =
-			igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
+			igt_pipe_crc_new(data->fd, data->pipe_id[i],
+					 IGT_PIPE_CRC_SOURCE_AUTO);
 	}
 
 	for (i = 0, n = 0; i < display->n_outputs && n < max_pipes; ++i) {
diff --git a/tests/amdgpu/amd_psr.c b/tests/amdgpu/amd_psr.c
index 695ea5a8842e..966a0dccfa12 100644
--- a/tests/amdgpu/amd_psr.c
+++ b/tests/amdgpu/amd_psr.c
@@ -190,7 +190,8 @@ static void test_init(data_t *data)
 	data->overlay =
 		igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_OVERLAY);
 
-	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id, "auto");
+	data->pipe_crc = igt_pipe_crc_new(data->fd, data->pipe_id,
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(data->output, data->pipe_id);
 
diff --git a/tests/kms_bw.c b/tests/kms_bw.c
index 7bb1332ee881..2a8df5b3e4a2 100644
--- a/tests/kms_bw.c
+++ b/tests/kms_bw.c
@@ -82,7 +82,8 @@ static void test_init(data_t *data)
 		data->primary[i] = igt_pipe_get_plane_type(
 			data->pipe[i], DRM_PLANE_TYPE_PRIMARY);
 		data->pipe_crc[i] =
-			igt_pipe_crc_new(data->fd, data->pipe_id[i], "auto");
+			igt_pipe_crc_new(data->fd, data->pipe_id[i],
+					 IGT_PIPE_CRC_SOURCE_AUTO);
 	}
 
 	for (i = 0; i < display->n_outputs && i < max_pipes; i++) {
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 13dd549bd602..91a1b8ab12a8 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -237,7 +237,8 @@ static void test_disable_crc_after_crtc(data_t *data, enum pipe pipe,
 	igt_crc_t crc[2];
 	igt_plane_t *primary;
 
-	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, "auto");
+	pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_display_reset(display);
 	igt_output_set_pipe(output, pipe);
diff --git a/tests/nouveau_crc.c b/tests/nouveau_crc.c
index 076cbda40ade..785d39bde6c6 100644
--- a/tests/nouveau_crc.c
+++ b/tests/nouveau_crc.c
@@ -122,7 +122,8 @@ static void test_ctx_flip_detection(data_t *data)
 	int start = -1, frame, start_color = -1, i;
 	bool found_skip = false;
 
-	pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe, "auto");
+	pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	create_crc_colors(data, colors, n_colors, pipe_crc);
 
@@ -232,7 +233,7 @@ static void test_ctx_flip_skip_current_frame(data_t *data)
 	const int n_colors = ARRAY_SIZE(colors);
 	const int n_crcs = 30;
 
-	pipe_crc = igt_pipe_crc_new(fd, data->pipe, "auto");
+	pipe_crc = igt_pipe_crc_new(fd, data->pipe, IGT_PIPE_CRC_SOURCE_AUTO);
 	create_crc_colors(data, colors, n_colors, pipe_crc);
 
 	set_crc_flip_threshold(data, 5);
@@ -264,7 +265,7 @@ static void test_ctx_flip_threshold_reset_after_capture(data_t *data)
 	igt_pipe_crc_t *pipe_crc;
 	const int fd = data->drm_fd;
 
-	pipe_crc = igt_pipe_crc_new(fd, data->pipe, "auto");
+	pipe_crc = igt_pipe_crc_new(fd, data->pipe, IGT_PIPE_CRC_SOURCE_AUTO);
 
 	set_crc_flip_threshold(data, 5);
 	igt_pipe_crc_start(pipe_crc);
-- 
2.35.1

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

* [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 2/3] tests/crc: s/"auto"/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
@ 2022-10-19 16:30 ` Ville Syrjala
  2022-10-20  8:18   ` Petri Latvala
  2022-10-20  9:45   ` Kamil Konieczny
  2022-10-19 17:32 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Patchwork
                   ` (4 subsequent siblings)
  6 siblings, 2 replies; 12+ messages in thread
From: Ville Syrjala @ 2022-10-19 16:30 UTC (permalink / raw)
  To: igt-dev

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

No reason to hide the pipe CRC code inside the debugfs stuff.
The fact that pipe CRCs are operated through debugfs is just
an irrelevant implementation detail.

Fixed up the few cases that don't include igt.h with this cocci:
@find@
identifier ID;
@@
igt_crc_t ID;

@has_include@
@@
(
 #include "igt_pipe_crc.h"
|
 #include "igt.h"
)

@depends on find && !has_include@
@@
  #include "igt_kms.h"
+ #include "igt_pipe_crc.h"

v2: better cocci to catch lib/igt_chamelium.c
v3: Rebase and roll on doc fix from Petri

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../igt-gpu-tools/igt-gpu-tools-docs.xml      |   1 +
 lib/igt.h                                     |   1 +
 lib/igt_chamelium.c                           |   1 +
 lib/igt_chamelium.h                           |   1 +
 lib/igt_debugfs.c                             | 564 ----------------
 lib/igt_debugfs.h                             |  57 --
 lib/igt_fb.h                                  |   1 +
 lib/igt_pipe_crc.c                            | 610 ++++++++++++++++++
 lib/igt_pipe_crc.h                            |  87 +++
 lib/meson.build                               |   1 +
 tests/i915/kms_mmap_write_crc.c               |   1 +
 tools/intel_display_crc.c                     |   1 +
 12 files changed, 705 insertions(+), 621 deletions(-)
 create mode 100644 lib/igt_pipe_crc.c
 create mode 100644 lib/igt_pipe_crc.h

diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
index a19f786e841b..1ce842f45321 100644
--- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
+++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
@@ -37,6 +37,7 @@
     <xi:include href="xml/igt_list.xml"/>
     <xi:include href="xml/igt_map.xml"/>
     <xi:include href="xml/igt_msm.xml"/>
+    <xi:include href="xml/igt_pipe_crc.xml"/>
     <xi:include href="xml/igt_pm.xml"/>
     <xi:include href="xml/igt_primes.xml"/>
     <xi:include href="xml/igt_rand.xml"/>
diff --git a/lib/igt.h b/lib/igt.h
index 96a368e11bbf..88938109e003 100644
--- a/lib/igt.h
+++ b/lib/igt.h
@@ -37,6 +37,7 @@
 #include "igt_gt.h"
 #include "igt_kms.h"
 #include "igt_params.h"
+#include "igt_pipe_crc.h"
 #include "igt_pm.h"
 #include "igt_stats.h"
 #ifdef HAVE_CHAMELIUM
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 26244bd5fc97..ea296e027e16 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -44,6 +44,7 @@
 #include "igt_frame.h"
 #include "igt_list.h"
 #include "igt_kms.h"
+#include "igt_pipe_crc.h"
 #include "igt_rc.h"
 
 /**
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index f40e848e4f67..af88fec914bd 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -36,6 +36,7 @@
 
 struct igt_fb;
 struct edid;
+typedef struct _igt_crc igt_crc_t;
 
 struct chamelium;
 struct chamelium_port;
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index fc4697b0af4a..85d350d359bd 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -55,24 +55,6 @@
  * basic functions to access debugfs files with e.g. igt_debugfs_open() it also
  * provides higher-level wrappers for some debugfs features.
  *
- * # Pipe CRC Support
- *
- * This library wraps up the kernel's support for capturing pipe CRCs into a
- * neat and tidy package. For the detailed usage see all the functions which
- * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
- *
- * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
- * there is no way to directly check a CRC: Both the details of the plane
- * blending, color correction and other hardware and how exactly the CRC is
- * computed at each tap point vary by hardware generation and are not disclosed.
- *
- * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
- * another either for equality or difference. Otherwise CRCs must be treated as
- * completely opaque values. Note that not even CRCs from different pipes or tap
- * points on the same platform can be compared. Hence only use
- * igt_assert_crc_equal() to inspect CRC values captured by the same
- * #igt_pipe_crc_t object.
- *
  * # Other debugfs interface wrappers
  *
  * This covers the miscellaneous debugfs interface wrappers:
@@ -425,175 +407,6 @@ bool igt_debugfs_search(int device, const char *filename, const char *substring)
 	return matched;
 }
 
-/*
- * Pipe CRC
- */
-
-/**
- * igt_find_crc_mismatch:
- * @a: first pipe CRC value
- * @b: second pipe CRC value
- * @index: index of the first value that mismatched
- *
- * Check if CRC a and CRC b mismatch.
- *
- * Returns true if CRC values mismatch, false otherwise;
- */
-bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
-{
-	int nwords = min(a->n_words, b->n_words);
-	int i;
-
-	for (i = 0; i < nwords; i++) {
-		if (a->crc[i] != b->crc[i]) {
-			if (index)
-				*index = i;
-
-			return true;
-		}
-	}
-
-	if (a->n_words != b->n_words) {
-		if (index)
-			*index = i;
-		return true;
-	}
-
-	return false;
-}
-
-/**
- * igt_assert_crc_equal:
- * @a: first pipe CRC value
- * @b: second pipe CRC value
- *
- * Compares two CRC values and fails the testcase if they don't match with
- * igt_fail(). Note that due to CRC collisions CRC based testcase can only
- * assert that CRCs match, never that they are different. Otherwise there might
- * be random testcase failures when different screen contents end up with the
- * same CRC by chance.
- *
- * Passing --skip-crc-compare on the command line will force this function
- * to always pass, which can be useful in interactive debugging where you
- * might know the test will fail, but still want the test to keep going as if
- * it had succeeded so that you can see the on-screen behavior.
- *
- */
-void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
-{
-	int index;
-	bool mismatch;
-
-	mismatch = igt_find_crc_mismatch(a, b, &index);
-	if (mismatch)
-		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
-			  igt_skip_crc_compare ? " (ignored)" : "",
-			  index, a->crc[index], b->crc[index]);
-
-	igt_assert(!mismatch || igt_skip_crc_compare);
-}
-
-/**
- * igt_check_crc_equal:
- * @a: first pipe CRC value
- * @b: second pipe CRC value
- *
- * Compares two CRC values and return whether they match.
- *
- * Returns: A boolean indicating whether the CRC values match
- */
-bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
-{
-	int index;
-	bool mismatch;
-
-	mismatch = igt_find_crc_mismatch(a, b, &index);
-	if (mismatch)
-		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
-			  a->crc[index], b->crc[index]);
-
-	return !mismatch;
-}
-
-/**
- * igt_crc_to_string_extended:
- * @crc: pipe CRC value to print
- * @delimiter: The delimiter to use between crc words
- * @crc_size: the number of bytes to print per crc word (between 1 and 4)
- *
- * This function allocates a string and formats @crc into it, depending on
- * @delimiter and @crc_size.
- * The caller is responsible for freeing the string.
- *
- * This should only ever be used for diagnostic debug output.
- */
-char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
-{
-	int i;
-	int len = 0;
-	int field_width = 2 * crc_size; /* Two chars per byte. */
-	char *buf = malloc((field_width+1) * crc->n_words);
-
-	if (!buf)
-		return NULL;
-
-	for (i = 0; i < crc->n_words - 1; i++)
-		len += sprintf(buf + len, "%0*x%c", field_width,
-			       crc->crc[i], delimiter);
-
-	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
-
-	return buf;
-}
-
-/**
- * igt_crc_to_string:
- * @crc: pipe CRC value to print
- *
- * This function allocates a string and formats @crc into it.
- * The caller is responsible for freeing the string.
- *
- * This should only ever be used for diagnostic debug output.
- */
-char *igt_crc_to_string(igt_crc_t *crc)
-{
-	return igt_crc_to_string_extended(crc, ' ', 4);
-}
-
-#define MAX_CRC_ENTRIES 10
-#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
-
-struct _igt_pipe_crc {
-	int fd;
-	int dir;
-	int ctl_fd;
-	int crc_fd;
-	int flags;
-
-	enum pipe pipe;
-	char *source;
-};
-
-/**
- * igt_require_pipe_crc:
- *
- * Convenience helper to check whether pipe CRC capturing is supported by the
- * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
- * the case.
- */
-void igt_require_pipe_crc(int fd)
-{
-	int dir;
-	struct stat stat;
-
-	dir = igt_debugfs_dir(fd);
-	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
-	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
-		      "CRCs not supported on this platform\n");
-
-	close(dir);
-}
-
 static void igt_hpd_storm_exit_handler(int sig)
 {
 	int fd = drm_open_driver(DRIVER_INTEL);
@@ -715,383 +528,6 @@ void igt_require_hpd_storm_ctl(int drm_fd)
 	close(fd);
 }
 
-static igt_pipe_crc_t *
-pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
-{
-	igt_pipe_crc_t *pipe_crc;
-	char buf[128];
-	int debugfs;
-	const char *env_source;
-
-	igt_assert(source);
-
-	env_source = getenv("IGT_CRC_SOURCE");
-
-	if (!env_source)
-		env_source = source;
-
-	debugfs = igt_debugfs_dir(fd);
-	igt_assert(debugfs != -1);
-
-	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
-	igt_assert(pipe_crc);
-
-	sprintf(buf, "crtc-%d/crc/control", pipe);
-	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
-	igt_assert(pipe_crc->ctl_fd != -1);
-
-	pipe_crc->crc_fd = -1;
-	pipe_crc->fd = fd;
-	pipe_crc->dir = debugfs;
-	pipe_crc->pipe = pipe;
-	pipe_crc->source = strdup(env_source);
-	igt_assert(pipe_crc->source);
-	pipe_crc->flags = flags;
-
-	return pipe_crc;
-}
-
-/**
- * igt_pipe_crc_new:
- * @pipe: display pipe to use as source
- * @source: CRC tap point to use as source
- *
- * This sets up a new pipe CRC capture object for the given @pipe and @source
- * in blocking mode.
- *
- * Returns: A pipe CRC object for the given @pipe and @source. The library
- * assumes that the source is always available since recent kernels support at
- * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
- */
-igt_pipe_crc_t *
-igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
-{
-	return pipe_crc_new(fd, pipe, source, O_RDONLY);
-}
-
-/**
- * igt_pipe_crc_new_nonblock:
- * @pipe: display pipe to use as source
- * @source: CRC tap point to use as source
- *
- * This sets up a new pipe CRC capture object for the given @pipe and @source
- * in nonblocking mode.
- *
- * Returns: A pipe CRC object for the given @pipe and @source. The library
- * assumes that the source is always available since recent kernels support at
- * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
- */
-igt_pipe_crc_t *
-igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
-{
-	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
-}
-
-/**
- * igt_pipe_crc_free:
- * @pipe_crc: pipe CRC object
- *
- * Frees all resources associated with @pipe_crc.
- */
-void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
-{
-	if (!pipe_crc)
-		return;
-
-	close(pipe_crc->ctl_fd);
-	close(pipe_crc->crc_fd);
-	close(pipe_crc->dir);
-	free(pipe_crc->source);
-	free(pipe_crc);
-}
-
-static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
-				      const char *line)
-{
-	int i;
-	const char *buf;
-
-	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
-		crc->has_valid_frame = false;
-	else {
-		crc->has_valid_frame = true;
-		crc->frame = strtoul(line, NULL, 16);
-	}
-
-	buf = line + 10;
-	for (i = 0; *buf != '\n'; i++, buf += 11)
-		crc->crc[i] = strtoul(buf, NULL, 16);
-
-	crc->n_words = i;
-
-	return true;
-}
-
-static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
-{
-	ssize_t bytes_read;
-	char buf[MAX_LINE_LEN + 1];
-
-	igt_set_timeout(5, "CRC reading");
-	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
-	igt_reset_timeout();
-
-	if (bytes_read < 0)
-		bytes_read = -errno;
-	else
-		buf[bytes_read] = '\0';
-
-	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
-		return -EINVAL;
-
-	return bytes_read;
-}
-
-static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
-{
-	int ret;
-
-	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
-
-	do {
-		ret = read_crc(pipe_crc, out);
-	} while (ret == -EINTR);
-
-	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
-}
-
-/**
- * igt_pipe_crc_start:
- * @pipe_crc: pipe CRC object
- *
- * Starts the CRC capture process on @pipe_crc.
- */
-void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
-{
-	const char *src = pipe_crc->source;
-	struct pollfd pfd;
-	char buf[32];
-
-	/* Stop first just to make sure we don't have lingering state left. */
-	igt_pipe_crc_stop(pipe_crc);
-
-	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
-
-	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
-
-	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
-
-	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
-	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
-	igt_assert(pipe_crc->crc_fd != -1);
-
-	pfd.fd = pipe_crc->crc_fd;
-	pfd.events = POLLIN;
-	poll(&pfd, 1, -1);
-
-	igt_reset_timeout();
-
-	errno = 0;
-}
-
-/**
- * igt_pipe_crc_stop:
- * @pipe_crc: pipe CRC object
- *
- * Stops the CRC capture process on @pipe_crc.
- */
-void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
-{
-	close(pipe_crc->crc_fd);
-	pipe_crc->crc_fd = -1;
-}
-
-/**
- * igt_pipe_crc_get_crcs:
- * @pipe_crc: pipe CRC object
- * @n_crcs: number of CRCs to capture
- * @out_crcs: buffer pointer for the captured CRC values
- *
- * Read up to @n_crcs from @pipe_crc. This function does not block, and will
- * return early if not enough CRCs can be captured, if @pipe_crc has been
- * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
- * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
- * alloced by this function and must be released with free() by the caller.
- *
- * Callers must start and stop the capturing themselves by calling
- * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
- * look at igt_pipe_crc_collect_crc().
- *
- * Returns:
- * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
- * can be less (even zero) in non-blocking mode.
- */
-int
-igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
-		      igt_crc_t **out_crcs)
-{
-	igt_crc_t *crcs;
-	int n = 0;
-
-	crcs = calloc(n_crcs, sizeof(igt_crc_t));
-
-	do {
-		igt_crc_t *crc = &crcs[n];
-		int ret;
-
-		ret = read_crc(pipe_crc, crc);
-		if (ret == -EAGAIN)
-			break;
-
-		if (ret < 0)
-			continue;
-
-		n++;
-	} while (n < n_crcs);
-
-	*out_crcs = crcs;
-	return n;
-}
-
-static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
-{
-	int i;
-	bool all_zero = true;
-
-	/* Any CRC value can be considered valid on amdgpu hardware. */
-	if (is_amdgpu_device(pipe_crc->fd))
-		return;
-
-	for (i = 0; i < crc->n_words; i++) {
-		igt_warn_on_f(crc->crc[i] == 0xffffffff,
-			      "Suspicious CRC: it looks like the CRC "
-			      "read back was from a register in a powered "
-			      "down well\n");
-		if (crc->crc[i])
-			all_zero = false;
-	}
-
-	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
-}
-
-/**
- * igt_pipe_crc_drain:
- * @pipe_crc: pipe CRC object
- *
- * Discards all currently queued CRC values from @pipe_crc. This function does
- * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
- * CRC with igt_pipe_crc_get_single().
- */
-void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
-{
-	int ret;
-	igt_crc_t crc;
-
-	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
-
-	do {
-		ret = read_crc(pipe_crc, &crc);
-	} while (ret > 0 || ret == -EINVAL);
-
-	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
-}
-
-/**
- * igt_pipe_crc_get_single:
- * @pipe_crc: pipe CRC object
- * @crc: buffer pointer for the captured CRC value
- *
- * Read a single @crc from @pipe_crc. This function blocks even
- * when nonblocking CRC is requested.
- *
- * Callers must start and stop the capturing themselves by calling
- * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
- * look at igt_pipe_crc_collect_crc().
- *
- * If capturing has been going on for a while and a fresh crc is required,
- * you should use igt_pipe_crc_get_current() instead.
- */
-void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
-{
-	read_one_crc(pipe_crc, crc);
-
-	crc_sanity_checks(pipe_crc, crc);
-}
-
-/**
- * igt_pipe_crc_get_current:
- * @drm_fd: Pointer to drm fd for vblank counter
- * @pipe_crc: pipe CRC object
- * @vblank: frame counter value we're looking for
- * @crc: buffer pointer for the captured CRC value
- *
- * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
- * for frame @vblank.
- */
-void
-igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
-			   unsigned int vblank, igt_crc_t *crc)
-{
-	do {
-		read_one_crc(pipe_crc, crc);
-
-		/* Only works with valid frame counter */
-		if (!crc->has_valid_frame) {
-			igt_pipe_crc_drain(pipe_crc);
-			igt_pipe_crc_get_single(pipe_crc, crc);
-			return;
-		}
-	} while (igt_vblank_before(crc->frame, vblank));
-
-	crc_sanity_checks(pipe_crc, crc);
-}
-
-/**
- * igt_pipe_crc_get_current:
- * @drm_fd: Pointer to drm fd for vblank counter
- * @pipe_crc: pipe CRC object
- * @crc: buffer pointer for the captured CRC value
- *
- * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
- * This is useful for retrieving the current CRC in a more race free way than
- * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
- */
-void
-igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
-{
-	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
-
-	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
-}
-
-/**
- * igt_pipe_crc_collect_crc:
- * @pipe_crc: pipe CRC object
- * @out_crc: buffer for the captured CRC values
- *
- * Read a single CRC from @pipe_crc. This function blocks until the CRC is
- * retrieved, irrespective of whether @pipe_crc has been opened with
- * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
- * allocated by the caller.
- *
- * This function takes care of the pipe_crc book-keeping, it will start/stop
- * the collection of the CRC.
- *
- * This function also calls the interactive debug with the "crc" domain, so you
- * can make use of this feature to actually see the screen that is being CRC'd.
- *
- * For continuous CRC collection look at igt_pipe_crc_start(),
- * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
- */
-void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
-{
-	igt_debug_wait_for_keypress("crc");
-
-	igt_pipe_crc_start(pipe_crc);
-	igt_pipe_crc_get_single(pipe_crc, out_crc);
-	igt_pipe_crc_stop(pipe_crc);
-}
-
 /**
  * igt_reset_fifo_underrun_reporting:
  * @drm_fd: drm device file descriptor
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 05d29f171610..a883e2d4afdb 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -68,63 +68,6 @@ bool igt_debugfs_search(int fd, const char *filename, const char *substring);
 #define igt_debugfs_write(fd, filename, buf) \
 		__igt_debugfs_write(fd, (filename), (buf), sizeof(buf))
 
-/*
- * Pipe CRC
- */
-
-/**
- * igt_pipe_crc_t:
- *
- * Pipe CRC support structure. Needs to be allocated and set up with
- * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
- */
-typedef struct _igt_pipe_crc igt_pipe_crc_t;
-
-#define DRM_MAX_CRC_NR 10
-/**
- * igt_crc_t:
- * @frame: frame number of the capture CRC
- * @n_words: internal field, don't access
- * @crc: internal field, don't access
- *
- * Pipe CRC value. All other members than @frame are private and should not be
- * inspected by testcases.
- */
-typedef struct {
-	uint32_t frame;
-	bool has_valid_frame;
-	int n_words;
-	uint32_t crc[DRM_MAX_CRC_NR];
-} igt_crc_t;
-
-#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
-#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
-
-bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
-void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
-bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
-char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
-char *igt_crc_to_string(igt_crc_t *crc);
-
-void igt_require_pipe_crc(int fd);
-igt_pipe_crc_t *
-igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
-igt_pipe_crc_t *
-igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
-void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
-void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
-void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
-__attribute__((warn_unused_result))
-int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
-			  igt_crc_t **out_crcs);
-void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
-void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
-void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
-void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
-				unsigned int vblank, igt_crc_t *crc);
-
-void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
-
 void igt_hpd_storm_set_threshold(int fd, unsigned int threshold);
 void igt_hpd_storm_reset(int fd);
 bool igt_hpd_storm_detected(int fd);
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index b3f096fe3837..6995b14b2828 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -41,6 +41,7 @@
 #include "igt_debugfs.h"
 
 struct buf_ops;
+typedef struct _igt_crc igt_crc_t;
 
 /*
  * Internal format to denote a buffer compatible with pixman's
diff --git a/lib/igt_pipe_crc.c b/lib/igt_pipe_crc.c
new file mode 100644
index 000000000000..14fe7331f0b0
--- /dev/null
+++ b/lib/igt_pipe_crc.c
@@ -0,0 +1,610 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/mount.h>
+#ifdef __linux__
+#include <sys/sysmacros.h>
+#endif
+#include <dirent.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <poll.h>
+
+#include "drmtest.h"
+#include "igt_aux.h"
+#include "igt_kms.h"
+#include "igt_debugfs.h"
+#include "igt_pipe_crc.h"
+
+/**
+ * SECTION:igt_pipe_crc
+ * @short_description: Pipe CRC support
+ * @title: pipe_crc
+ * @include: igt_pipe_crc.h
+ *
+ * This library wraps up the kernel's support for capturing pipe CRCs into a
+ * neat and tidy package. For the detailed usage see all the functions which
+ * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
+ *
+ * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
+ * there is no way to directly check a CRC: Both the details of the plane
+ * blending, color correction and other hardware and how exactly the CRC is
+ * computed at each tap point vary by hardware generation and are not disclosed.
+ *
+ * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
+ * another either for equality or difference. Otherwise CRCs must be treated as
+ * completely opaque values. Note that not even CRCs from different pipes or tap
+ * points on the same platform can be compared. Hence only use
+ * igt_assert_crc_equal() to inspect CRC values captured by the same
+ * #igt_pipe_crc_t object.
+ */
+
+/**
+ * igt_find_crc_mismatch:
+ * @a: first pipe CRC value
+ * @b: second pipe CRC value
+ * @index: index of the first value that mismatched
+ *
+ * Check if CRC a and CRC b mismatch.
+ *
+ * Returns true if CRC values mismatch, false otherwise;
+ */
+bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
+{
+	int nwords = min(a->n_words, b->n_words);
+	int i;
+
+	for (i = 0; i < nwords; i++) {
+		if (a->crc[i] != b->crc[i]) {
+			if (index)
+				*index = i;
+
+			return true;
+		}
+	}
+
+	if (a->n_words != b->n_words) {
+		if (index)
+			*index = i;
+		return true;
+	}
+
+	return false;
+}
+
+/**
+ * igt_assert_crc_equal:
+ * @a: first pipe CRC value
+ * @b: second pipe CRC value
+ *
+ * Compares two CRC values and fails the testcase if they don't match with
+ * igt_fail(). Note that due to CRC collisions CRC based testcase can only
+ * assert that CRCs match, never that they are different. Otherwise there might
+ * be random testcase failures when different screen contents end up with the
+ * same CRC by chance.
+ *
+ * Passing --skip-crc-compare on the command line will force this function
+ * to always pass, which can be useful in interactive debugging where you
+ * might know the test will fail, but still want the test to keep going as if
+ * it had succeeded so that you can see the on-screen behavior.
+ *
+ */
+void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
+{
+	int index;
+	bool mismatch;
+
+	mismatch = igt_find_crc_mismatch(a, b, &index);
+	if (mismatch)
+		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
+			  igt_skip_crc_compare ? " (ignored)" : "",
+			  index, a->crc[index], b->crc[index]);
+
+	igt_assert(!mismatch || igt_skip_crc_compare);
+}
+
+/**
+ * igt_check_crc_equal:
+ * @a: first pipe CRC value
+ * @b: second pipe CRC value
+ *
+ * Compares two CRC values and return whether they match.
+ *
+ * Returns: A boolean indicating whether the CRC values match
+ */
+bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
+{
+	int index;
+	bool mismatch;
+
+	mismatch = igt_find_crc_mismatch(a, b, &index);
+	if (mismatch)
+		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
+			  a->crc[index], b->crc[index]);
+
+	return !mismatch;
+}
+
+/**
+ * igt_crc_to_string_extended:
+ * @crc: pipe CRC value to print
+ * @delimiter: The delimiter to use between crc words
+ * @crc_size: the number of bytes to print per crc word (between 1 and 4)
+ *
+ * This function allocates a string and formats @crc into it, depending on
+ * @delimiter and @crc_size.
+ * The caller is responsible for freeing the string.
+ *
+ * This should only ever be used for diagnostic debug output.
+ */
+char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
+{
+	int i;
+	int len = 0;
+	int field_width = 2 * crc_size; /* Two chars per byte. */
+	char *buf = malloc((field_width+1) * crc->n_words);
+
+	if (!buf)
+		return NULL;
+
+	for (i = 0; i < crc->n_words - 1; i++)
+		len += sprintf(buf + len, "%0*x%c", field_width,
+			       crc->crc[i], delimiter);
+
+	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
+
+	return buf;
+}
+
+/**
+ * igt_crc_to_string:
+ * @crc: pipe CRC value to print
+ *
+ * This function allocates a string and formats @crc into it.
+ * The caller is responsible for freeing the string.
+ *
+ * This should only ever be used for diagnostic debug output.
+ */
+char *igt_crc_to_string(igt_crc_t *crc)
+{
+	return igt_crc_to_string_extended(crc, ' ', 4);
+}
+
+#define MAX_CRC_ENTRIES 10
+#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
+
+struct _igt_pipe_crc {
+	int fd;
+	int dir;
+	int ctl_fd;
+	int crc_fd;
+	int flags;
+
+	enum pipe pipe;
+	char *source;
+};
+
+/**
+ * igt_require_pipe_crc:
+ *
+ * Convenience helper to check whether pipe CRC capturing is supported by the
+ * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
+ * the case.
+ */
+void igt_require_pipe_crc(int fd)
+{
+	int dir;
+	struct stat stat;
+
+	dir = igt_debugfs_dir(fd);
+	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
+	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
+		      "CRCs not supported on this platform\n");
+
+	close(dir);
+}
+
+static igt_pipe_crc_t *
+pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
+{
+	igt_pipe_crc_t *pipe_crc;
+	char buf[128];
+	int debugfs;
+	const char *env_source;
+
+	igt_assert(source);
+
+	env_source = getenv("IGT_CRC_SOURCE");
+
+	if (!env_source)
+		env_source = source;
+
+	debugfs = igt_debugfs_dir(fd);
+	igt_assert(debugfs != -1);
+
+	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
+	igt_assert(pipe_crc);
+
+	sprintf(buf, "crtc-%d/crc/control", pipe);
+	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
+	igt_assert(pipe_crc->ctl_fd != -1);
+
+	pipe_crc->crc_fd = -1;
+	pipe_crc->fd = fd;
+	pipe_crc->dir = debugfs;
+	pipe_crc->pipe = pipe;
+	pipe_crc->source = strdup(env_source);
+	igt_assert(pipe_crc->source);
+	pipe_crc->flags = flags;
+
+	return pipe_crc;
+}
+
+/**
+ * igt_pipe_crc_new:
+ * @pipe: display pipe to use as source
+ * @source: CRC tap point to use as source
+ *
+ * This sets up a new pipe CRC capture object for the given @pipe and @source
+ * in blocking mode.
+ *
+ * Returns: A pipe CRC object for the given @pipe and @source. The library
+ * assumes that the source is always available since recent kernels support at
+ * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
+ */
+igt_pipe_crc_t *
+igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
+{
+	return pipe_crc_new(fd, pipe, source, O_RDONLY);
+}
+
+/**
+ * igt_pipe_crc_new_nonblock:
+ * @pipe: display pipe to use as source
+ * @source: CRC tap point to use as source
+ *
+ * This sets up a new pipe CRC capture object for the given @pipe and @source
+ * in nonblocking mode.
+ *
+ * Returns: A pipe CRC object for the given @pipe and @source. The library
+ * assumes that the source is always available since recent kernels support at
+ * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
+ */
+igt_pipe_crc_t *
+igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
+{
+	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
+}
+
+/**
+ * igt_pipe_crc_free:
+ * @pipe_crc: pipe CRC object
+ *
+ * Frees all resources associated with @pipe_crc.
+ */
+void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
+{
+	if (!pipe_crc)
+		return;
+
+	close(pipe_crc->ctl_fd);
+	close(pipe_crc->crc_fd);
+	close(pipe_crc->dir);
+	free(pipe_crc->source);
+	free(pipe_crc);
+}
+
+static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
+				      const char *line)
+{
+	int i;
+	const char *buf;
+
+	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
+		crc->has_valid_frame = false;
+	else {
+		crc->has_valid_frame = true;
+		crc->frame = strtoul(line, NULL, 16);
+	}
+
+	buf = line + 10;
+	for (i = 0; *buf != '\n'; i++, buf += 11)
+		crc->crc[i] = strtoul(buf, NULL, 16);
+
+	crc->n_words = i;
+
+	return true;
+}
+
+static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
+{
+	ssize_t bytes_read;
+	char buf[MAX_LINE_LEN + 1];
+
+	igt_set_timeout(5, "CRC reading");
+	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
+	igt_reset_timeout();
+
+	if (bytes_read < 0)
+		bytes_read = -errno;
+	else
+		buf[bytes_read] = '\0';
+
+	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
+		return -EINVAL;
+
+	return bytes_read;
+}
+
+static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
+{
+	int ret;
+
+	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
+
+	do {
+		ret = read_crc(pipe_crc, out);
+	} while (ret == -EINTR);
+
+	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
+}
+
+/**
+ * igt_pipe_crc_start:
+ * @pipe_crc: pipe CRC object
+ *
+ * Starts the CRC capture process on @pipe_crc.
+ */
+void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
+{
+	const char *src = pipe_crc->source;
+	struct pollfd pfd;
+	char buf[32];
+
+	/* Stop first just to make sure we don't have lingering state left. */
+	igt_pipe_crc_stop(pipe_crc);
+
+	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
+
+	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
+
+	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
+
+	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
+	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
+	igt_assert(pipe_crc->crc_fd != -1);
+
+	pfd.fd = pipe_crc->crc_fd;
+	pfd.events = POLLIN;
+	poll(&pfd, 1, -1);
+
+	igt_reset_timeout();
+
+	errno = 0;
+}
+
+/**
+ * igt_pipe_crc_stop:
+ * @pipe_crc: pipe CRC object
+ *
+ * Stops the CRC capture process on @pipe_crc.
+ */
+void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
+{
+	close(pipe_crc->crc_fd);
+	pipe_crc->crc_fd = -1;
+}
+
+/**
+ * igt_pipe_crc_get_crcs:
+ * @pipe_crc: pipe CRC object
+ * @n_crcs: number of CRCs to capture
+ * @out_crcs: buffer pointer for the captured CRC values
+ *
+ * Read up to @n_crcs from @pipe_crc. This function does not block, and will
+ * return early if not enough CRCs can be captured, if @pipe_crc has been
+ * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
+ * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
+ * alloced by this function and must be released with free() by the caller.
+ *
+ * Callers must start and stop the capturing themselves by calling
+ * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
+ * look at igt_pipe_crc_collect_crc().
+ *
+ * Returns:
+ * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
+ * can be less (even zero) in non-blocking mode.
+ */
+int
+igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
+		      igt_crc_t **out_crcs)
+{
+	igt_crc_t *crcs;
+	int n = 0;
+
+	crcs = calloc(n_crcs, sizeof(igt_crc_t));
+
+	do {
+		igt_crc_t *crc = &crcs[n];
+		int ret;
+
+		ret = read_crc(pipe_crc, crc);
+		if (ret == -EAGAIN)
+			break;
+
+		if (ret < 0)
+			continue;
+
+		n++;
+	} while (n < n_crcs);
+
+	*out_crcs = crcs;
+	return n;
+}
+
+static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
+{
+	int i;
+	bool all_zero = true;
+
+	/* Any CRC value can be considered valid on amdgpu hardware. */
+	if (is_amdgpu_device(pipe_crc->fd))
+		return;
+
+	for (i = 0; i < crc->n_words; i++) {
+		igt_warn_on_f(crc->crc[i] == 0xffffffff,
+			      "Suspicious CRC: it looks like the CRC "
+			      "read back was from a register in a powered "
+			      "down well\n");
+		if (crc->crc[i])
+			all_zero = false;
+	}
+
+	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
+}
+
+/**
+ * igt_pipe_crc_drain:
+ * @pipe_crc: pipe CRC object
+ *
+ * Discards all currently queued CRC values from @pipe_crc. This function does
+ * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
+ * CRC with igt_pipe_crc_get_single().
+ */
+void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
+{
+	int ret;
+	igt_crc_t crc;
+
+	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
+
+	do {
+		ret = read_crc(pipe_crc, &crc);
+	} while (ret > 0 || ret == -EINVAL);
+
+	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
+}
+
+/**
+ * igt_pipe_crc_get_single:
+ * @pipe_crc: pipe CRC object
+ * @crc: buffer pointer for the captured CRC value
+ *
+ * Read a single @crc from @pipe_crc. This function blocks even
+ * when nonblocking CRC is requested.
+ *
+ * Callers must start and stop the capturing themselves by calling
+ * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
+ * look at igt_pipe_crc_collect_crc().
+ *
+ * If capturing has been going on for a while and a fresh crc is required,
+ * you should use igt_pipe_crc_get_current() instead.
+ */
+void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
+{
+	read_one_crc(pipe_crc, crc);
+
+	crc_sanity_checks(pipe_crc, crc);
+}
+
+/**
+ * igt_pipe_crc_get_current:
+ * @drm_fd: Pointer to drm fd for vblank counter
+ * @pipe_crc: pipe CRC object
+ * @vblank: frame counter value we're looking for
+ * @crc: buffer pointer for the captured CRC value
+ *
+ * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
+ * for frame @vblank.
+ */
+void
+igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
+			   unsigned int vblank, igt_crc_t *crc)
+{
+	do {
+		read_one_crc(pipe_crc, crc);
+
+		/* Only works with valid frame counter */
+		if (!crc->has_valid_frame) {
+			igt_pipe_crc_drain(pipe_crc);
+			igt_pipe_crc_get_single(pipe_crc, crc);
+			return;
+		}
+	} while (igt_vblank_before(crc->frame, vblank));
+
+	crc_sanity_checks(pipe_crc, crc);
+}
+
+/**
+ * igt_pipe_crc_get_current:
+ * @drm_fd: Pointer to drm fd for vblank counter
+ * @pipe_crc: pipe CRC object
+ * @crc: buffer pointer for the captured CRC value
+ *
+ * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
+ * This is useful for retrieving the current CRC in a more race free way than
+ * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
+ */
+void
+igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
+{
+	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
+
+	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
+}
+
+/**
+ * igt_pipe_crc_collect_crc:
+ * @pipe_crc: pipe CRC object
+ * @out_crc: buffer for the captured CRC values
+ *
+ * Read a single CRC from @pipe_crc. This function blocks until the CRC is
+ * retrieved, irrespective of whether @pipe_crc has been opened with
+ * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
+ * allocated by the caller.
+ *
+ * This function takes care of the pipe_crc book-keeping, it will start/stop
+ * the collection of the CRC.
+ *
+ * This function also calls the interactive debug with the "crc" domain, so you
+ * can make use of this feature to actually see the screen that is being CRC'd.
+ *
+ * For continuous CRC collection look at igt_pipe_crc_start(),
+ * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
+ */
+void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
+{
+	igt_debug_wait_for_keypress("crc");
+
+	igt_pipe_crc_start(pipe_crc);
+	igt_pipe_crc_get_single(pipe_crc, out_crc);
+	igt_pipe_crc_stop(pipe_crc);
+}
diff --git a/lib/igt_pipe_crc.h b/lib/igt_pipe_crc.h
new file mode 100644
index 000000000000..2e1d3f918bf2
--- /dev/null
+++ b/lib/igt_pipe_crc.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef __IGT_PIPE_CRC_H__
+#define __IGT_PIPE_CRC_H__
+
+#include <stdbool.h>
+#include <stdint.h>
+
+enum pipe;
+
+/**
+ * igt_pipe_crc_t:
+ *
+ * Pipe CRC support structure. Needs to be allocated and set up with
+ * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
+ */
+typedef struct _igt_pipe_crc igt_pipe_crc_t;
+
+#define DRM_MAX_CRC_NR 10
+/**
+ * igt_crc_t:
+ * @frame: frame number of the capture CRC
+ * @n_words: internal field, don't access
+ * @crc: internal field, don't access
+ *
+ * Pipe CRC value. All other members than @frame are private and should not be
+ * inspected by testcases.
+ */
+struct _igt_crc {
+	uint32_t frame;
+	bool has_valid_frame;
+	int n_words;
+	uint32_t crc[DRM_MAX_CRC_NR];
+};
+typedef struct _igt_crc igt_crc_t;
+
+#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
+#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
+
+bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
+void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
+bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
+char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
+char *igt_crc_to_string(igt_crc_t *crc);
+
+void igt_require_pipe_crc(int fd);
+igt_pipe_crc_t *
+igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
+igt_pipe_crc_t *
+igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
+void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
+void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
+void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
+__attribute__((warn_unused_result))
+int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
+			  igt_crc_t **out_crcs);
+void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
+void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
+void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
+void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
+				unsigned int vblank, igt_crc_t *crc);
+
+void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
+
+#endif /* __IGT_PIPE_CRC_H__ */
diff --git a/lib/meson.build b/lib/meson.build
index 8d6c8a244afe..56d6a41fa612 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -30,6 +30,7 @@ lib_sources = [
 	'igt_os.c',
 	'igt_params.c',
 	'igt_perf.c',
+	'igt_pipe_crc.c',
 	'igt_power.c',
 	'igt_primes.c',
 	'igt_rand.c',
diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
index c36547fced9c..96ddac116378 100644
--- a/tests/i915/kms_mmap_write_crc.c
+++ b/tests/i915/kms_mmap_write_crc.c
@@ -33,6 +33,7 @@
 #include "drmtest.h"
 #include "igt_debugfs.h"
 #include "igt_kms.h"
+#include "igt_pipe_crc.h"
 #include "intel_chipset.h"
 #include "ioctl_wrappers.h"
 #include "igt_aux.h"
diff --git a/tools/intel_display_crc.c b/tools/intel_display_crc.c
index 61291fc2aa88..357ffb8229f6 100644
--- a/tools/intel_display_crc.c
+++ b/tools/intel_display_crc.c
@@ -32,6 +32,7 @@
 #include "igt_core.h"
 #include "igt_debugfs.h"
 #include "igt_kms.h"
+#include "igt_pipe_crc.h"
 
 typedef struct {
 	int fd;
-- 
2.35.1

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

* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 2/3] tests/crc: s/"auto"/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs Ville Syrjala
@ 2022-10-19 17:32 ` Patchwork
  2022-10-20 10:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2) Patchwork
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-19 17:32 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 7436 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/
URL   : https://patchwork.freedesktop.org/series/109900/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7020 -> IGTPW_7985
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_7985 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_7985, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/index.html

Participating hosts (45 -> 40)
------------------------------

  Missing    (5): fi-cml-u2 fi-tgl-dsi fi-icl-u2 fi-hsw-4770 fi-bdw-samus 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_7985:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live@migrate:
    - bat-adlp-4:         [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-adlp-4/igt@i915_selftest@live@migrate.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-adlp-4/igt@i915_selftest@live@migrate.html

  
Known issues
------------

  Here are the changes found in IGTPW_7985 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@hangcheck:
    - fi-ivb-3770:        [PASS][3] -> [INCOMPLETE][4] ([i915#7122])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/fi-ivb-3770/igt@i915_selftest@live@hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/fi-ivb-3770/igt@i915_selftest@live@hangcheck.html

  * igt@runner@aborted:
    - bat-adlp-4:         NOTRUN -> [FAIL][5] ([i915#4312])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-adlp-4/igt@runner@aborted.html
    - fi-ivb-3770:        NOTRUN -> [FAIL][6] ([fdo#109271] / [i915#4312])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/fi-ivb-3770/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_exec_gttfill@basic:
    - fi-pnv-d510:        [FAIL][7] ([i915#7229]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/fi-pnv-d510/igt@gem_exec_gttfill@basic.html

  * igt@gem_exec_suspend@basic-s3@smem:
    - {bat-rpls-1}:       [DMESG-WARN][9] ([i915#6687]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@gem_huc_copy@huc-copy:
    - {bat-dg2-8}:        [FAIL][11] ([i915#7029]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-dg2-8/igt@gem_huc_copy@huc-copy.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-dg2-8/igt@gem_huc_copy@huc-copy.html

  * igt@i915_selftest@live@gem_contexts:
    - {fi-ehl-2}:         [DMESG-FAIL][13] -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/fi-ehl-2/igt@i915_selftest@live@gem_contexts.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/fi-ehl-2/igt@i915_selftest@live@gem_contexts.html
    - {bat-jsl-3}:        [DMESG-FAIL][15] ([i915#7270]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-jsl-3/igt@i915_selftest@live@gem_contexts.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-jsl-3/igt@i915_selftest@live@gem_contexts.html
    - {bat-dg2-11}:       [DMESG-FAIL][17] ([i915#7270]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-dg2-11/igt@i915_selftest@live@gem_contexts.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-dg2-11/igt@i915_selftest@live@gem_contexts.html
    - {bat-dg2-8}:        [DMESG-FAIL][19] ([i915#7270]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-dg2-8/igt@i915_selftest@live@gem_contexts.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-dg2-8/igt@i915_selftest@live@gem_contexts.html

  * igt@i915_selftest@live@hugepages:
    - {bat-rpls-2}:       [DMESG-WARN][21] ([i915#5278]) -> [PASS][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-rpls-2/igt@i915_selftest@live@hugepages.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-rpls-2/igt@i915_selftest@live@hugepages.html

  * igt@i915_selftest@live@requests:
    - {bat-adlp-6}:       [DMESG-FAIL][23] ([i915#7269]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-adlp-6/igt@i915_selftest@live@requests.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-adlp-6/igt@i915_selftest@live@requests.html

  * igt@i915_selftest@live@reset:
    - {bat-rpls-2}:       [DMESG-FAIL][25] ([i915#4983]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-rpls-2/igt@i915_selftest@live@reset.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-rpls-2/igt@i915_selftest@live@reset.html

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3:
    - {bat-dg2-11}:       [FAIL][27] ([i915#6818]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7020/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5278]: https://gitlab.freedesktop.org/drm/intel/issues/5278
  [i915#6559]: https://gitlab.freedesktop.org/drm/intel/issues/6559
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7029]: https://gitlab.freedesktop.org/drm/intel/issues/7029
  [i915#7122]: https://gitlab.freedesktop.org/drm/intel/issues/7122
  [i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
  [i915#7269]: https://gitlab.freedesktop.org/drm/intel/issues/7269
  [i915#7270]: https://gitlab.freedesktop.org/drm/intel/issues/7270


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7020 -> IGTPW_7985

  CI-20190529: 20190529
  CI_DRM_12261: 41447224fdfbfbfd1e9ffa5fabc9d277f9c02f8a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7985: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/index.html
  IGT_7020: 05b7eaf9ade2216d17c069c89439015757ee25f7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7985/index.html

[-- Attachment #2: Type: text/html, Size: 8246 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs Ville Syrjala
@ 2022-10-20  8:18   ` Petri Latvala
  2022-10-20  9:45   ` Kamil Konieczny
  1 sibling, 0 replies; 12+ messages in thread
From: Petri Latvala @ 2022-10-20  8:18 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

On Wed, Oct 19, 2022 at 07:30:29PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> No reason to hide the pipe CRC code inside the debugfs stuff.
> The fact that pipe CRCs are operated through debugfs is just
> an irrelevant implementation detail.
> 
> Fixed up the few cases that don't include igt.h with this cocci:
> @find@
> identifier ID;
> @@
> igt_crc_t ID;
> 
> @has_include@
> @@
> (
>  #include "igt_pipe_crc.h"
> |
>  #include "igt.h"
> )
> 
> @depends on find && !has_include@
> @@
>   #include "igt_kms.h"
> + #include "igt_pipe_crc.h"
> 
> v2: better cocci to catch lib/igt_chamelium.c
> v3: Rebase and roll on doc fix from Petri
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

For the series:

Reviewed-by: Petri Latvala <petri.latvala@intel.com>



> ---
>  .../igt-gpu-tools/igt-gpu-tools-docs.xml      |   1 +
>  lib/igt.h                                     |   1 +
>  lib/igt_chamelium.c                           |   1 +
>  lib/igt_chamelium.h                           |   1 +
>  lib/igt_debugfs.c                             | 564 ----------------
>  lib/igt_debugfs.h                             |  57 --
>  lib/igt_fb.h                                  |   1 +
>  lib/igt_pipe_crc.c                            | 610 ++++++++++++++++++
>  lib/igt_pipe_crc.h                            |  87 +++
>  lib/meson.build                               |   1 +
>  tests/i915/kms_mmap_write_crc.c               |   1 +
>  tools/intel_display_crc.c                     |   1 +
>  12 files changed, 705 insertions(+), 621 deletions(-)
>  create mode 100644 lib/igt_pipe_crc.c
>  create mode 100644 lib/igt_pipe_crc.h
> 
> diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> index a19f786e841b..1ce842f45321 100644
> --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> @@ -37,6 +37,7 @@
>      <xi:include href="xml/igt_list.xml"/>
>      <xi:include href="xml/igt_map.xml"/>
>      <xi:include href="xml/igt_msm.xml"/>
> +    <xi:include href="xml/igt_pipe_crc.xml"/>
>      <xi:include href="xml/igt_pm.xml"/>
>      <xi:include href="xml/igt_primes.xml"/>
>      <xi:include href="xml/igt_rand.xml"/>
> diff --git a/lib/igt.h b/lib/igt.h
> index 96a368e11bbf..88938109e003 100644
> --- a/lib/igt.h
> +++ b/lib/igt.h
> @@ -37,6 +37,7 @@
>  #include "igt_gt.h"
>  #include "igt_kms.h"
>  #include "igt_params.h"
> +#include "igt_pipe_crc.h"
>  #include "igt_pm.h"
>  #include "igt_stats.h"
>  #ifdef HAVE_CHAMELIUM
> diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
> index 26244bd5fc97..ea296e027e16 100644
> --- a/lib/igt_chamelium.c
> +++ b/lib/igt_chamelium.c
> @@ -44,6 +44,7 @@
>  #include "igt_frame.h"
>  #include "igt_list.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  #include "igt_rc.h"
>  
>  /**
> diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
> index f40e848e4f67..af88fec914bd 100644
> --- a/lib/igt_chamelium.h
> +++ b/lib/igt_chamelium.h
> @@ -36,6 +36,7 @@
>  
>  struct igt_fb;
>  struct edid;
> +typedef struct _igt_crc igt_crc_t;
>  
>  struct chamelium;
>  struct chamelium_port;
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index fc4697b0af4a..85d350d359bd 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -55,24 +55,6 @@
>   * basic functions to access debugfs files with e.g. igt_debugfs_open() it also
>   * provides higher-level wrappers for some debugfs features.
>   *
> - * # Pipe CRC Support
> - *
> - * This library wraps up the kernel's support for capturing pipe CRCs into a
> - * neat and tidy package. For the detailed usage see all the functions which
> - * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
> - *
> - * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
> - * there is no way to directly check a CRC: Both the details of the plane
> - * blending, color correction and other hardware and how exactly the CRC is
> - * computed at each tap point vary by hardware generation and are not disclosed.
> - *
> - * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
> - * another either for equality or difference. Otherwise CRCs must be treated as
> - * completely opaque values. Note that not even CRCs from different pipes or tap
> - * points on the same platform can be compared. Hence only use
> - * igt_assert_crc_equal() to inspect CRC values captured by the same
> - * #igt_pipe_crc_t object.
> - *
>   * # Other debugfs interface wrappers
>   *
>   * This covers the miscellaneous debugfs interface wrappers:
> @@ -425,175 +407,6 @@ bool igt_debugfs_search(int device, const char *filename, const char *substring)
>  	return matched;
>  }
>  
> -/*
> - * Pipe CRC
> - */
> -
> -/**
> - * igt_find_crc_mismatch:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - * @index: index of the first value that mismatched
> - *
> - * Check if CRC a and CRC b mismatch.
> - *
> - * Returns true if CRC values mismatch, false otherwise;
> - */
> -bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
> -{
> -	int nwords = min(a->n_words, b->n_words);
> -	int i;
> -
> -	for (i = 0; i < nwords; i++) {
> -		if (a->crc[i] != b->crc[i]) {
> -			if (index)
> -				*index = i;
> -
> -			return true;
> -		}
> -	}
> -
> -	if (a->n_words != b->n_words) {
> -		if (index)
> -			*index = i;
> -		return true;
> -	}
> -
> -	return false;
> -}
> -
> -/**
> - * igt_assert_crc_equal:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - *
> - * Compares two CRC values and fails the testcase if they don't match with
> - * igt_fail(). Note that due to CRC collisions CRC based testcase can only
> - * assert that CRCs match, never that they are different. Otherwise there might
> - * be random testcase failures when different screen contents end up with the
> - * same CRC by chance.
> - *
> - * Passing --skip-crc-compare on the command line will force this function
> - * to always pass, which can be useful in interactive debugging where you
> - * might know the test will fail, but still want the test to keep going as if
> - * it had succeeded so that you can see the on-screen behavior.
> - *
> - */
> -void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> -{
> -	int index;
> -	bool mismatch;
> -
> -	mismatch = igt_find_crc_mismatch(a, b, &index);
> -	if (mismatch)
> -		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
> -			  igt_skip_crc_compare ? " (ignored)" : "",
> -			  index, a->crc[index], b->crc[index]);
> -
> -	igt_assert(!mismatch || igt_skip_crc_compare);
> -}
> -
> -/**
> - * igt_check_crc_equal:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - *
> - * Compares two CRC values and return whether they match.
> - *
> - * Returns: A boolean indicating whether the CRC values match
> - */
> -bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> -{
> -	int index;
> -	bool mismatch;
> -
> -	mismatch = igt_find_crc_mismatch(a, b, &index);
> -	if (mismatch)
> -		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
> -			  a->crc[index], b->crc[index]);
> -
> -	return !mismatch;
> -}
> -
> -/**
> - * igt_crc_to_string_extended:
> - * @crc: pipe CRC value to print
> - * @delimiter: The delimiter to use between crc words
> - * @crc_size: the number of bytes to print per crc word (between 1 and 4)
> - *
> - * This function allocates a string and formats @crc into it, depending on
> - * @delimiter and @crc_size.
> - * The caller is responsible for freeing the string.
> - *
> - * This should only ever be used for diagnostic debug output.
> - */
> -char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
> -{
> -	int i;
> -	int len = 0;
> -	int field_width = 2 * crc_size; /* Two chars per byte. */
> -	char *buf = malloc((field_width+1) * crc->n_words);
> -
> -	if (!buf)
> -		return NULL;
> -
> -	for (i = 0; i < crc->n_words - 1; i++)
> -		len += sprintf(buf + len, "%0*x%c", field_width,
> -			       crc->crc[i], delimiter);
> -
> -	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
> -
> -	return buf;
> -}
> -
> -/**
> - * igt_crc_to_string:
> - * @crc: pipe CRC value to print
> - *
> - * This function allocates a string and formats @crc into it.
> - * The caller is responsible for freeing the string.
> - *
> - * This should only ever be used for diagnostic debug output.
> - */
> -char *igt_crc_to_string(igt_crc_t *crc)
> -{
> -	return igt_crc_to_string_extended(crc, ' ', 4);
> -}
> -
> -#define MAX_CRC_ENTRIES 10
> -#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
> -
> -struct _igt_pipe_crc {
> -	int fd;
> -	int dir;
> -	int ctl_fd;
> -	int crc_fd;
> -	int flags;
> -
> -	enum pipe pipe;
> -	char *source;
> -};
> -
> -/**
> - * igt_require_pipe_crc:
> - *
> - * Convenience helper to check whether pipe CRC capturing is supported by the
> - * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
> - * the case.
> - */
> -void igt_require_pipe_crc(int fd)
> -{
> -	int dir;
> -	struct stat stat;
> -
> -	dir = igt_debugfs_dir(fd);
> -	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
> -	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
> -		      "CRCs not supported on this platform\n");
> -
> -	close(dir);
> -}
> -
>  static void igt_hpd_storm_exit_handler(int sig)
>  {
>  	int fd = drm_open_driver(DRIVER_INTEL);
> @@ -715,383 +528,6 @@ void igt_require_hpd_storm_ctl(int drm_fd)
>  	close(fd);
>  }
>  
> -static igt_pipe_crc_t *
> -pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
> -{
> -	igt_pipe_crc_t *pipe_crc;
> -	char buf[128];
> -	int debugfs;
> -	const char *env_source;
> -
> -	igt_assert(source);
> -
> -	env_source = getenv("IGT_CRC_SOURCE");
> -
> -	if (!env_source)
> -		env_source = source;
> -
> -	debugfs = igt_debugfs_dir(fd);
> -	igt_assert(debugfs != -1);
> -
> -	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
> -	igt_assert(pipe_crc);
> -
> -	sprintf(buf, "crtc-%d/crc/control", pipe);
> -	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
> -	igt_assert(pipe_crc->ctl_fd != -1);
> -
> -	pipe_crc->crc_fd = -1;
> -	pipe_crc->fd = fd;
> -	pipe_crc->dir = debugfs;
> -	pipe_crc->pipe = pipe;
> -	pipe_crc->source = strdup(env_source);
> -	igt_assert(pipe_crc->source);
> -	pipe_crc->flags = flags;
> -
> -	return pipe_crc;
> -}
> -
> -/**
> - * igt_pipe_crc_new:
> - * @pipe: display pipe to use as source
> - * @source: CRC tap point to use as source
> - *
> - * This sets up a new pipe CRC capture object for the given @pipe and @source
> - * in blocking mode.
> - *
> - * Returns: A pipe CRC object for the given @pipe and @source. The library
> - * assumes that the source is always available since recent kernels support at
> - * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> - */
> -igt_pipe_crc_t *
> -igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
> -{
> -	return pipe_crc_new(fd, pipe, source, O_RDONLY);
> -}
> -
> -/**
> - * igt_pipe_crc_new_nonblock:
> - * @pipe: display pipe to use as source
> - * @source: CRC tap point to use as source
> - *
> - * This sets up a new pipe CRC capture object for the given @pipe and @source
> - * in nonblocking mode.
> - *
> - * Returns: A pipe CRC object for the given @pipe and @source. The library
> - * assumes that the source is always available since recent kernels support at
> - * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> - */
> -igt_pipe_crc_t *
> -igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
> -{
> -	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
> -}
> -
> -/**
> - * igt_pipe_crc_free:
> - * @pipe_crc: pipe CRC object
> - *
> - * Frees all resources associated with @pipe_crc.
> - */
> -void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
> -{
> -	if (!pipe_crc)
> -		return;
> -
> -	close(pipe_crc->ctl_fd);
> -	close(pipe_crc->crc_fd);
> -	close(pipe_crc->dir);
> -	free(pipe_crc->source);
> -	free(pipe_crc);
> -}
> -
> -static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
> -				      const char *line)
> -{
> -	int i;
> -	const char *buf;
> -
> -	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
> -		crc->has_valid_frame = false;
> -	else {
> -		crc->has_valid_frame = true;
> -		crc->frame = strtoul(line, NULL, 16);
> -	}
> -
> -	buf = line + 10;
> -	for (i = 0; *buf != '\n'; i++, buf += 11)
> -		crc->crc[i] = strtoul(buf, NULL, 16);
> -
> -	crc->n_words = i;
> -
> -	return true;
> -}
> -
> -static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> -{
> -	ssize_t bytes_read;
> -	char buf[MAX_LINE_LEN + 1];
> -
> -	igt_set_timeout(5, "CRC reading");
> -	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
> -	igt_reset_timeout();
> -
> -	if (bytes_read < 0)
> -		bytes_read = -errno;
> -	else
> -		buf[bytes_read] = '\0';
> -
> -	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
> -		return -EINVAL;
> -
> -	return bytes_read;
> -}
> -
> -static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> -{
> -	int ret;
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
> -
> -	do {
> -		ret = read_crc(pipe_crc, out);
> -	} while (ret == -EINTR);
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> -}
> -
> -/**
> - * igt_pipe_crc_start:
> - * @pipe_crc: pipe CRC object
> - *
> - * Starts the CRC capture process on @pipe_crc.
> - */
> -void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
> -{
> -	const char *src = pipe_crc->source;
> -	struct pollfd pfd;
> -	char buf[32];
> -
> -	/* Stop first just to make sure we don't have lingering state left. */
> -	igt_pipe_crc_stop(pipe_crc);
> -
> -	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
> -
> -	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
> -
> -	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> -
> -	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
> -	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
> -	igt_assert(pipe_crc->crc_fd != -1);
> -
> -	pfd.fd = pipe_crc->crc_fd;
> -	pfd.events = POLLIN;
> -	poll(&pfd, 1, -1);
> -
> -	igt_reset_timeout();
> -
> -	errno = 0;
> -}
> -
> -/**
> - * igt_pipe_crc_stop:
> - * @pipe_crc: pipe CRC object
> - *
> - * Stops the CRC capture process on @pipe_crc.
> - */
> -void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
> -{
> -	close(pipe_crc->crc_fd);
> -	pipe_crc->crc_fd = -1;
> -}
> -
> -/**
> - * igt_pipe_crc_get_crcs:
> - * @pipe_crc: pipe CRC object
> - * @n_crcs: number of CRCs to capture
> - * @out_crcs: buffer pointer for the captured CRC values
> - *
> - * Read up to @n_crcs from @pipe_crc. This function does not block, and will
> - * return early if not enough CRCs can be captured, if @pipe_crc has been
> - * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
> - * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
> - * alloced by this function and must be released with free() by the caller.
> - *
> - * Callers must start and stop the capturing themselves by calling
> - * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> - * look at igt_pipe_crc_collect_crc().
> - *
> - * Returns:
> - * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
> - * can be less (even zero) in non-blocking mode.
> - */
> -int
> -igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> -		      igt_crc_t **out_crcs)
> -{
> -	igt_crc_t *crcs;
> -	int n = 0;
> -
> -	crcs = calloc(n_crcs, sizeof(igt_crc_t));
> -
> -	do {
> -		igt_crc_t *crc = &crcs[n];
> -		int ret;
> -
> -		ret = read_crc(pipe_crc, crc);
> -		if (ret == -EAGAIN)
> -			break;
> -
> -		if (ret < 0)
> -			continue;
> -
> -		n++;
> -	} while (n < n_crcs);
> -
> -	*out_crcs = crcs;
> -	return n;
> -}
> -
> -static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	int i;
> -	bool all_zero = true;
> -
> -	/* Any CRC value can be considered valid on amdgpu hardware. */
> -	if (is_amdgpu_device(pipe_crc->fd))
> -		return;
> -
> -	for (i = 0; i < crc->n_words; i++) {
> -		igt_warn_on_f(crc->crc[i] == 0xffffffff,
> -			      "Suspicious CRC: it looks like the CRC "
> -			      "read back was from a register in a powered "
> -			      "down well\n");
> -		if (crc->crc[i])
> -			all_zero = false;
> -	}
> -
> -	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> -}
> -
> -/**
> - * igt_pipe_crc_drain:
> - * @pipe_crc: pipe CRC object
> - *
> - * Discards all currently queued CRC values from @pipe_crc. This function does
> - * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
> - * CRC with igt_pipe_crc_get_single().
> - */
> -void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
> -{
> -	int ret;
> -	igt_crc_t crc;
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
> -
> -	do {
> -		ret = read_crc(pipe_crc, &crc);
> -	} while (ret > 0 || ret == -EINVAL);
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> -}
> -
> -/**
> - * igt_pipe_crc_get_single:
> - * @pipe_crc: pipe CRC object
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Read a single @crc from @pipe_crc. This function blocks even
> - * when nonblocking CRC is requested.
> - *
> - * Callers must start and stop the capturing themselves by calling
> - * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> - * look at igt_pipe_crc_collect_crc().
> - *
> - * If capturing has been going on for a while and a fresh crc is required,
> - * you should use igt_pipe_crc_get_current() instead.
> - */
> -void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	read_one_crc(pipe_crc, crc);
> -
> -	crc_sanity_checks(pipe_crc, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_get_current:
> - * @drm_fd: Pointer to drm fd for vblank counter
> - * @pipe_crc: pipe CRC object
> - * @vblank: frame counter value we're looking for
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
> - * for frame @vblank.
> - */
> -void
> -igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> -			   unsigned int vblank, igt_crc_t *crc)
> -{
> -	do {
> -		read_one_crc(pipe_crc, crc);
> -
> -		/* Only works with valid frame counter */
> -		if (!crc->has_valid_frame) {
> -			igt_pipe_crc_drain(pipe_crc);
> -			igt_pipe_crc_get_single(pipe_crc, crc);
> -			return;
> -		}
> -	} while (igt_vblank_before(crc->frame, vblank));
> -
> -	crc_sanity_checks(pipe_crc, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_get_current:
> - * @drm_fd: Pointer to drm fd for vblank counter
> - * @pipe_crc: pipe CRC object
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
> - * This is useful for retrieving the current CRC in a more race free way than
> - * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
> - */
> -void
> -igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
> -
> -	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_collect_crc:
> - * @pipe_crc: pipe CRC object
> - * @out_crc: buffer for the captured CRC values
> - *
> - * Read a single CRC from @pipe_crc. This function blocks until the CRC is
> - * retrieved, irrespective of whether @pipe_crc has been opened with
> - * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
> - * allocated by the caller.
> - *
> - * This function takes care of the pipe_crc book-keeping, it will start/stop
> - * the collection of the CRC.
> - *
> - * This function also calls the interactive debug with the "crc" domain, so you
> - * can make use of this feature to actually see the screen that is being CRC'd.
> - *
> - * For continuous CRC collection look at igt_pipe_crc_start(),
> - * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
> - */
> -void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
> -{
> -	igt_debug_wait_for_keypress("crc");
> -
> -	igt_pipe_crc_start(pipe_crc);
> -	igt_pipe_crc_get_single(pipe_crc, out_crc);
> -	igt_pipe_crc_stop(pipe_crc);
> -}
> -
>  /**
>   * igt_reset_fifo_underrun_reporting:
>   * @drm_fd: drm device file descriptor
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index 05d29f171610..a883e2d4afdb 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -68,63 +68,6 @@ bool igt_debugfs_search(int fd, const char *filename, const char *substring);
>  #define igt_debugfs_write(fd, filename, buf) \
>  		__igt_debugfs_write(fd, (filename), (buf), sizeof(buf))
>  
> -/*
> - * Pipe CRC
> - */
> -
> -/**
> - * igt_pipe_crc_t:
> - *
> - * Pipe CRC support structure. Needs to be allocated and set up with
> - * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
> - */
> -typedef struct _igt_pipe_crc igt_pipe_crc_t;
> -
> -#define DRM_MAX_CRC_NR 10
> -/**
> - * igt_crc_t:
> - * @frame: frame number of the capture CRC
> - * @n_words: internal field, don't access
> - * @crc: internal field, don't access
> - *
> - * Pipe CRC value. All other members than @frame are private and should not be
> - * inspected by testcases.
> - */
> -typedef struct {
> -	uint32_t frame;
> -	bool has_valid_frame;
> -	int n_words;
> -	uint32_t crc[DRM_MAX_CRC_NR];
> -} igt_crc_t;
> -
> -#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
> -#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
> -
> -bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
> -void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> -bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> -char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
> -char *igt_crc_to_string(igt_crc_t *crc);
> -
> -void igt_require_pipe_crc(int fd);
> -igt_pipe_crc_t *
> -igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
> -igt_pipe_crc_t *
> -igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
> -void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
> -__attribute__((warn_unused_result))
> -int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> -			  igt_crc_t **out_crcs);
> -void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> -void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
> -void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> -				unsigned int vblank, igt_crc_t *crc);
> -
> -void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> -
>  void igt_hpd_storm_set_threshold(int fd, unsigned int threshold);
>  void igt_hpd_storm_reset(int fd);
>  bool igt_hpd_storm_detected(int fd);
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index b3f096fe3837..6995b14b2828 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -41,6 +41,7 @@
>  #include "igt_debugfs.h"
>  
>  struct buf_ops;
> +typedef struct _igt_crc igt_crc_t;
>  
>  /*
>   * Internal format to denote a buffer compatible with pixman's
> diff --git a/lib/igt_pipe_crc.c b/lib/igt_pipe_crc.c
> new file mode 100644
> index 000000000000..14fe7331f0b0
> --- /dev/null
> +++ b/lib/igt_pipe_crc.c
> @@ -0,0 +1,610 @@
> +/*
> + * Copyright © 2013 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#include <inttypes.h>
> +#include <sys/stat.h>
> +#include <sys/mount.h>
> +#ifdef __linux__
> +#include <sys/sysmacros.h>
> +#endif
> +#include <dirent.h>
> +#include <errno.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <limits.h>
> +#include <string.h>
> +#include <fcntl.h>
> +#include <unistd.h>
> +#include <poll.h>
> +
> +#include "drmtest.h"
> +#include "igt_aux.h"
> +#include "igt_kms.h"
> +#include "igt_debugfs.h"
> +#include "igt_pipe_crc.h"
> +
> +/**
> + * SECTION:igt_pipe_crc
> + * @short_description: Pipe CRC support
> + * @title: pipe_crc
> + * @include: igt_pipe_crc.h
> + *
> + * This library wraps up the kernel's support for capturing pipe CRCs into a
> + * neat and tidy package. For the detailed usage see all the functions which
> + * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
> + *
> + * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
> + * there is no way to directly check a CRC: Both the details of the plane
> + * blending, color correction and other hardware and how exactly the CRC is
> + * computed at each tap point vary by hardware generation and are not disclosed.
> + *
> + * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
> + * another either for equality or difference. Otherwise CRCs must be treated as
> + * completely opaque values. Note that not even CRCs from different pipes or tap
> + * points on the same platform can be compared. Hence only use
> + * igt_assert_crc_equal() to inspect CRC values captured by the same
> + * #igt_pipe_crc_t object.
> + */
> +
> +/**
> + * igt_find_crc_mismatch:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + * @index: index of the first value that mismatched
> + *
> + * Check if CRC a and CRC b mismatch.
> + *
> + * Returns true if CRC values mismatch, false otherwise;
> + */
> +bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
> +{
> +	int nwords = min(a->n_words, b->n_words);
> +	int i;
> +
> +	for (i = 0; i < nwords; i++) {
> +		if (a->crc[i] != b->crc[i]) {
> +			if (index)
> +				*index = i;
> +
> +			return true;
> +		}
> +	}
> +
> +	if (a->n_words != b->n_words) {
> +		if (index)
> +			*index = i;
> +		return true;
> +	}
> +
> +	return false;
> +}
> +
> +/**
> + * igt_assert_crc_equal:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + *
> + * Compares two CRC values and fails the testcase if they don't match with
> + * igt_fail(). Note that due to CRC collisions CRC based testcase can only
> + * assert that CRCs match, never that they are different. Otherwise there might
> + * be random testcase failures when different screen contents end up with the
> + * same CRC by chance.
> + *
> + * Passing --skip-crc-compare on the command line will force this function
> + * to always pass, which can be useful in interactive debugging where you
> + * might know the test will fail, but still want the test to keep going as if
> + * it had succeeded so that you can see the on-screen behavior.
> + *
> + */
> +void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> +{
> +	int index;
> +	bool mismatch;
> +
> +	mismatch = igt_find_crc_mismatch(a, b, &index);
> +	if (mismatch)
> +		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
> +			  igt_skip_crc_compare ? " (ignored)" : "",
> +			  index, a->crc[index], b->crc[index]);
> +
> +	igt_assert(!mismatch || igt_skip_crc_compare);
> +}
> +
> +/**
> + * igt_check_crc_equal:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + *
> + * Compares two CRC values and return whether they match.
> + *
> + * Returns: A boolean indicating whether the CRC values match
> + */
> +bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> +{
> +	int index;
> +	bool mismatch;
> +
> +	mismatch = igt_find_crc_mismatch(a, b, &index);
> +	if (mismatch)
> +		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
> +			  a->crc[index], b->crc[index]);
> +
> +	return !mismatch;
> +}
> +
> +/**
> + * igt_crc_to_string_extended:
> + * @crc: pipe CRC value to print
> + * @delimiter: The delimiter to use between crc words
> + * @crc_size: the number of bytes to print per crc word (between 1 and 4)
> + *
> + * This function allocates a string and formats @crc into it, depending on
> + * @delimiter and @crc_size.
> + * The caller is responsible for freeing the string.
> + *
> + * This should only ever be used for diagnostic debug output.
> + */
> +char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
> +{
> +	int i;
> +	int len = 0;
> +	int field_width = 2 * crc_size; /* Two chars per byte. */
> +	char *buf = malloc((field_width+1) * crc->n_words);
> +
> +	if (!buf)
> +		return NULL;
> +
> +	for (i = 0; i < crc->n_words - 1; i++)
> +		len += sprintf(buf + len, "%0*x%c", field_width,
> +			       crc->crc[i], delimiter);
> +
> +	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
> +
> +	return buf;
> +}
> +
> +/**
> + * igt_crc_to_string:
> + * @crc: pipe CRC value to print
> + *
> + * This function allocates a string and formats @crc into it.
> + * The caller is responsible for freeing the string.
> + *
> + * This should only ever be used for diagnostic debug output.
> + */
> +char *igt_crc_to_string(igt_crc_t *crc)
> +{
> +	return igt_crc_to_string_extended(crc, ' ', 4);
> +}
> +
> +#define MAX_CRC_ENTRIES 10
> +#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
> +
> +struct _igt_pipe_crc {
> +	int fd;
> +	int dir;
> +	int ctl_fd;
> +	int crc_fd;
> +	int flags;
> +
> +	enum pipe pipe;
> +	char *source;
> +};
> +
> +/**
> + * igt_require_pipe_crc:
> + *
> + * Convenience helper to check whether pipe CRC capturing is supported by the
> + * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
> + * the case.
> + */
> +void igt_require_pipe_crc(int fd)
> +{
> +	int dir;
> +	struct stat stat;
> +
> +	dir = igt_debugfs_dir(fd);
> +	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
> +	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
> +		      "CRCs not supported on this platform\n");
> +
> +	close(dir);
> +}
> +
> +static igt_pipe_crc_t *
> +pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
> +{
> +	igt_pipe_crc_t *pipe_crc;
> +	char buf[128];
> +	int debugfs;
> +	const char *env_source;
> +
> +	igt_assert(source);
> +
> +	env_source = getenv("IGT_CRC_SOURCE");
> +
> +	if (!env_source)
> +		env_source = source;
> +
> +	debugfs = igt_debugfs_dir(fd);
> +	igt_assert(debugfs != -1);
> +
> +	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
> +	igt_assert(pipe_crc);
> +
> +	sprintf(buf, "crtc-%d/crc/control", pipe);
> +	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
> +	igt_assert(pipe_crc->ctl_fd != -1);
> +
> +	pipe_crc->crc_fd = -1;
> +	pipe_crc->fd = fd;
> +	pipe_crc->dir = debugfs;
> +	pipe_crc->pipe = pipe;
> +	pipe_crc->source = strdup(env_source);
> +	igt_assert(pipe_crc->source);
> +	pipe_crc->flags = flags;
> +
> +	return pipe_crc;
> +}
> +
> +/**
> + * igt_pipe_crc_new:
> + * @pipe: display pipe to use as source
> + * @source: CRC tap point to use as source
> + *
> + * This sets up a new pipe CRC capture object for the given @pipe and @source
> + * in blocking mode.
> + *
> + * Returns: A pipe CRC object for the given @pipe and @source. The library
> + * assumes that the source is always available since recent kernels support at
> + * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> + */
> +igt_pipe_crc_t *
> +igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
> +{
> +	return pipe_crc_new(fd, pipe, source, O_RDONLY);
> +}
> +
> +/**
> + * igt_pipe_crc_new_nonblock:
> + * @pipe: display pipe to use as source
> + * @source: CRC tap point to use as source
> + *
> + * This sets up a new pipe CRC capture object for the given @pipe and @source
> + * in nonblocking mode.
> + *
> + * Returns: A pipe CRC object for the given @pipe and @source. The library
> + * assumes that the source is always available since recent kernels support at
> + * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> + */
> +igt_pipe_crc_t *
> +igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
> +{
> +	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
> +}
> +
> +/**
> + * igt_pipe_crc_free:
> + * @pipe_crc: pipe CRC object
> + *
> + * Frees all resources associated with @pipe_crc.
> + */
> +void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
> +{
> +	if (!pipe_crc)
> +		return;
> +
> +	close(pipe_crc->ctl_fd);
> +	close(pipe_crc->crc_fd);
> +	close(pipe_crc->dir);
> +	free(pipe_crc->source);
> +	free(pipe_crc);
> +}
> +
> +static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
> +				      const char *line)
> +{
> +	int i;
> +	const char *buf;
> +
> +	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
> +		crc->has_valid_frame = false;
> +	else {
> +		crc->has_valid_frame = true;
> +		crc->frame = strtoul(line, NULL, 16);
> +	}
> +
> +	buf = line + 10;
> +	for (i = 0; *buf != '\n'; i++, buf += 11)
> +		crc->crc[i] = strtoul(buf, NULL, 16);
> +
> +	crc->n_words = i;
> +
> +	return true;
> +}
> +
> +static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> +{
> +	ssize_t bytes_read;
> +	char buf[MAX_LINE_LEN + 1];
> +
> +	igt_set_timeout(5, "CRC reading");
> +	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
> +	igt_reset_timeout();
> +
> +	if (bytes_read < 0)
> +		bytes_read = -errno;
> +	else
> +		buf[bytes_read] = '\0';
> +
> +	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
> +		return -EINVAL;
> +
> +	return bytes_read;
> +}
> +
> +static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> +{
> +	int ret;
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
> +
> +	do {
> +		ret = read_crc(pipe_crc, out);
> +	} while (ret == -EINTR);
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> +}
> +
> +/**
> + * igt_pipe_crc_start:
> + * @pipe_crc: pipe CRC object
> + *
> + * Starts the CRC capture process on @pipe_crc.
> + */
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
> +{
> +	const char *src = pipe_crc->source;
> +	struct pollfd pfd;
> +	char buf[32];
> +
> +	/* Stop first just to make sure we don't have lingering state left. */
> +	igt_pipe_crc_stop(pipe_crc);
> +
> +	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
> +
> +	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
> +
> +	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> +
> +	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
> +	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
> +	igt_assert(pipe_crc->crc_fd != -1);
> +
> +	pfd.fd = pipe_crc->crc_fd;
> +	pfd.events = POLLIN;
> +	poll(&pfd, 1, -1);
> +
> +	igt_reset_timeout();
> +
> +	errno = 0;
> +}
> +
> +/**
> + * igt_pipe_crc_stop:
> + * @pipe_crc: pipe CRC object
> + *
> + * Stops the CRC capture process on @pipe_crc.
> + */
> +void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
> +{
> +	close(pipe_crc->crc_fd);
> +	pipe_crc->crc_fd = -1;
> +}
> +
> +/**
> + * igt_pipe_crc_get_crcs:
> + * @pipe_crc: pipe CRC object
> + * @n_crcs: number of CRCs to capture
> + * @out_crcs: buffer pointer for the captured CRC values
> + *
> + * Read up to @n_crcs from @pipe_crc. This function does not block, and will
> + * return early if not enough CRCs can be captured, if @pipe_crc has been
> + * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
> + * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
> + * alloced by this function and must be released with free() by the caller.
> + *
> + * Callers must start and stop the capturing themselves by calling
> + * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> + * look at igt_pipe_crc_collect_crc().
> + *
> + * Returns:
> + * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
> + * can be less (even zero) in non-blocking mode.
> + */
> +int
> +igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> +		      igt_crc_t **out_crcs)
> +{
> +	igt_crc_t *crcs;
> +	int n = 0;
> +
> +	crcs = calloc(n_crcs, sizeof(igt_crc_t));
> +
> +	do {
> +		igt_crc_t *crc = &crcs[n];
> +		int ret;
> +
> +		ret = read_crc(pipe_crc, crc);
> +		if (ret == -EAGAIN)
> +			break;
> +
> +		if (ret < 0)
> +			continue;
> +
> +		n++;
> +	} while (n < n_crcs);
> +
> +	*out_crcs = crcs;
> +	return n;
> +}
> +
> +static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	int i;
> +	bool all_zero = true;
> +
> +	/* Any CRC value can be considered valid on amdgpu hardware. */
> +	if (is_amdgpu_device(pipe_crc->fd))
> +		return;
> +
> +	for (i = 0; i < crc->n_words; i++) {
> +		igt_warn_on_f(crc->crc[i] == 0xffffffff,
> +			      "Suspicious CRC: it looks like the CRC "
> +			      "read back was from a register in a powered "
> +			      "down well\n");
> +		if (crc->crc[i])
> +			all_zero = false;
> +	}
> +
> +	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> +}
> +
> +/**
> + * igt_pipe_crc_drain:
> + * @pipe_crc: pipe CRC object
> + *
> + * Discards all currently queued CRC values from @pipe_crc. This function does
> + * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
> + * CRC with igt_pipe_crc_get_single().
> + */
> +void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
> +{
> +	int ret;
> +	igt_crc_t crc;
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
> +
> +	do {
> +		ret = read_crc(pipe_crc, &crc);
> +	} while (ret > 0 || ret == -EINVAL);
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> +}
> +
> +/**
> + * igt_pipe_crc_get_single:
> + * @pipe_crc: pipe CRC object
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Read a single @crc from @pipe_crc. This function blocks even
> + * when nonblocking CRC is requested.
> + *
> + * Callers must start and stop the capturing themselves by calling
> + * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> + * look at igt_pipe_crc_collect_crc().
> + *
> + * If capturing has been going on for a while and a fresh crc is required,
> + * you should use igt_pipe_crc_get_current() instead.
> + */
> +void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	read_one_crc(pipe_crc, crc);
> +
> +	crc_sanity_checks(pipe_crc, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_get_current:
> + * @drm_fd: Pointer to drm fd for vblank counter
> + * @pipe_crc: pipe CRC object
> + * @vblank: frame counter value we're looking for
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
> + * for frame @vblank.
> + */
> +void
> +igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> +			   unsigned int vblank, igt_crc_t *crc)
> +{
> +	do {
> +		read_one_crc(pipe_crc, crc);
> +
> +		/* Only works with valid frame counter */
> +		if (!crc->has_valid_frame) {
> +			igt_pipe_crc_drain(pipe_crc);
> +			igt_pipe_crc_get_single(pipe_crc, crc);
> +			return;
> +		}
> +	} while (igt_vblank_before(crc->frame, vblank));
> +
> +	crc_sanity_checks(pipe_crc, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_get_current:
> + * @drm_fd: Pointer to drm fd for vblank counter
> + * @pipe_crc: pipe CRC object
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
> + * This is useful for retrieving the current CRC in a more race free way than
> + * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
> + */
> +void
> +igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
> +
> +	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_collect_crc:
> + * @pipe_crc: pipe CRC object
> + * @out_crc: buffer for the captured CRC values
> + *
> + * Read a single CRC from @pipe_crc. This function blocks until the CRC is
> + * retrieved, irrespective of whether @pipe_crc has been opened with
> + * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
> + * allocated by the caller.
> + *
> + * This function takes care of the pipe_crc book-keeping, it will start/stop
> + * the collection of the CRC.
> + *
> + * This function also calls the interactive debug with the "crc" domain, so you
> + * can make use of this feature to actually see the screen that is being CRC'd.
> + *
> + * For continuous CRC collection look at igt_pipe_crc_start(),
> + * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
> + */
> +void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
> +{
> +	igt_debug_wait_for_keypress("crc");
> +
> +	igt_pipe_crc_start(pipe_crc);
> +	igt_pipe_crc_get_single(pipe_crc, out_crc);
> +	igt_pipe_crc_stop(pipe_crc);
> +}
> diff --git a/lib/igt_pipe_crc.h b/lib/igt_pipe_crc.h
> new file mode 100644
> index 000000000000..2e1d3f918bf2
> --- /dev/null
> +++ b/lib/igt_pipe_crc.h
> @@ -0,0 +1,87 @@
> +/*
> + * Copyright © 2013 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */
> +
> +#ifndef __IGT_PIPE_CRC_H__
> +#define __IGT_PIPE_CRC_H__
> +
> +#include <stdbool.h>
> +#include <stdint.h>
> +
> +enum pipe;
> +
> +/**
> + * igt_pipe_crc_t:
> + *
> + * Pipe CRC support structure. Needs to be allocated and set up with
> + * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
> + */
> +typedef struct _igt_pipe_crc igt_pipe_crc_t;
> +
> +#define DRM_MAX_CRC_NR 10
> +/**
> + * igt_crc_t:
> + * @frame: frame number of the capture CRC
> + * @n_words: internal field, don't access
> + * @crc: internal field, don't access
> + *
> + * Pipe CRC value. All other members than @frame are private and should not be
> + * inspected by testcases.
> + */
> +struct _igt_crc {
> +	uint32_t frame;
> +	bool has_valid_frame;
> +	int n_words;
> +	uint32_t crc[DRM_MAX_CRC_NR];
> +};
> +typedef struct _igt_crc igt_crc_t;
> +
> +#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
> +#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
> +
> +bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
> +void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> +bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> +char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
> +char *igt_crc_to_string(igt_crc_t *crc);
> +
> +void igt_require_pipe_crc(int fd);
> +igt_pipe_crc_t *
> +igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
> +igt_pipe_crc_t *
> +igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
> +void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
> +__attribute__((warn_unused_result))
> +int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> +			  igt_crc_t **out_crcs);
> +void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> +void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
> +void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> +				unsigned int vblank, igt_crc_t *crc);
> +
> +void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> +
> +#endif /* __IGT_PIPE_CRC_H__ */
> diff --git a/lib/meson.build b/lib/meson.build
> index 8d6c8a244afe..56d6a41fa612 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -30,6 +30,7 @@ lib_sources = [
>  	'igt_os.c',
>  	'igt_params.c',
>  	'igt_perf.c',
> +	'igt_pipe_crc.c',
>  	'igt_power.c',
>  	'igt_primes.c',
>  	'igt_rand.c',
> diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
> index c36547fced9c..96ddac116378 100644
> --- a/tests/i915/kms_mmap_write_crc.c
> +++ b/tests/i915/kms_mmap_write_crc.c
> @@ -33,6 +33,7 @@
>  #include "drmtest.h"
>  #include "igt_debugfs.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  #include "intel_chipset.h"
>  #include "ioctl_wrappers.h"
>  #include "igt_aux.h"
> diff --git a/tools/intel_display_crc.c b/tools/intel_display_crc.c
> index 61291fc2aa88..357ffb8229f6 100644
> --- a/tools/intel_display_crc.c
> +++ b/tools/intel_display_crc.c
> @@ -32,6 +32,7 @@
>  #include "igt_core.h"
>  #include "igt_debugfs.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  
>  typedef struct {
>  	int fd;
> -- 
> 2.35.1
> 

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs
  2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs Ville Syrjala
  2022-10-20  8:18   ` Petri Latvala
@ 2022-10-20  9:45   ` Kamil Konieczny
  2022-10-20  9:52     ` Ville Syrjälä
  1 sibling, 1 reply; 12+ messages in thread
From: Kamil Konieczny @ 2022-10-20  9:45 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

Hi Ville,

On 2022-10-19 at 19:30:29 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>

You are author and sender, no need for this "From:" line.
Few nits below.

> 
> No reason to hide the pipe CRC code inside the debugfs stuff.
> The fact that pipe CRCs are operated through debugfs is just
> an irrelevant implementation detail.
> 
> Fixed up the few cases that don't include igt.h with this cocci:
> @find@
> identifier ID;
> @@
> igt_crc_t ID;
> 
> @has_include@
> @@
> (
>  #include "igt_pipe_crc.h"
> |
>  #include "igt.h"
> )
> 
> @depends on find && !has_include@
> @@
>   #include "igt_kms.h"
> + #include "igt_pipe_crc.h"
> 
> v2: better cocci to catch lib/igt_chamelium.c
> v3: Rebase and roll on doc fix from Petri
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  .../igt-gpu-tools/igt-gpu-tools-docs.xml      |   1 +
>  lib/igt.h                                     |   1 +
>  lib/igt_chamelium.c                           |   1 +
>  lib/igt_chamelium.h                           |   1 +
>  lib/igt_debugfs.c                             | 564 ----------------
>  lib/igt_debugfs.h                             |  57 --
>  lib/igt_fb.h                                  |   1 +
>  lib/igt_pipe_crc.c                            | 610 ++++++++++++++++++
>  lib/igt_pipe_crc.h                            |  87 +++
>  lib/meson.build                               |   1 +
>  tests/i915/kms_mmap_write_crc.c               |   1 +
>  tools/intel_display_crc.c                     |   1 +
>  12 files changed, 705 insertions(+), 621 deletions(-)
>  create mode 100644 lib/igt_pipe_crc.c
>  create mode 100644 lib/igt_pipe_crc.h
> 
> diff --git a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> index a19f786e841b..1ce842f45321 100644
> --- a/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> +++ b/docs/reference/igt-gpu-tools/igt-gpu-tools-docs.xml
> @@ -37,6 +37,7 @@
>      <xi:include href="xml/igt_list.xml"/>
>      <xi:include href="xml/igt_map.xml"/>
>      <xi:include href="xml/igt_msm.xml"/>
> +    <xi:include href="xml/igt_pipe_crc.xml"/>
>      <xi:include href="xml/igt_pm.xml"/>
>      <xi:include href="xml/igt_primes.xml"/>
>      <xi:include href="xml/igt_rand.xml"/>
> diff --git a/lib/igt.h b/lib/igt.h
> index 96a368e11bbf..88938109e003 100644
> --- a/lib/igt.h
> +++ b/lib/igt.h
> @@ -37,6 +37,7 @@
>  #include "igt_gt.h"
>  #include "igt_kms.h"
>  #include "igt_params.h"
> +#include "igt_pipe_crc.h"
>  #include "igt_pm.h"
>  #include "igt_stats.h"
>  #ifdef HAVE_CHAMELIUM
> diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
> index 26244bd5fc97..ea296e027e16 100644
> --- a/lib/igt_chamelium.c
> +++ b/lib/igt_chamelium.c
> @@ -44,6 +44,7 @@
>  #include "igt_frame.h"
>  #include "igt_list.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  #include "igt_rc.h"
>  
>  /**
> diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
> index f40e848e4f67..af88fec914bd 100644
> --- a/lib/igt_chamelium.h
> +++ b/lib/igt_chamelium.h
> @@ -36,6 +36,7 @@
>  
>  struct igt_fb;
>  struct edid;
> +typedef struct _igt_crc igt_crc_t;
>  
>  struct chamelium;
>  struct chamelium_port;
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index fc4697b0af4a..85d350d359bd 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -55,24 +55,6 @@
>   * basic functions to access debugfs files with e.g. igt_debugfs_open() it also
>   * provides higher-level wrappers for some debugfs features.
>   *
> - * # Pipe CRC Support
> - *
> - * This library wraps up the kernel's support for capturing pipe CRCs into a
> - * neat and tidy package. For the detailed usage see all the functions which
> - * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
> - *
> - * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
> - * there is no way to directly check a CRC: Both the details of the plane
> - * blending, color correction and other hardware and how exactly the CRC is
> - * computed at each tap point vary by hardware generation and are not disclosed.
> - *
> - * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
> - * another either for equality or difference. Otherwise CRCs must be treated as
> - * completely opaque values. Note that not even CRCs from different pipes or tap
> - * points on the same platform can be compared. Hence only use
> - * igt_assert_crc_equal() to inspect CRC values captured by the same
> - * #igt_pipe_crc_t object.
> - *
>   * # Other debugfs interface wrappers
>   *
>   * This covers the miscellaneous debugfs interface wrappers:
> @@ -425,175 +407,6 @@ bool igt_debugfs_search(int device, const char *filename, const char *substring)
>  	return matched;
>  }
>  
> -/*
> - * Pipe CRC
> - */
> -
> -/**
> - * igt_find_crc_mismatch:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - * @index: index of the first value that mismatched
> - *
> - * Check if CRC a and CRC b mismatch.
> - *
> - * Returns true if CRC values mismatch, false otherwise;
> - */
> -bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
> -{
> -	int nwords = min(a->n_words, b->n_words);
> -	int i;
> -
> -	for (i = 0; i < nwords; i++) {
> -		if (a->crc[i] != b->crc[i]) {
> -			if (index)
> -				*index = i;
> -
> -			return true;
> -		}
> -	}
> -
> -	if (a->n_words != b->n_words) {
> -		if (index)
> -			*index = i;
> -		return true;
> -	}
> -
> -	return false;
> -}
> -
> -/**
> - * igt_assert_crc_equal:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - *
> - * Compares two CRC values and fails the testcase if they don't match with
> - * igt_fail(). Note that due to CRC collisions CRC based testcase can only
> - * assert that CRCs match, never that they are different. Otherwise there might
> - * be random testcase failures when different screen contents end up with the
> - * same CRC by chance.
> - *
> - * Passing --skip-crc-compare on the command line will force this function
> - * to always pass, which can be useful in interactive debugging where you
> - * might know the test will fail, but still want the test to keep going as if
> - * it had succeeded so that you can see the on-screen behavior.
> - *
> - */
> -void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> -{
> -	int index;
> -	bool mismatch;
> -
> -	mismatch = igt_find_crc_mismatch(a, b, &index);
> -	if (mismatch)
> -		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
> -			  igt_skip_crc_compare ? " (ignored)" : "",
> -			  index, a->crc[index], b->crc[index]);
> -
> -	igt_assert(!mismatch || igt_skip_crc_compare);
> -}
> -
> -/**
> - * igt_check_crc_equal:
> - * @a: first pipe CRC value
> - * @b: second pipe CRC value
> - *
> - * Compares two CRC values and return whether they match.
> - *
> - * Returns: A boolean indicating whether the CRC values match
> - */
> -bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> -{
> -	int index;
> -	bool mismatch;
> -
> -	mismatch = igt_find_crc_mismatch(a, b, &index);
> -	if (mismatch)
> -		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
> -			  a->crc[index], b->crc[index]);
> -
> -	return !mismatch;
> -}
> -
> -/**
> - * igt_crc_to_string_extended:
> - * @crc: pipe CRC value to print
> - * @delimiter: The delimiter to use between crc words
> - * @crc_size: the number of bytes to print per crc word (between 1 and 4)
> - *
> - * This function allocates a string and formats @crc into it, depending on
> - * @delimiter and @crc_size.
> - * The caller is responsible for freeing the string.
> - *
> - * This should only ever be used for diagnostic debug output.
> - */
> -char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
> -{
> -	int i;
> -	int len = 0;
> -	int field_width = 2 * crc_size; /* Two chars per byte. */
> -	char *buf = malloc((field_width+1) * crc->n_words);
> -
> -	if (!buf)
> -		return NULL;
> -
> -	for (i = 0; i < crc->n_words - 1; i++)
> -		len += sprintf(buf + len, "%0*x%c", field_width,
> -			       crc->crc[i], delimiter);
> -
> -	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
> -
> -	return buf;
> -}
> -
> -/**
> - * igt_crc_to_string:
> - * @crc: pipe CRC value to print
> - *
> - * This function allocates a string and formats @crc into it.
> - * The caller is responsible for freeing the string.
> - *
> - * This should only ever be used for diagnostic debug output.
> - */
> -char *igt_crc_to_string(igt_crc_t *crc)
> -{
> -	return igt_crc_to_string_extended(crc, ' ', 4);
> -}
> -
> -#define MAX_CRC_ENTRIES 10
> -#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
> -
> -struct _igt_pipe_crc {
> -	int fd;
> -	int dir;
> -	int ctl_fd;
> -	int crc_fd;
> -	int flags;
> -
> -	enum pipe pipe;
> -	char *source;
> -};
> -
> -/**
> - * igt_require_pipe_crc:
> - *
> - * Convenience helper to check whether pipe CRC capturing is supported by the
> - * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
> - * the case.
> - */
> -void igt_require_pipe_crc(int fd)
> -{
> -	int dir;
> -	struct stat stat;
> -
> -	dir = igt_debugfs_dir(fd);
> -	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
> -	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
> -		      "CRCs not supported on this platform\n");
> -
> -	close(dir);
> -}
> -
>  static void igt_hpd_storm_exit_handler(int sig)
>  {
>  	int fd = drm_open_driver(DRIVER_INTEL);
> @@ -715,383 +528,6 @@ void igt_require_hpd_storm_ctl(int drm_fd)
>  	close(fd);
>  }
>  
> -static igt_pipe_crc_t *
> -pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
> -{
> -	igt_pipe_crc_t *pipe_crc;
> -	char buf[128];
> -	int debugfs;
> -	const char *env_source;
> -
> -	igt_assert(source);
> -
> -	env_source = getenv("IGT_CRC_SOURCE");
> -
> -	if (!env_source)
> -		env_source = source;
> -
> -	debugfs = igt_debugfs_dir(fd);
> -	igt_assert(debugfs != -1);
> -
> -	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
> -	igt_assert(pipe_crc);
> -
> -	sprintf(buf, "crtc-%d/crc/control", pipe);
> -	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
> -	igt_assert(pipe_crc->ctl_fd != -1);
> -
> -	pipe_crc->crc_fd = -1;
> -	pipe_crc->fd = fd;
> -	pipe_crc->dir = debugfs;
> -	pipe_crc->pipe = pipe;
> -	pipe_crc->source = strdup(env_source);
> -	igt_assert(pipe_crc->source);
> -	pipe_crc->flags = flags;
> -
> -	return pipe_crc;
> -}
> -
> -/**
> - * igt_pipe_crc_new:
> - * @pipe: display pipe to use as source
> - * @source: CRC tap point to use as source
> - *
> - * This sets up a new pipe CRC capture object for the given @pipe and @source
> - * in blocking mode.
> - *
> - * Returns: A pipe CRC object for the given @pipe and @source. The library
> - * assumes that the source is always available since recent kernels support at
> - * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> - */
> -igt_pipe_crc_t *
> -igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
> -{
> -	return pipe_crc_new(fd, pipe, source, O_RDONLY);
> -}
> -
> -/**
> - * igt_pipe_crc_new_nonblock:
> - * @pipe: display pipe to use as source
> - * @source: CRC tap point to use as source
> - *
> - * This sets up a new pipe CRC capture object for the given @pipe and @source
> - * in nonblocking mode.
> - *
> - * Returns: A pipe CRC object for the given @pipe and @source. The library
> - * assumes that the source is always available since recent kernels support at
> - * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> - */
> -igt_pipe_crc_t *
> -igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
> -{
> -	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
> -}
> -
> -/**
> - * igt_pipe_crc_free:
> - * @pipe_crc: pipe CRC object
> - *
> - * Frees all resources associated with @pipe_crc.
> - */
> -void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
> -{
> -	if (!pipe_crc)
> -		return;
> -
> -	close(pipe_crc->ctl_fd);
> -	close(pipe_crc->crc_fd);
> -	close(pipe_crc->dir);
> -	free(pipe_crc->source);
> -	free(pipe_crc);
> -}
> -
> -static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
> -				      const char *line)
> -{
> -	int i;
> -	const char *buf;
> -
> -	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
> -		crc->has_valid_frame = false;
> -	else {
> -		crc->has_valid_frame = true;
> -		crc->frame = strtoul(line, NULL, 16);
> -	}
> -
> -	buf = line + 10;
> -	for (i = 0; *buf != '\n'; i++, buf += 11)
> -		crc->crc[i] = strtoul(buf, NULL, 16);
> -
> -	crc->n_words = i;
> -
> -	return true;
> -}
> -
> -static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> -{
> -	ssize_t bytes_read;
> -	char buf[MAX_LINE_LEN + 1];
> -
> -	igt_set_timeout(5, "CRC reading");
> -	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
> -	igt_reset_timeout();
> -
> -	if (bytes_read < 0)
> -		bytes_read = -errno;
> -	else
> -		buf[bytes_read] = '\0';
> -
> -	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
> -		return -EINVAL;
> -
> -	return bytes_read;
> -}
> -
> -static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> -{
> -	int ret;
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
> -
> -	do {
> -		ret = read_crc(pipe_crc, out);
> -	} while (ret == -EINTR);
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> -}
> -
> -/**
> - * igt_pipe_crc_start:
> - * @pipe_crc: pipe CRC object
> - *
> - * Starts the CRC capture process on @pipe_crc.
> - */
> -void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
> -{
> -	const char *src = pipe_crc->source;
> -	struct pollfd pfd;
> -	char buf[32];
> -
> -	/* Stop first just to make sure we don't have lingering state left. */
> -	igt_pipe_crc_stop(pipe_crc);
> -
> -	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
> -
> -	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
> -
> -	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> -
> -	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
> -	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
> -	igt_assert(pipe_crc->crc_fd != -1);
> -
> -	pfd.fd = pipe_crc->crc_fd;
> -	pfd.events = POLLIN;
> -	poll(&pfd, 1, -1);
> -
> -	igt_reset_timeout();
> -
> -	errno = 0;
> -}
> -
> -/**
> - * igt_pipe_crc_stop:
> - * @pipe_crc: pipe CRC object
> - *
> - * Stops the CRC capture process on @pipe_crc.
> - */
> -void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
> -{
> -	close(pipe_crc->crc_fd);
> -	pipe_crc->crc_fd = -1;
> -}
> -
> -/**
> - * igt_pipe_crc_get_crcs:
> - * @pipe_crc: pipe CRC object
> - * @n_crcs: number of CRCs to capture
> - * @out_crcs: buffer pointer for the captured CRC values
> - *
> - * Read up to @n_crcs from @pipe_crc. This function does not block, and will
> - * return early if not enough CRCs can be captured, if @pipe_crc has been
> - * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
> - * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
> - * alloced by this function and must be released with free() by the caller.
> - *
> - * Callers must start and stop the capturing themselves by calling
> - * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> - * look at igt_pipe_crc_collect_crc().
> - *
> - * Returns:
> - * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
> - * can be less (even zero) in non-blocking mode.
> - */
> -int
> -igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> -		      igt_crc_t **out_crcs)
> -{
> -	igt_crc_t *crcs;
> -	int n = 0;
> -
> -	crcs = calloc(n_crcs, sizeof(igt_crc_t));
> -
> -	do {
> -		igt_crc_t *crc = &crcs[n];
> -		int ret;
> -
> -		ret = read_crc(pipe_crc, crc);
> -		if (ret == -EAGAIN)
> -			break;
> -
> -		if (ret < 0)
> -			continue;
> -
> -		n++;
> -	} while (n < n_crcs);
> -
> -	*out_crcs = crcs;
> -	return n;
> -}
> -
> -static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	int i;
> -	bool all_zero = true;
> -
> -	/* Any CRC value can be considered valid on amdgpu hardware. */
> -	if (is_amdgpu_device(pipe_crc->fd))
> -		return;
> -
> -	for (i = 0; i < crc->n_words; i++) {
> -		igt_warn_on_f(crc->crc[i] == 0xffffffff,
> -			      "Suspicious CRC: it looks like the CRC "
> -			      "read back was from a register in a powered "
> -			      "down well\n");
> -		if (crc->crc[i])
> -			all_zero = false;
> -	}
> -
> -	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> -}
> -
> -/**
> - * igt_pipe_crc_drain:
> - * @pipe_crc: pipe CRC object
> - *
> - * Discards all currently queued CRC values from @pipe_crc. This function does
> - * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
> - * CRC with igt_pipe_crc_get_single().
> - */
> -void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
> -{
> -	int ret;
> -	igt_crc_t crc;
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
> -
> -	do {
> -		ret = read_crc(pipe_crc, &crc);
> -	} while (ret > 0 || ret == -EINVAL);
> -
> -	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> -}
> -
> -/**
> - * igt_pipe_crc_get_single:
> - * @pipe_crc: pipe CRC object
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Read a single @crc from @pipe_crc. This function blocks even
> - * when nonblocking CRC is requested.
> - *
> - * Callers must start and stop the capturing themselves by calling
> - * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> - * look at igt_pipe_crc_collect_crc().
> - *
> - * If capturing has been going on for a while and a fresh crc is required,
> - * you should use igt_pipe_crc_get_current() instead.
> - */
> -void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	read_one_crc(pipe_crc, crc);
> -
> -	crc_sanity_checks(pipe_crc, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_get_current:
> - * @drm_fd: Pointer to drm fd for vblank counter
> - * @pipe_crc: pipe CRC object
> - * @vblank: frame counter value we're looking for
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
> - * for frame @vblank.
> - */
> -void
> -igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> -			   unsigned int vblank, igt_crc_t *crc)
> -{
> -	do {
> -		read_one_crc(pipe_crc, crc);
> -
> -		/* Only works with valid frame counter */
> -		if (!crc->has_valid_frame) {
> -			igt_pipe_crc_drain(pipe_crc);
> -			igt_pipe_crc_get_single(pipe_crc, crc);
> -			return;
> -		}
> -	} while (igt_vblank_before(crc->frame, vblank));
> -
> -	crc_sanity_checks(pipe_crc, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_get_current:
> - * @drm_fd: Pointer to drm fd for vblank counter
> - * @pipe_crc: pipe CRC object
> - * @crc: buffer pointer for the captured CRC value
> - *
> - * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
> - * This is useful for retrieving the current CRC in a more race free way than
> - * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
> - */
> -void
> -igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> -{
> -	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
> -
> -	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
> -}
> -
> -/**
> - * igt_pipe_crc_collect_crc:
> - * @pipe_crc: pipe CRC object
> - * @out_crc: buffer for the captured CRC values
> - *
> - * Read a single CRC from @pipe_crc. This function blocks until the CRC is
> - * retrieved, irrespective of whether @pipe_crc has been opened with
> - * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
> - * allocated by the caller.
> - *
> - * This function takes care of the pipe_crc book-keeping, it will start/stop
> - * the collection of the CRC.
> - *
> - * This function also calls the interactive debug with the "crc" domain, so you
> - * can make use of this feature to actually see the screen that is being CRC'd.
> - *
> - * For continuous CRC collection look at igt_pipe_crc_start(),
> - * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
> - */
> -void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
> -{
> -	igt_debug_wait_for_keypress("crc");
> -
> -	igt_pipe_crc_start(pipe_crc);
> -	igt_pipe_crc_get_single(pipe_crc, out_crc);
> -	igt_pipe_crc_stop(pipe_crc);
> -}
> -
>  /**
>   * igt_reset_fifo_underrun_reporting:
>   * @drm_fd: drm device file descriptor
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index 05d29f171610..a883e2d4afdb 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -68,63 +68,6 @@ bool igt_debugfs_search(int fd, const char *filename, const char *substring);
>  #define igt_debugfs_write(fd, filename, buf) \
>  		__igt_debugfs_write(fd, (filename), (buf), sizeof(buf))
>  
> -/*
> - * Pipe CRC
> - */
> -
> -/**
> - * igt_pipe_crc_t:
> - *
> - * Pipe CRC support structure. Needs to be allocated and set up with
> - * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
> - */
> -typedef struct _igt_pipe_crc igt_pipe_crc_t;
> -
> -#define DRM_MAX_CRC_NR 10
> -/**
> - * igt_crc_t:
> - * @frame: frame number of the capture CRC
> - * @n_words: internal field, don't access
> - * @crc: internal field, don't access
> - *
> - * Pipe CRC value. All other members than @frame are private and should not be
> - * inspected by testcases.
> - */
> -typedef struct {
> -	uint32_t frame;
> -	bool has_valid_frame;
> -	int n_words;
> -	uint32_t crc[DRM_MAX_CRC_NR];
> -} igt_crc_t;
> -
> -#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
> -#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
> -
> -bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
> -void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> -bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> -char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
> -char *igt_crc_to_string(igt_crc_t *crc);
> -
> -void igt_require_pipe_crc(int fd);
> -igt_pipe_crc_t *
> -igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
> -igt_pipe_crc_t *
> -igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
> -void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
> -__attribute__((warn_unused_result))
> -int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> -			  igt_crc_t **out_crcs);
> -void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
> -void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> -void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
> -void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> -				unsigned int vblank, igt_crc_t *crc);
> -
> -void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> -
>  void igt_hpd_storm_set_threshold(int fd, unsigned int threshold);
>  void igt_hpd_storm_reset(int fd);
>  bool igt_hpd_storm_detected(int fd);
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index b3f096fe3837..6995b14b2828 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -41,6 +41,7 @@
>  #include "igt_debugfs.h"
>  
>  struct buf_ops;
> +typedef struct _igt_crc igt_crc_t;
>  
>  /*
>   * Internal format to denote a buffer compatible with pixman's
> diff --git a/lib/igt_pipe_crc.c b/lib/igt_pipe_crc.c
> new file mode 100644
> index 000000000000..14fe7331f0b0
> --- /dev/null
> +++ b/lib/igt_pipe_crc.c
> @@ -0,0 +1,610 @@
> +/*
> + * Copyright © 2013 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */

Please use SPDX licence here.

> +
> +#include <inttypes.h>
> +#include <sys/stat.h>
> +#include <sys/mount.h>
> +#ifdef __linux__
> +#include <sys/sysmacros.h>
> +#endif
> +#include <dirent.h>
> +#include <errno.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <limits.h>
> +#include <string.h>
> +#include <fcntl.h>
> +#include <unistd.h>
> +#include <poll.h>
> +
> +#include "drmtest.h"
> +#include "igt_aux.h"
> +#include "igt_kms.h"
> +#include "igt_debugfs.h"
> +#include "igt_pipe_crc.h"
> +
> +/**
> + * SECTION:igt_pipe_crc
> + * @short_description: Pipe CRC support
> + * @title: pipe_crc
> + * @include: igt_pipe_crc.h
> + *
> + * This library wraps up the kernel's support for capturing pipe CRCs into a
> + * neat and tidy package. For the detailed usage see all the functions which
> + * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
> + *
> + * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
> + * there is no way to directly check a CRC: Both the details of the plane
> + * blending, color correction and other hardware and how exactly the CRC is
> + * computed at each tap point vary by hardware generation and are not disclosed.
> + *
> + * The only way to use #igt_crc_t CRCs therefore is to compare CRCs among each
> + * another either for equality or difference. Otherwise CRCs must be treated as
> + * completely opaque values. Note that not even CRCs from different pipes or tap
> + * points on the same platform can be compared. Hence only use
> + * igt_assert_crc_equal() to inspect CRC values captured by the same
> + * #igt_pipe_crc_t object.
> + */
> +
> +/**
> + * igt_find_crc_mismatch:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + * @index: index of the first value that mismatched
> + *
> + * Check if CRC a and CRC b mismatch.
> + *
> + * Returns true if CRC values mismatch, false otherwise;
> + */
> +bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index)
> +{
> +	int nwords = min(a->n_words, b->n_words);
> +	int i;
> +
> +	for (i = 0; i < nwords; i++) {
> +		if (a->crc[i] != b->crc[i]) {
> +			if (index)
> +				*index = i;
> +
> +			return true;
> +		}
> +	}
> +
> +	if (a->n_words != b->n_words) {
> +		if (index)
> +			*index = i;
> +		return true;
> +	}
> +
> +	return false;
> +}
> +
> +/**
> + * igt_assert_crc_equal:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + *
> + * Compares two CRC values and fails the testcase if they don't match with
> + * igt_fail(). Note that due to CRC collisions CRC based testcase can only
> + * assert that CRCs match, never that they are different. Otherwise there might
> + * be random testcase failures when different screen contents end up with the
> + * same CRC by chance.
> + *
> + * Passing --skip-crc-compare on the command line will force this function
> + * to always pass, which can be useful in interactive debugging where you
> + * might know the test will fail, but still want the test to keep going as if
> + * it had succeeded so that you can see the on-screen behavior.
> + *
> + */
> +void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> +{
> +	int index;
> +	bool mismatch;
> +
> +	mismatch = igt_find_crc_mismatch(a, b, &index);
> +	if (mismatch)
> +		igt_debug("CRC mismatch%s at index %d: 0x%x != 0x%x\n",
> +			  igt_skip_crc_compare ? " (ignored)" : "",
> +			  index, a->crc[index], b->crc[index]);
> +
> +	igt_assert(!mismatch || igt_skip_crc_compare);
> +}
> +
> +/**
> + * igt_check_crc_equal:
> + * @a: first pipe CRC value
> + * @b: second pipe CRC value
> + *
> + * Compares two CRC values and return whether they match.
> + *
> + * Returns: A boolean indicating whether the CRC values match
> + */
> +bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b)
> +{
> +	int index;
> +	bool mismatch;
> +
> +	mismatch = igt_find_crc_mismatch(a, b, &index);
> +	if (mismatch)
> +		igt_debug("CRC mismatch at index %d: 0x%x != 0x%x\n", index,
> +			  a->crc[index], b->crc[index]);
> +
> +	return !mismatch;
> +}
> +
> +/**
> + * igt_crc_to_string_extended:
> + * @crc: pipe CRC value to print
> + * @delimiter: The delimiter to use between crc words
> + * @crc_size: the number of bytes to print per crc word (between 1 and 4)
> + *
> + * This function allocates a string and formats @crc into it, depending on
> + * @delimiter and @crc_size.
> + * The caller is responsible for freeing the string.
> + *
> + * This should only ever be used for diagnostic debug output.
> + */
> +char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size)
> +{
> +	int i;
> +	int len = 0;
> +	int field_width = 2 * crc_size; /* Two chars per byte. */
> +	char *buf = malloc((field_width+1) * crc->n_words);
> +
> +	if (!buf)
> +		return NULL;
> +
> +	for (i = 0; i < crc->n_words - 1; i++)
> +		len += sprintf(buf + len, "%0*x%c", field_width,
> +			       crc->crc[i], delimiter);
> +
> +	sprintf(buf + len, "%0*x", field_width, crc->crc[i]);
> +
> +	return buf;
> +}
> +
> +/**
> + * igt_crc_to_string:
> + * @crc: pipe CRC value to print
> + *
> + * This function allocates a string and formats @crc into it.
> + * The caller is responsible for freeing the string.
> + *
> + * This should only ever be used for diagnostic debug output.
> + */
> +char *igt_crc_to_string(igt_crc_t *crc)
> +{
> +	return igt_crc_to_string_extended(crc, ' ', 4);
> +}
> +
> +#define MAX_CRC_ENTRIES 10
> +#define MAX_LINE_LEN (10 + 11 * MAX_CRC_ENTRIES + 1)
> +
> +struct _igt_pipe_crc {
> +	int fd;
> +	int dir;
> +	int ctl_fd;
> +	int crc_fd;
> +	int flags;
> +
> +	enum pipe pipe;
> +	char *source;
> +};
> +
> +/**
> + * igt_require_pipe_crc:
> + *
> + * Convenience helper to check whether pipe CRC capturing is supported by the
> + * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
> + * the case.
> + */
> +void igt_require_pipe_crc(int fd)
> +{
> +	int dir;
> +	struct stat stat;
> +
> +	dir = igt_debugfs_dir(fd);
> +	igt_require_f(dir >= 0, "Could not open debugfs directory\n");
> +	igt_require_f(fstatat(dir, "crtc-0/crc/control", &stat, 0) == 0,
> +		      "CRCs not supported on this platform\n");
> +
> +	close(dir);
> +}
> +
> +static igt_pipe_crc_t *
> +pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
> +{
> +	igt_pipe_crc_t *pipe_crc;
> +	char buf[128];
> +	int debugfs;
> +	const char *env_source;
> +
> +	igt_assert(source);
> +
> +	env_source = getenv("IGT_CRC_SOURCE");
> +
> +	if (!env_source)
> +		env_source = source;
> +
> +	debugfs = igt_debugfs_dir(fd);
> +	igt_assert(debugfs != -1);
> +
> +	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
> +	igt_assert(pipe_crc);
> +
> +	sprintf(buf, "crtc-%d/crc/control", pipe);
> +	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
> +	igt_assert(pipe_crc->ctl_fd != -1);
> +
> +	pipe_crc->crc_fd = -1;
> +	pipe_crc->fd = fd;
> +	pipe_crc->dir = debugfs;
> +	pipe_crc->pipe = pipe;
> +	pipe_crc->source = strdup(env_source);
> +	igt_assert(pipe_crc->source);
> +	pipe_crc->flags = flags;
> +
> +	return pipe_crc;
> +}
> +
> +/**
> + * igt_pipe_crc_new:
> + * @pipe: display pipe to use as source
> + * @source: CRC tap point to use as source
> + *
> + * This sets up a new pipe CRC capture object for the given @pipe and @source
> + * in blocking mode.
> + *
> + * Returns: A pipe CRC object for the given @pipe and @source. The library
> + * assumes that the source is always available since recent kernels support at
> + * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> + */
> +igt_pipe_crc_t *
> +igt_pipe_crc_new(int fd, enum pipe pipe, const char *source)
> +{
> +	return pipe_crc_new(fd, pipe, source, O_RDONLY);
> +}
> +
> +/**
> + * igt_pipe_crc_new_nonblock:
> + * @pipe: display pipe to use as source
> + * @source: CRC tap point to use as source
> + *
> + * This sets up a new pipe CRC capture object for the given @pipe and @source
> + * in nonblocking mode.
> + *
> + * Returns: A pipe CRC object for the given @pipe and @source. The library
> + * assumes that the source is always available since recent kernels support at
> + * least IGT_PIPE_CRC_SOURCE_AUTO everywhere.
> + */
> +igt_pipe_crc_t *
> +igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source)
> +{
> +	return pipe_crc_new(fd, pipe, source, O_RDONLY | O_NONBLOCK);
> +}
> +
> +/**
> + * igt_pipe_crc_free:
> + * @pipe_crc: pipe CRC object
> + *
> + * Frees all resources associated with @pipe_crc.
> + */
> +void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
> +{
> +	if (!pipe_crc)
> +		return;
> +
> +	close(pipe_crc->ctl_fd);
> +	close(pipe_crc->crc_fd);
> +	close(pipe_crc->dir);
> +	free(pipe_crc->source);
> +	free(pipe_crc);
> +}
> +
> +static bool pipe_crc_init_from_string(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc,
> +				      const char *line)
> +{
> +	int i;
> +	const char *buf;
> +
> +	if (strncmp(line, "XXXXXXXXXX", 10) == 0)
> +		crc->has_valid_frame = false;
> +	else {
> +		crc->has_valid_frame = true;
> +		crc->frame = strtoul(line, NULL, 16);
> +	}
> +
> +	buf = line + 10;
> +	for (i = 0; *buf != '\n'; i++, buf += 11)
> +		crc->crc[i] = strtoul(buf, NULL, 16);
> +
> +	crc->n_words = i;
> +
> +	return true;
> +}
> +
> +static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> +{
> +	ssize_t bytes_read;
> +	char buf[MAX_LINE_LEN + 1];
> +
> +	igt_set_timeout(5, "CRC reading");
> +	bytes_read = read(pipe_crc->crc_fd, &buf, MAX_LINE_LEN);
> +	igt_reset_timeout();
> +
> +	if (bytes_read < 0)
> +		bytes_read = -errno;
> +	else
> +		buf[bytes_read] = '\0';
> +
> +	if (bytes_read > 0 && !pipe_crc_init_from_string(pipe_crc, out, buf))
> +		return -EINVAL;
> +
> +	return bytes_read;
> +}
> +
> +static void read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
> +{
> +	int ret;
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags & ~O_NONBLOCK);
> +
> +	do {
> +		ret = read_crc(pipe_crc, out);
> +	} while (ret == -EINTR);
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> +}
> +
> +/**
> + * igt_pipe_crc_start:
> + * @pipe_crc: pipe CRC object
> + *
> + * Starts the CRC capture process on @pipe_crc.
> + */
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
> +{
> +	const char *src = pipe_crc->source;
> +	struct pollfd pfd;
> +	char buf[32];
> +
> +	/* Stop first just to make sure we don't have lingering state left. */
> +	igt_pipe_crc_stop(pipe_crc);
> +
> +	igt_reset_fifo_underrun_reporting(pipe_crc->fd);
> +
> +	igt_assert_eq(write(pipe_crc->ctl_fd, src, strlen(src)), strlen(src));
> +
> +	sprintf(buf, "crtc-%d/crc/data", pipe_crc->pipe);
> +
> +	igt_set_timeout(10, "Opening crc fd, and poll for first CRC.");
> +	pipe_crc->crc_fd = openat(pipe_crc->dir, buf, pipe_crc->flags);
> +	igt_assert(pipe_crc->crc_fd != -1);
> +
> +	pfd.fd = pipe_crc->crc_fd;
> +	pfd.events = POLLIN;
> +	poll(&pfd, 1, -1);
> +
> +	igt_reset_timeout();
> +
> +	errno = 0;
> +}
> +
> +/**
> + * igt_pipe_crc_stop:
> + * @pipe_crc: pipe CRC object
> + *
> + * Stops the CRC capture process on @pipe_crc.
> + */
> +void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
> +{
> +	close(pipe_crc->crc_fd);
> +	pipe_crc->crc_fd = -1;
> +}
> +
> +/**
> + * igt_pipe_crc_get_crcs:
> + * @pipe_crc: pipe CRC object
> + * @n_crcs: number of CRCs to capture
> + * @out_crcs: buffer pointer for the captured CRC values
> + *
> + * Read up to @n_crcs from @pipe_crc. This function does not block, and will
> + * return early if not enough CRCs can be captured, if @pipe_crc has been
> + * opened using igt_pipe_crc_new_nonblock(). It will block until @n_crcs are
> + * retrieved if @pipe_crc has been opened using igt_pipe_crc_new(). @out_crcs is
> + * alloced by this function and must be released with free() by the caller.
> + *
> + * Callers must start and stop the capturing themselves by calling
> + * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> + * look at igt_pipe_crc_collect_crc().
> + *
> + * Returns:
> + * The number of CRCs captured. Should be equal to @n_crcs in blocking mode, but
> + * can be less (even zero) in non-blocking mode.
> + */
> +int
> +igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> +		      igt_crc_t **out_crcs)
> +{
> +	igt_crc_t *crcs;
> +	int n = 0;
> +
> +	crcs = calloc(n_crcs, sizeof(igt_crc_t));
> +
> +	do {
> +		igt_crc_t *crc = &crcs[n];
> +		int ret;
> +
> +		ret = read_crc(pipe_crc, crc);
> +		if (ret == -EAGAIN)
> +			break;
> +
> +		if (ret < 0)
> +			continue;
> +
> +		n++;
> +	} while (n < n_crcs);
> +
> +	*out_crcs = crcs;
> +	return n;
> +}
> +
> +static void crc_sanity_checks(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	int i;
> +	bool all_zero = true;
> +
> +	/* Any CRC value can be considered valid on amdgpu hardware. */
> +	if (is_amdgpu_device(pipe_crc->fd))
> +		return;
> +
> +	for (i = 0; i < crc->n_words; i++) {
> +		igt_warn_on_f(crc->crc[i] == 0xffffffff,
> +			      "Suspicious CRC: it looks like the CRC "
> +			      "read back was from a register in a powered "
> +			      "down well\n");
> +		if (crc->crc[i])
> +			all_zero = false;
> +	}
> +
> +	igt_warn_on_f(all_zero, "Suspicious CRC: All values are 0.\n");
> +}
> +
> +/**
> + * igt_pipe_crc_drain:
> + * @pipe_crc: pipe CRC object
> + *
> + * Discards all currently queued CRC values from @pipe_crc. This function does
> + * not block, and is useful to flush @pipe_crc. Afterwards you can get a fresh
> + * CRC with igt_pipe_crc_get_single().
> + */
> +void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc)
> +{
> +	int ret;
> +	igt_crc_t crc;
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags | O_NONBLOCK);
> +
> +	do {
> +		ret = read_crc(pipe_crc, &crc);
> +	} while (ret > 0 || ret == -EINVAL);
> +
> +	fcntl(pipe_crc->crc_fd, F_SETFL, pipe_crc->flags);
> +}
> +
> +/**
> + * igt_pipe_crc_get_single:
> + * @pipe_crc: pipe CRC object
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Read a single @crc from @pipe_crc. This function blocks even
> + * when nonblocking CRC is requested.
> + *
> + * Callers must start and stop the capturing themselves by calling
> + * igt_pipe_crc_start() and igt_pipe_crc_stop(). For one-shot CRC collecting
> + * look at igt_pipe_crc_collect_crc().
> + *
> + * If capturing has been going on for a while and a fresh crc is required,
> + * you should use igt_pipe_crc_get_current() instead.
> + */
> +void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	read_one_crc(pipe_crc, crc);
> +
> +	crc_sanity_checks(pipe_crc, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_get_current:
> + * @drm_fd: Pointer to drm fd for vblank counter
> + * @pipe_crc: pipe CRC object
> + * @vblank: frame counter value we're looking for
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Same as igt_pipe_crc_get_single(), but will wait until a CRC has been captured
> + * for frame @vblank.
> + */
> +void
> +igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> +			   unsigned int vblank, igt_crc_t *crc)
> +{
> +	do {
> +		read_one_crc(pipe_crc, crc);
> +
> +		/* Only works with valid frame counter */
> +		if (!crc->has_valid_frame) {
> +			igt_pipe_crc_drain(pipe_crc);
> +			igt_pipe_crc_get_single(pipe_crc, crc);
> +			return;
> +		}
> +	} while (igt_vblank_before(crc->frame, vblank));
> +
> +	crc_sanity_checks(pipe_crc, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_get_current:
> + * @drm_fd: Pointer to drm fd for vblank counter
> + * @pipe_crc: pipe CRC object
> + * @crc: buffer pointer for the captured CRC value
> + *
> + * Same as igt_pipe_crc_get_single(), but will wait until a new CRC can be captured.
> + * This is useful for retrieving the current CRC in a more race free way than
> + * igt_pipe_crc_drain() + igt_pipe_crc_get_single().
> + */
> +void
> +igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc)
> +{
> +	unsigned vblank = kmstest_get_vblank(drm_fd, pipe_crc->pipe, 0) + 1;
> +
> +	return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc);
> +}
> +
> +/**
> + * igt_pipe_crc_collect_crc:
> + * @pipe_crc: pipe CRC object
> + * @out_crc: buffer for the captured CRC values
> + *
> + * Read a single CRC from @pipe_crc. This function blocks until the CRC is
> + * retrieved, irrespective of whether @pipe_crc has been opened with
> + * igt_pipe_crc_new() or igt_pipe_crc_new_nonblock().  @out_crc must be
> + * allocated by the caller.
> + *
> + * This function takes care of the pipe_crc book-keeping, it will start/stop
> + * the collection of the CRC.
> + *
> + * This function also calls the interactive debug with the "crc" domain, so you
> + * can make use of this feature to actually see the screen that is being CRC'd.
> + *
> + * For continuous CRC collection look at igt_pipe_crc_start(),
> + * igt_pipe_crc_get_crcs() and igt_pipe_crc_stop().
> + */
> +void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
> +{
> +	igt_debug_wait_for_keypress("crc");
> +
> +	igt_pipe_crc_start(pipe_crc);
> +	igt_pipe_crc_get_single(pipe_crc, out_crc);
> +	igt_pipe_crc_stop(pipe_crc);
> +}
> diff --git a/lib/igt_pipe_crc.h b/lib/igt_pipe_crc.h
> new file mode 100644
> index 000000000000..2e1d3f918bf2
> --- /dev/null
> +++ b/lib/igt_pipe_crc.h
> @@ -0,0 +1,87 @@
> +/*
> + * Copyright © 2013 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + */

Same here, use SPDX.

Regards,
Kamil

> +
> +#ifndef __IGT_PIPE_CRC_H__
> +#define __IGT_PIPE_CRC_H__
> +
> +#include <stdbool.h>
> +#include <stdint.h>
> +
> +enum pipe;
> +
> +/**
> + * igt_pipe_crc_t:
> + *
> + * Pipe CRC support structure. Needs to be allocated and set up with
> + * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
> + */
> +typedef struct _igt_pipe_crc igt_pipe_crc_t;
> +
> +#define DRM_MAX_CRC_NR 10
> +/**
> + * igt_crc_t:
> + * @frame: frame number of the capture CRC
> + * @n_words: internal field, don't access
> + * @crc: internal field, don't access
> + *
> + * Pipe CRC value. All other members than @frame are private and should not be
> + * inspected by testcases.
> + */
> +struct _igt_crc {
> +	uint32_t frame;
> +	bool has_valid_frame;
> +	int n_words;
> +	uint32_t crc[DRM_MAX_CRC_NR];
> +};
> +typedef struct _igt_crc igt_crc_t;
> +
> +#define IGT_PIPE_CRC_SOURCE_AUTO "auto"
> +#define AMDGPU_PIPE_CRC_SOURCE_DPRX "dprx"
> +
> +bool igt_find_crc_mismatch(const igt_crc_t *a, const igt_crc_t *b, int *index);
> +void igt_assert_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> +bool igt_check_crc_equal(const igt_crc_t *a, const igt_crc_t *b);
> +char *igt_crc_to_string_extended(igt_crc_t *crc, char delimiter, int crc_size);
> +char *igt_crc_to_string(igt_crc_t *crc);
> +
> +void igt_require_pipe_crc(int fd);
> +igt_pipe_crc_t *
> +igt_pipe_crc_new(int fd, enum pipe pipe, const char *source);
> +igt_pipe_crc_t *
> +igt_pipe_crc_new_nonblock(int fd, enum pipe pipe, const char *source);
> +void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
> +__attribute__((warn_unused_result))
> +int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
> +			  igt_crc_t **out_crcs);
> +void igt_pipe_crc_drain(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_get_single(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> +void igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc);
> +void igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,
> +				unsigned int vblank, igt_crc_t *crc);
> +
> +void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
> +
> +#endif /* __IGT_PIPE_CRC_H__ */
> diff --git a/lib/meson.build b/lib/meson.build
> index 8d6c8a244afe..56d6a41fa612 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -30,6 +30,7 @@ lib_sources = [
>  	'igt_os.c',
>  	'igt_params.c',
>  	'igt_perf.c',
> +	'igt_pipe_crc.c',
>  	'igt_power.c',
>  	'igt_primes.c',
>  	'igt_rand.c',
> diff --git a/tests/i915/kms_mmap_write_crc.c b/tests/i915/kms_mmap_write_crc.c
> index c36547fced9c..96ddac116378 100644
> --- a/tests/i915/kms_mmap_write_crc.c
> +++ b/tests/i915/kms_mmap_write_crc.c
> @@ -33,6 +33,7 @@
>  #include "drmtest.h"
>  #include "igt_debugfs.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  #include "intel_chipset.h"
>  #include "ioctl_wrappers.h"
>  #include "igt_aux.h"
> diff --git a/tools/intel_display_crc.c b/tools/intel_display_crc.c
> index 61291fc2aa88..357ffb8229f6 100644
> --- a/tools/intel_display_crc.c
> +++ b/tools/intel_display_crc.c
> @@ -32,6 +32,7 @@
>  #include "igt_core.h"
>  #include "igt_debugfs.h"
>  #include "igt_kms.h"
> +#include "igt_pipe_crc.h"
>  
>  typedef struct {
>  	int fd;
> -- 
> 2.35.1
> 

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs
  2022-10-20  9:45   ` Kamil Konieczny
@ 2022-10-20  9:52     ` Ville Syrjälä
  2022-10-20 10:08       ` Petri Latvala
  0 siblings, 1 reply; 12+ messages in thread
From: Ville Syrjälä @ 2022-10-20  9:52 UTC (permalink / raw)
  To: Kamil Konieczny, igt-dev, Petri Latvala

On Thu, Oct 20, 2022 at 11:45:27AM +0200, Kamil Konieczny wrote:
> Hi Ville,
> 
> On 2022-10-19 at 19:30:29 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> You are author and sender, no need for this "From:" line.

It's an old trick to work around email servers that rewrite the From
header. I suppose I could get rid of it now that I no longer send
via such servers, but meh.

<snip>
> > diff --git a/lib/igt_pipe_crc.c b/lib/igt_pipe_crc.c
> > new file mode 100644
> > index 000000000000..14fe7331f0b0
> > --- /dev/null
> > +++ b/lib/igt_pipe_crc.c
> > @@ -0,0 +1,610 @@
> > +/*
> > + * Copyright © 2013 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + */
> 
> Please use SPDX licence here.

Didn't realize we started to use those in igt. I'll respin.

-- 
Ville Syrjälä
Intel

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

* Re: [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs
  2022-10-20  9:52     ` Ville Syrjälä
@ 2022-10-20 10:08       ` Petri Latvala
  0 siblings, 0 replies; 12+ messages in thread
From: Petri Latvala @ 2022-10-20 10:08 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

On Thu, Oct 20, 2022 at 12:52:51PM +0300, Ville Syrjälä wrote:
> On Thu, Oct 20, 2022 at 11:45:27AM +0200, Kamil Konieczny wrote:
> > Hi Ville,
> > 
> > On 2022-10-19 at 19:30:29 +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > You are author and sender, no need for this "From:" line.
> 
> It's an old trick to work around email servers that rewrite the From
> header. I suppose I could get rid of it now that I no longer send
> via such servers, but meh.
> 
> <snip>
> > > diff --git a/lib/igt_pipe_crc.c b/lib/igt_pipe_crc.c
> > > new file mode 100644
> > > index 000000000000..14fe7331f0b0
> > > --- /dev/null
> > > +++ b/lib/igt_pipe_crc.c
> > > @@ -0,0 +1,610 @@
> > > +/*
> > > + * Copyright © 2013 Intel Corporation
> > > + *
> > > + * Permission is hereby granted, free of charge, to any person obtaining a
> > > + * copy of this software and associated documentation files (the "Software"),
> > > + * to deal in the Software without restriction, including without limitation
> > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > > + * and/or sell copies of the Software, and to permit persons to whom the
> > > + * Software is furnished to do so, subject to the following conditions:
> > > + *
> > > + * The above copyright notice and this permission notice (including the next
> > > + * paragraph) shall be included in all copies or substantial portions of the
> > > + * Software.
> > > + *
> > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > > + * IN THE SOFTWARE.
> > > + *
> > > + */
> > 
> > Please use SPDX licence here.
> 
> Didn't realize we started to use those in igt. I'll respin.

They are ok to use in new files, not in old files. Season's greetings
from Legal.


-- 
Petri Latvala

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

* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2)
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
                   ` (2 preceding siblings ...)
  2022-10-19 17:32 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Patchwork
@ 2022-10-20 10:19 ` Patchwork
  2022-10-20 10:20 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-20 10:19 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 8291 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2)
URL   : https://patchwork.freedesktop.org/series/109900/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_12264 -> IGTPW_7991
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_7991 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_7991, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/index.html

Participating hosts (44 -> 43)
------------------------------

  Additional (1): bat-jsl-3 
  Missing    (2): fi-icl-u2 fi-bdw-samus 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_7991:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live@gem_contexts:
    - fi-kbl-7567u:       [PASS][1] -> [DMESG-FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/fi-kbl-7567u/igt@i915_selftest@live@gem_contexts.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-kbl-7567u/igt@i915_selftest@live@gem_contexts.html

  
Known issues
------------

  Here are the changes found in IGTPW_7991 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_lmem_swapping@basic:
    - fi-apl-guc:         NOTRUN -> [SKIP][3] ([fdo#109271] / [i915#4613]) +3 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-apl-guc/igt@gem_lmem_swapping@basic.html

  * igt@i915_selftest@live@hangcheck:
    - fi-hsw-4770:        [PASS][4] -> [INCOMPLETE][5] ([i915#4785])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-apl-guc:         NOTRUN -> [SKIP][6] ([fdo#109271] / [fdo#111827])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-apl-guc/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@runner@aborted:
    - fi-hsw-4770:        NOTRUN -> [FAIL][7] ([fdo#109271] / [i915#4312] / [i915#5594])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-hsw-4770/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@core_hotunplug@unbind-rebind:
    - fi-apl-guc:         [INCOMPLETE][8] ([i915#7073]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/fi-apl-guc/igt@core_hotunplug@unbind-rebind.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-apl-guc/igt@core_hotunplug@unbind-rebind.html

  * igt@gem_exec_suspend@basic-s0@smem:
    - {bat-rplp-1}:       [DMESG-WARN][10] ([i915#2867]) -> [PASS][11]
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-rplp-1/igt@gem_exec_suspend@basic-s0@smem.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-rplp-1/igt@gem_exec_suspend@basic-s0@smem.html

  * igt@gem_exec_suspend@basic-s3@smem:
    - {bat-adlm-1}:       [DMESG-WARN][12] ([i915#2867]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-adlm-1/igt@gem_exec_suspend@basic-s3@smem.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-adlm-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_selftest@live@gem_contexts:
    - {bat-dg2-8}:        [DMESG-FAIL][14] ([i915#7270]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-dg2-8/igt@i915_selftest@live@gem_contexts.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-dg2-8/igt@i915_selftest@live@gem_contexts.html

  * igt@i915_selftest@live@requests:
    - bat-adlp-4:         [DMESG-FAIL][16] ([i915#7269]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-adlp-4/igt@i915_selftest@live@requests.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-adlp-4/igt@i915_selftest@live@requests.html
    - {bat-adlp-6}:       [DMESG-FAIL][18] ([i915#7269]) -> [PASS][19]
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-adlp-6/igt@i915_selftest@live@requests.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-adlp-6/igt@i915_selftest@live@requests.html

  * igt@i915_selftest@live@reset:
    - {bat-rpls-1}:       [DMESG-FAIL][20] ([i915#4983] / [i915#5828]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-rpls-1/igt@i915_selftest@live@reset.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-rpls-1/igt@i915_selftest@live@reset.html
    - {bat-rpls-2}:       [DMESG-FAIL][22] ([i915#4983]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-rpls-2/igt@i915_selftest@live@reset.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-rpls-2/igt@i915_selftest@live@reset.html

  * igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3:
    - {bat-dg2-11}:       [FAIL][24] ([i915#6818]) -> [PASS][25]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/bat-dg2-11/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-3.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-hdmi-a-2:
    - fi-bdw-5557u:       [DMESG-WARN][26] -> [PASS][27]
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12264/fi-bdw-5557u/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-hdmi-a-2.html
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/fi-bdw-5557u/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-hdmi-a-2.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#3003]: https://gitlab.freedesktop.org/drm/intel/issues/3003
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5278]: https://gitlab.freedesktop.org/drm/intel/issues/5278
  [i915#5594]: https://gitlab.freedesktop.org/drm/intel/issues/5594
  [i915#5828]: https://gitlab.freedesktop.org/drm/intel/issues/5828
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6559]: https://gitlab.freedesktop.org/drm/intel/issues/6559
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7073]: https://gitlab.freedesktop.org/drm/intel/issues/7073
  [i915#7269]: https://gitlab.freedesktop.org/drm/intel/issues/7269
  [i915#7270]: https://gitlab.freedesktop.org/drm/intel/issues/7270


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7020 -> IGTPW_7991

  CI-20190529: 20190529
  CI_DRM_12264: 1d6878b45c6d2c1999761877115c9b4f2fa44055 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7991: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/index.html
  IGT_7020: 05b7eaf9ade2216d17c069c89439015757ee25f7 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7991/index.html

[-- Attachment #2: Type: text/html, Size: 8783 bytes --]

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

* [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2)
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
                   ` (3 preceding siblings ...)
  2022-10-20 10:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2) Patchwork
@ 2022-10-20 10:20 ` Patchwork
  2022-10-31 19:23 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3) Patchwork
  2022-10-31 22:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-20 10:20 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2)
URL   : https://patchwork.freedesktop.org/series/109900/
State : warning

== Summary ==

Pipeline status: FAILED.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/716657 for the overview.

test:ninja-test-mips has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/30101213):
  Ok:                   23
  Expected Fail:         4
  Fail:                293
  Unexpected Pass:       0
  Skipped:               0
  Timeout:               0
  
  Full log written to /builds/gfx-ci/igt-ci-tags/build/meson-logs/testlog.txt
  section_end:1666260936:step_script
  section_start:1666260936:upload_artifacts_on_failure
  Uploading artifacts for failed job
  Uploading artifacts...
  build: found 1792 matching files and directories   
  Uploading artifacts as "archive" to coordinator... 201 Created  id=30101213 responseStatus=201 Created token=r6Kvs5jR
  section_end:1666260946:upload_artifacts_on_failure
  section_start:1666260946:cleanup_file_variables
  Cleaning up project directory and file based variables
  section_end:1666260947:cleanup_file_variables
  ERROR: Job failed: exit code 1

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/pipelines/716657

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3)
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
                   ` (4 preceding siblings ...)
  2022-10-20 10:20 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
@ 2022-10-31 19:23 ` Patchwork
  2022-10-31 22:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-31 19:23 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 11731 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3)
URL   : https://patchwork.freedesktop.org/series/109900/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12325 -> IGTPW_8018
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html

Participating hosts (40 -> 40)
------------------------------

  Additional (3): fi-rkl-11600 bat-atsm-1 fi-tgl-dsi 
  Missing    (3): fi-cml-u2 fi-icl-u2 fi-hsw-4770 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8018:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@kms_flip@basic-flip-vs-wf_vblank:
    - {bat-atsm-1}:       NOTRUN -> [SKIP][1] +7 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-atsm-1/igt@kms_flip@basic-flip-vs-wf_vblank.html

  
Known issues
------------

  Here are the changes found in IGTPW_8018 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_huc_copy@huc-copy:
    - fi-rkl-11600:       NOTRUN -> [SKIP][2] ([i915#2190])
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@gem_huc_copy@huc-copy.html

  * igt@gem_lmem_swapping@basic:
    - fi-rkl-11600:       NOTRUN -> [SKIP][3] ([i915#4613]) +3 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@gem_lmem_swapping@basic.html

  * igt@gem_tiled_pread_basic:
    - fi-rkl-11600:       NOTRUN -> [SKIP][4] ([i915#3282])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@gem_tiled_pread_basic.html

  * igt@i915_pm_backlight@basic-brightness:
    - fi-rkl-11600:       NOTRUN -> [SKIP][5] ([i915#3012])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@i915_pm_backlight@basic-brightness.html

  * igt@i915_selftest@live@hangcheck:
    - fi-hsw-g3258:       [PASS][6] -> [INCOMPLETE][7] ([i915#3303] / [i915#4785])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-hsw-g3258/igt@i915_selftest@live@hangcheck.html

  * igt@i915_suspend@basic-s3-without-i915:
    - fi-rkl-11600:       NOTRUN -> [INCOMPLETE][8] ([i915#4817])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@i915_suspend@basic-s3-without-i915.html

  * igt@kms_chamelium@hdmi-edid-read:
    - fi-rkl-11600:       NOTRUN -> [SKIP][9] ([fdo#111827]) +7 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@kms_chamelium@hdmi-edid-read.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor:
    - fi-rkl-11600:       NOTRUN -> [SKIP][10] ([i915#4103])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@kms_cursor_legacy@basic-busy-flip-before-cursor.html

  * igt@kms_force_connector_basic@force-load-detect:
    - fi-rkl-11600:       NOTRUN -> [SKIP][11] ([fdo#109285] / [i915#4098])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@kms_force_connector_basic@force-load-detect.html

  * igt@kms_psr@primary_page_flip:
    - fi-rkl-11600:       NOTRUN -> [SKIP][12] ([i915#1072]) +3 similar issues
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@kms_psr@primary_page_flip.html

  * igt@kms_setmode@basic-clone-single-crtc:
    - fi-rkl-11600:       NOTRUN -> [SKIP][13] ([i915#3555] / [i915#4098])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@kms_setmode@basic-clone-single-crtc.html

  * igt@prime_vgem@basic-read:
    - fi-rkl-11600:       NOTRUN -> [SKIP][14] ([fdo#109295] / [i915#3291] / [i915#3708]) +2 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@prime_vgem@basic-read.html

  * igt@prime_vgem@basic-userptr:
    - fi-rkl-11600:       NOTRUN -> [SKIP][15] ([fdo#109295] / [i915#3301] / [i915#3708])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-rkl-11600/igt@prime_vgem@basic-userptr.html

  * igt@runner@aborted:
    - fi-hsw-g3258:       NOTRUN -> [FAIL][16] ([fdo#109271] / [i915#4312] / [i915#4991])
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-hsw-g3258/igt@runner@aborted.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s0@lmem0:
    - {bat-dg2-11}:       [DMESG-FAIL][17] ([fdo#103375]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-dg2-11/igt@gem_exec_suspend@basic-s0@lmem0.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-dg2-11/igt@gem_exec_suspend@basic-s0@lmem0.html

  * igt@gem_exec_suspend@basic-s0@smem:
    - {bat-adlm-1}:       [DMESG-WARN][19] ([i915#2867]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-adlm-1/igt@gem_exec_suspend@basic-s0@smem.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-adlm-1/igt@gem_exec_suspend@basic-s0@smem.html

  * igt@gem_exec_suspend@basic-s3@lmem0:
    - {bat-dg2-11}:       [FAIL][21] ([fdo#103375]) -> [PASS][22] +2 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-dg2-11/igt@gem_exec_suspend@basic-s3@lmem0.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-dg2-11/igt@gem_exec_suspend@basic-s3@lmem0.html

  * igt@gem_exec_suspend@basic-s3@smem:
    - {bat-rplp-1}:       [DMESG-WARN][23] ([i915#2867]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-rplp-1/igt@gem_exec_suspend@basic-s3@smem.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-rplp-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_pm_rpm@module-reload:
    - {bat-rpls-2}:       [WARN][25] ([i915#7346]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-rpls-2/igt@i915_pm_rpm@module-reload.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-rpls-2/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@slpc:
    - {bat-adln-1}:       [DMESG-FAIL][27] ([i915#6997]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-adln-1/igt@i915_selftest@live@slpc.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-adln-1/igt@i915_selftest@live@slpc.html

  * igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
    - fi-bsw-kefka:       [FAIL][29] ([i915#6298]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-3:
    - {bat-dg2-11}:       [FAIL][31] -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-3.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-3.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3:
    - {bat-dg2-11}:       [FAIL][33] ([i915#6818]) -> [PASS][34] +2 similar issues
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/bat-dg2-11/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-b-dp-3.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1836]: https://gitlab.freedesktop.org/drm/intel/issues/1836
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2411]: https://gitlab.freedesktop.org/drm/intel/issues/2411
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3303]: https://gitlab.freedesktop.org/drm/intel/issues/3303
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4258]: https://gitlab.freedesktop.org/drm/intel/issues/4258
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
  [i915#4817]: https://gitlab.freedesktop.org/drm/intel/issues/4817
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#6077]: https://gitlab.freedesktop.org/drm/intel/issues/6077
  [i915#6078]: https://gitlab.freedesktop.org/drm/intel/issues/6078
  [i915#6094]: https://gitlab.freedesktop.org/drm/intel/issues/6094
  [i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6818]: https://gitlab.freedesktop.org/drm/intel/issues/6818
  [i915#6856]: https://gitlab.freedesktop.org/drm/intel/issues/6856
  [i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
  [i915#7029]: https://gitlab.freedesktop.org/drm/intel/issues/7029
  [i915#7125]: https://gitlab.freedesktop.org/drm/intel/issues/7125
  [i915#7342]: https://gitlab.freedesktop.org/drm/intel/issues/7342
  [i915#7346]: https://gitlab.freedesktop.org/drm/intel/issues/7346
  [i915#7357]: https://gitlab.freedesktop.org/drm/intel/issues/7357
  [i915#7358]: https://gitlab.freedesktop.org/drm/intel/issues/7358


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7032 -> IGTPW_8018

  CI-20190529: 20190529
  CI_DRM_12325: 1a90222aa5e5bb86ffcbde5ba9611659a23f0df6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8018: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html
  IGT_7032: 372c56225e12578a7a4a6bcc5b79eb40b643fcde @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

-igt@kms_chamelium@dp-edid-stress-resolution

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html

[-- Attachment #2: Type: text/html, Size: 11898 bytes --]

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

* [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3)
  2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
                   ` (5 preceding siblings ...)
  2022-10-31 19:23 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3) Patchwork
@ 2022-10-31 22:35 ` Patchwork
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2022-10-31 22:35 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 47298 bytes --]

== Series Details ==

Series: series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3)
URL   : https://patchwork.freedesktop.org/series/109900/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_12325_full -> IGTPW_8018_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html

Participating hosts (11 -> 8)
------------------------------

  Missing    (3): pig-skl-6260u pig-kbl-iris pig-glk-j5005 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8018_full:

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_pm_rc6_residency@rc6-idle@vcs0:
    - {shard-rkl}:        NOTRUN -> [WARN][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-5/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html

  * igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip:
    - {shard-rkl}:        [SKIP][2] ([i915#1845] / [i915#4098]) -> [FAIL][3]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-4/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@kms_big_fb@y-tiled-max-hw-stride-32bpp-rotate-0-hflip-async-flip.html

  
Known issues
------------

  Here are the changes found in IGTPW_8018_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@feature_discovery@chamelium:
    - shard-tglb:         NOTRUN -> [SKIP][4] ([fdo#111827])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb8/igt@feature_discovery@chamelium.html
    - shard-iclb:         NOTRUN -> [SKIP][5] ([fdo#111827])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb6/igt@feature_discovery@chamelium.html

  * igt@feature_discovery@display-3x:
    - shard-iclb:         NOTRUN -> [SKIP][6] ([i915#1839])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@feature_discovery@display-3x.html
    - shard-tglb:         NOTRUN -> [SKIP][7] ([i915#1839])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb3/igt@feature_discovery@display-3x.html

  * igt@gem_ctx_param@set-priority-not-supported:
    - shard-tglb:         NOTRUN -> [SKIP][8] ([fdo#109314])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@gem_ctx_param@set-priority-not-supported.html
    - shard-iclb:         NOTRUN -> [SKIP][9] ([fdo#109314])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@gem_ctx_param@set-priority-not-supported.html

  * igt@gem_ctx_persistence@process:
    - shard-snb:          NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#1099])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-snb5/igt@gem_ctx_persistence@process.html

  * igt@gem_ctx_persistence@smoketest:
    - shard-apl:          [PASS][11] -> [FAIL][12] ([i915#5099])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl1/igt@gem_ctx_persistence@smoketest.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl8/igt@gem_ctx_persistence@smoketest.html

  * igt@gem_ctx_sseu@mmap-args:
    - shard-tglb:         NOTRUN -> [SKIP][13] ([i915#280]) +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb6/igt@gem_ctx_sseu@mmap-args.html

  * igt@gem_eio@suspend:
    - shard-iclb:         [PASS][14] -> [DMESG-WARN][15] ([i915#4391])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb3/igt@gem_eio@suspend.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@gem_eio@suspend.html

  * igt@gem_exec_balancer@parallel-bb-first:
    - shard-iclb:         [PASS][16] -> [SKIP][17] ([i915#4525]) +2 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb2/igt@gem_exec_balancer@parallel-bb-first.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@gem_exec_balancer@parallel-bb-first.html

  * igt@gem_exec_fair@basic-none@vcs1:
    - shard-iclb:         NOTRUN -> [FAIL][18] ([i915#2842])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb1/igt@gem_exec_fair@basic-none@vcs1.html

  * igt@gem_exec_fair@basic-pace-share@rcs0:
    - shard-glk:          [PASS][19] -> [FAIL][20] ([i915#2842])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-glk3/igt@gem_exec_fair@basic-pace-share@rcs0.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk7/igt@gem_exec_fair@basic-pace-share@rcs0.html

  * igt@gem_lmem_swapping@parallel-random-engines:
    - shard-iclb:         NOTRUN -> [SKIP][21] ([i915#4613]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb1/igt@gem_lmem_swapping@parallel-random-engines.html
    - shard-apl:          NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#4613]) +1 similar issue
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl3/igt@gem_lmem_swapping@parallel-random-engines.html
    - shard-tglb:         NOTRUN -> [SKIP][23] ([i915#4613]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb6/igt@gem_lmem_swapping@parallel-random-engines.html

  * igt@gem_lmem_swapping@verify-ccs:
    - shard-glk:          NOTRUN -> [SKIP][24] ([fdo#109271] / [i915#4613]) +1 similar issue
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk1/igt@gem_lmem_swapping@verify-ccs.html

  * igt@gem_mmap_gtt@coherency:
    - shard-tglb:         NOTRUN -> [SKIP][25] ([fdo#111656])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb3/igt@gem_mmap_gtt@coherency.html
    - shard-iclb:         NOTRUN -> [SKIP][26] ([fdo#109292])
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@gem_mmap_gtt@coherency.html

  * igt@gem_pxp@create-valid-protected-context:
    - shard-iclb:         NOTRUN -> [SKIP][27] ([i915#4270])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@gem_pxp@create-valid-protected-context.html
    - shard-tglb:         NOTRUN -> [SKIP][28] ([i915#4270])
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb1/igt@gem_pxp@create-valid-protected-context.html

  * igt@gem_render_copy@y-tiled-to-vebox-y-tiled:
    - shard-iclb:         NOTRUN -> [SKIP][29] ([i915#768]) +1 similar issue
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@gem_render_copy@y-tiled-to-vebox-y-tiled.html

  * igt@gem_userptr_blits@unsync-overlap:
    - shard-iclb:         NOTRUN -> [SKIP][30] ([i915#3297])
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb6/igt@gem_userptr_blits@unsync-overlap.html
    - shard-tglb:         NOTRUN -> [SKIP][31] ([i915#3297])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb8/igt@gem_userptr_blits@unsync-overlap.html

  * igt@gen3_mixed_blits:
    - shard-iclb:         NOTRUN -> [SKIP][32] ([fdo#109289]) +1 similar issue
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@gen3_mixed_blits.html
    - shard-tglb:         NOTRUN -> [SKIP][33] ([fdo#109289])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@gen3_mixed_blits.html

  * igt@gen9_exec_parse@basic-rejected:
    - shard-tglb:         NOTRUN -> [SKIP][34] ([i915#2527] / [i915#2856]) +1 similar issue
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@gen9_exec_parse@basic-rejected.html
    - shard-iclb:         NOTRUN -> [SKIP][35] ([i915#2856]) +1 similar issue
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb3/igt@gen9_exec_parse@basic-rejected.html

  * igt@i915_module_load@resize-bar:
    - shard-iclb:         NOTRUN -> [SKIP][36] ([i915#6412])
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@i915_module_load@resize-bar.html
    - shard-tglb:         NOTRUN -> [SKIP][37] ([i915#6412])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@i915_module_load@resize-bar.html

  * igt@i915_pm_rc6_residency@rc6-idle@rcs0:
    - shard-tglb:         NOTRUN -> [WARN][38] ([i915#2681]) +3 similar issues
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb3/igt@i915_pm_rc6_residency@rc6-idle@rcs0.html

  * igt@i915_pm_rc6_residency@rc6-idle@vcs0:
    - shard-iclb:         NOTRUN -> [WARN][39] ([i915#2684]) +3 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html

  * igt@i915_pm_rps@engine-order:
    - shard-apl:          NOTRUN -> [FAIL][40] ([i915#6537])
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl1/igt@i915_pm_rps@engine-order.html

  * igt@i915_query@query-topology-known-pci-ids:
    - shard-tglb:         NOTRUN -> [SKIP][41] ([fdo#109303])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@i915_query@query-topology-known-pci-ids.html
    - shard-iclb:         NOTRUN -> [SKIP][42] ([fdo#109303])
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@i915_query@query-topology-known-pci-ids.html

  * igt@i915_selftest@perf@engine_cs:
    - shard-snb:          [PASS][43] -> [SKIP][44] ([fdo#109271])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-snb7/igt@i915_selftest@perf@engine_cs.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-snb5/igt@i915_selftest@perf@engine_cs.html

  * igt@kms_async_flips@alternate-sync-async-flip@pipe-a-vga-1:
    - shard-snb:          [PASS][45] -> [FAIL][46] ([i915#2521])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-snb6/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-vga-1.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-snb7/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-vga-1.html

  * igt@kms_atomic@plane-primary-overlay-mutable-zpos:
    - shard-iclb:         NOTRUN -> [SKIP][47] ([i915#404])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html
    - shard-tglb:         NOTRUN -> [SKIP][48] ([i915#404])
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb3/igt@kms_atomic@plane-primary-overlay-mutable-zpos.html

  * igt@kms_big_fb@4-tiled-64bpp-rotate-0:
    - shard-tglb:         NOTRUN -> [SKIP][49] ([i915#5286]) +3 similar issues
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_big_fb@4-tiled-64bpp-rotate-0.html

  * igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-180-hflip:
    - shard-iclb:         NOTRUN -> [SKIP][50] ([i915#5286]) +4 similar issues
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@kms_big_fb@4-tiled-max-hw-stride-32bpp-rotate-180-hflip.html

  * igt@kms_big_fb@x-tiled-64bpp-rotate-90:
    - shard-iclb:         NOTRUN -> [SKIP][51] ([fdo#110725] / [fdo#111614])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@kms_big_fb@x-tiled-64bpp-rotate-90.html

  * igt@kms_big_fb@yf-tiled-8bpp-rotate-180:
    - shard-iclb:         NOTRUN -> [SKIP][52] ([fdo#110723])
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@kms_big_fb@yf-tiled-8bpp-rotate-180.html

  * igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0-async-flip:
    - shard-tglb:         NOTRUN -> [SKIP][53] ([fdo#111615]) +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0-async-flip.html

  * igt@kms_ccs@pipe-a-crc-primary-rotation-180-yf_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][54] ([fdo#111615] / [i915#3689]) +1 similar issue
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb2/igt@kms_ccs@pipe-a-crc-primary-rotation-180-yf_tiled_ccs.html

  * igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][55] ([i915#3689] / [i915#3886])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs.html
    - shard-glk:          NOTRUN -> [SKIP][56] ([fdo#109271] / [i915#3886]) +1 similar issue
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk9/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs.html
    - shard-iclb:         NOTRUN -> [SKIP][57] ([fdo#109278] / [i915#3886]) +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs.html
    - shard-apl:          NOTRUN -> [SKIP][58] ([fdo#109271] / [i915#3886]) +1 similar issue
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl6/igt@kms_ccs@pipe-b-bad-pixel-format-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][59] ([i915#3689]) +3 similar issues
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_ccs.html

  * igt@kms_ccs@pipe-d-crc-sprite-planes-basic-4_tiled_dg2_rc_ccs:
    - shard-tglb:         NOTRUN -> [SKIP][60] ([i915#6095]) +2 similar issues
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb6/igt@kms_ccs@pipe-d-crc-sprite-planes-basic-4_tiled_dg2_rc_ccs.html

  * igt@kms_chamelium@dp-hpd-after-suspend:
    - shard-apl:          NOTRUN -> [SKIP][61] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl1/igt@kms_chamelium@dp-hpd-after-suspend.html

  * igt@kms_chamelium@vga-hpd-with-enabled-mode:
    - shard-snb:          NOTRUN -> [SKIP][62] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-snb5/igt@kms_chamelium@vga-hpd-with-enabled-mode.html
    - shard-tglb:         NOTRUN -> [SKIP][63] ([fdo#109284] / [fdo#111827]) +2 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb1/igt@kms_chamelium@vga-hpd-with-enabled-mode.html
    - shard-glk:          NOTRUN -> [SKIP][64] ([fdo#109271] / [fdo#111827]) +2 similar issues
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk6/igt@kms_chamelium@vga-hpd-with-enabled-mode.html
    - shard-iclb:         NOTRUN -> [SKIP][65] ([fdo#109284] / [fdo#111827]) +3 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb3/igt@kms_chamelium@vga-hpd-with-enabled-mode.html

  * igt@kms_content_protection@dp-mst-lic-type-1:
    - shard-iclb:         NOTRUN -> [SKIP][66] ([i915#3116]) +1 similar issue
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@kms_content_protection@dp-mst-lic-type-1.html

  * igt@kms_content_protection@dp-mst-type-0:
    - shard-tglb:         NOTRUN -> [SKIP][67] ([i915#3116] / [i915#3299]) +1 similar issue
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_content_protection@dp-mst-type-0.html

  * igt@kms_cursor_crc@cursor-offscreen-512x512:
    - shard-tglb:         NOTRUN -> [SKIP][68] ([i915#3359])
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_cursor_crc@cursor-offscreen-512x512.html
    - shard-iclb:         NOTRUN -> [SKIP][69] ([i915#3359])
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb1/igt@kms_cursor_crc@cursor-offscreen-512x512.html

  * igt@kms_cursor_legacy@flip-vs-cursor@toggle:
    - shard-iclb:         [PASS][70] -> [FAIL][71] ([i915#2346]) +2 similar issues
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb6/igt@kms_cursor_legacy@flip-vs-cursor@toggle.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@kms_cursor_legacy@flip-vs-cursor@toggle.html

  * igt@kms_flip@2x-absolute-wf_vblank-interruptible:
    - shard-iclb:         NOTRUN -> [SKIP][72] ([fdo#109274]) +2 similar issues
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@kms_flip@2x-absolute-wf_vblank-interruptible.html

  * igt@kms_flip@2x-nonexisting-fb-interruptible:
    - shard-tglb:         NOTRUN -> [SKIP][73] ([fdo#109274] / [fdo#111825] / [i915#3637]) +2 similar issues
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_flip@2x-nonexisting-fb-interruptible.html

  * igt@kms_flip@flip-vs-suspend@c-edp1:
    - shard-iclb:         [PASS][74] -> [DMESG-WARN][75] ([i915#2867])
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb7/igt@kms_flip@flip-vs-suspend@c-edp1.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@kms_flip@flip-vs-suspend@c-edp1.html

  * igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode:
    - shard-iclb:         NOTRUN -> [SKIP][76] ([i915#2587] / [i915#2672]) +1 similar issue
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb6/igt@kms_flip_scaled_crc@flip-32bpp-4tile-to-64bpp-4tile-downscaling@pipe-a-valid-mode.html

  * igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode:
    - shard-tglb:         NOTRUN -> [SKIP][77] ([i915#2587] / [i915#2672]) +1 similar issue
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_flip_scaled_crc@flip-32bpp-yftile-to-64bpp-yftile-downscaling@pipe-a-valid-mode.html

  * igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-upscaling@pipe-a-default-mode:
    - shard-iclb:         NOTRUN -> [SKIP][78] ([i915#2672]) +5 similar issues
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@kms_flip_scaled_crc@flip-64bpp-4tile-to-16bpp-4tile-upscaling@pipe-a-default-mode.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-indfb-msflip-blt:
    - shard-iclb:         NOTRUN -> [SKIP][79] ([fdo#109280]) +22 similar issues
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-indfb-msflip-blt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-spr-indfb-draw-blt:
    - shard-snb:          NOTRUN -> [SKIP][80] ([fdo#109271]) +127 similar issues
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-snb6/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-spr-indfb-draw-blt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-indfb-draw-mmap-gtt:
    - shard-glk:          NOTRUN -> [SKIP][81] ([fdo#109271]) +71 similar issues
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk5/igt@kms_frontbuffer_tracking@fbcpsr-2p-scndscrn-pri-indfb-draw-mmap-gtt.html

  * igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt:
    - shard-tglb:         NOTRUN -> [SKIP][82] ([i915#6497]) +2 similar issues
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb8/igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-mmap-gtt.html

  * igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-pwrite:
    - shard-tglb:         NOTRUN -> [SKIP][83] ([fdo#109280] / [fdo#111825]) +17 similar issues
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb1/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-pri-indfb-draw-pwrite.html

  * igt@kms_hdmi_inject@inject-audio:
    - shard-tglb:         [PASS][84] -> [SKIP][85] ([i915#433])
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-tglb7/igt@kms_hdmi_inject@inject-audio.html
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_hdmi_inject@inject-audio.html

  * igt@kms_hdr@bpc-switch-suspend:
    - shard-tglb:         NOTRUN -> [SKIP][86] ([i915#3555])
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb8/igt@kms_hdr@bpc-switch-suspend.html
    - shard-iclb:         NOTRUN -> [SKIP][87] ([i915#3555]) +1 similar issue
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb6/igt@kms_hdr@bpc-switch-suspend.html

  * igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-b-edp-1:
    - shard-iclb:         [PASS][88] -> [SKIP][89] ([i915#5176]) +4 similar issues
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb3/igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-b-edp-1.html
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@kms_plane_scaling@plane-downscale-with-pixel-format-factor-0-5@pipe-b-edp-1.html

  * igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-d-edp-1:
    - shard-tglb:         NOTRUN -> [SKIP][90] ([i915#5176]) +7 similar issues
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb3/igt@kms_plane_scaling@plane-downscale-with-rotation-factor-0-75@pipe-d-edp-1.html

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-dp-1:
    - shard-apl:          NOTRUN -> [SKIP][91] ([fdo#109271]) +103 similar issues
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl6/igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-dp-1.html

  * igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-edp-1:
    - shard-iclb:         NOTRUN -> [SKIP][92] ([i915#5176]) +5 similar issues
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb5/igt@kms_plane_scaling@plane-upscale-with-rotation-factor-0-25@pipe-a-edp-1.html

  * igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1:
    - shard-iclb:         [PASS][93] -> [SKIP][94] ([i915#5235]) +2 similar issues
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb6/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@kms_plane_scaling@planes-unity-scaling-downscale-factor-0-5@pipe-c-edp-1.html

  * igt@kms_psr2_sf@overlay-plane-update-continuous-sf:
    - shard-tglb:         NOTRUN -> [SKIP][95] ([i915#2920]) +2 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html
    - shard-glk:          NOTRUN -> [SKIP][96] ([fdo#109271] / [i915#658]) +2 similar issues
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk5/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html
    - shard-iclb:         NOTRUN -> [SKIP][97] ([fdo#111068] / [i915#658]) +2 similar issues
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb3/igt@kms_psr2_sf@overlay-plane-update-continuous-sf.html

  * igt@kms_psr2_sf@plane-move-sf-dmg-area:
    - shard-apl:          NOTRUN -> [SKIP][98] ([fdo#109271] / [i915#658]) +2 similar issues
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl6/igt@kms_psr2_sf@plane-move-sf-dmg-area.html

  * igt@kms_psr2_su@frontbuffer-xrgb8888:
    - shard-iclb:         NOTRUN -> [SKIP][99] ([fdo#109642] / [fdo#111068] / [i915#658])
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@kms_psr2_su@frontbuffer-xrgb8888.html

  * igt@kms_psr@psr2_sprite_plane_onoff:
    - shard-iclb:         [PASS][100] -> [SKIP][101] ([fdo#109441]) +2 similar issues
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb2/igt@kms_psr@psr2_sprite_plane_onoff.html
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb6/igt@kms_psr@psr2_sprite_plane_onoff.html

  * igt@kms_rotation_crc@primary-yf-tiled-reflect-x-180:
    - shard-tglb:         NOTRUN -> [SKIP][102] ([fdo#111615] / [i915#5289])
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb7/igt@kms_rotation_crc@primary-yf-tiled-reflect-x-180.html

  * igt@kms_vblank@pipe-d-wait-forked:
    - shard-iclb:         NOTRUN -> [SKIP][103] ([fdo#109278]) +13 similar issues
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb7/igt@kms_vblank@pipe-d-wait-forked.html

  * igt@kms_writeback@writeback-invalid-parameters:
    - shard-apl:          NOTRUN -> [SKIP][104] ([fdo#109271] / [i915#2437])
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl2/igt@kms_writeback@writeback-invalid-parameters.html
    - shard-tglb:         NOTRUN -> [SKIP][105] ([i915#2437])
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb5/igt@kms_writeback@writeback-invalid-parameters.html
    - shard-glk:          NOTRUN -> [SKIP][106] ([fdo#109271] / [i915#2437])
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk7/igt@kms_writeback@writeback-invalid-parameters.html
    - shard-iclb:         NOTRUN -> [SKIP][107] ([i915#2437])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb1/igt@kms_writeback@writeback-invalid-parameters.html

  * igt@sysfs_clients@fair-3:
    - shard-apl:          NOTRUN -> [SKIP][108] ([fdo#109271] / [i915#2994])
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl8/igt@sysfs_clients@fair-3.html
    - shard-tglb:         NOTRUN -> [SKIP][109] ([i915#2994])
   [109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb1/igt@sysfs_clients@fair-3.html
    - shard-glk:          NOTRUN -> [SKIP][110] ([fdo#109271] / [i915#2994])
   [110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk5/igt@sysfs_clients@fair-3.html
    - shard-iclb:         NOTRUN -> [SKIP][111] ([i915#2994])
   [111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb3/igt@sysfs_clients@fair-3.html

  
#### Possible fixes ####

  * igt@drm_read@short-buffer-block:
    - {shard-rkl}:        [SKIP][112] ([i915#4098]) -> [PASS][113] +1 similar issue
   [112]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-4/igt@drm_read@short-buffer-block.html
   [113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@drm_read@short-buffer-block.html

  * igt@fbdev@write:
    - {shard-rkl}:        [SKIP][114] ([i915#2582]) -> [PASS][115]
   [114]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-1/igt@fbdev@write.html
   [115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@fbdev@write.html

  * igt@feature_discovery@psr2:
    - {shard-rkl}:        [SKIP][116] ([i915#658]) -> [PASS][117]
   [116]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-1/igt@feature_discovery@psr2.html
   [117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@feature_discovery@psr2.html

  * igt@gem_bad_reloc@negative-reloc-bltcopy:
    - {shard-rkl}:        [SKIP][118] ([i915#3281]) -> [PASS][119]
   [118]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-6/igt@gem_bad_reloc@negative-reloc-bltcopy.html
   [119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-5/igt@gem_bad_reloc@negative-reloc-bltcopy.html

  * igt@gem_ctx_persistence@many-contexts:
    - shard-iclb:         [INCOMPLETE][120] -> [PASS][121]
   [120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb5/igt@gem_ctx_persistence@many-contexts.html
   [121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb8/igt@gem_ctx_persistence@many-contexts.html

  * igt@gem_exec_balancer@parallel-keep-in-fence:
    - shard-iclb:         [SKIP][122] ([i915#4525]) -> [PASS][123]
   [122]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb6/igt@gem_exec_balancer@parallel-keep-in-fence.html
   [123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb1/igt@gem_exec_balancer@parallel-keep-in-fence.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - shard-apl:          [FAIL][124] ([i915#2842]) -> [PASS][125] +1 similar issue
   [124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl6/igt@gem_exec_fair@basic-pace-solo@rcs0.html
   [125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl8/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_mmap_gtt@hang-user:
    - {shard-rkl}:        [INCOMPLETE][126] -> [PASS][127] +1 similar issue
   [126]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-2/igt@gem_mmap_gtt@hang-user.html
   [127]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-1/igt@gem_mmap_gtt@hang-user.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-apl:          [DMESG-WARN][128] ([i915#5566] / [i915#716]) -> [PASS][129]
   [128]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl7/igt@gen9_exec_parse@allowed-single.html
   [129]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl7/igt@gen9_exec_parse@allowed-single.html

  * igt@gen9_exec_parse@unaligned-jump:
    - {shard-rkl}:        [SKIP][130] ([i915#2527]) -> [PASS][131]
   [130]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-2/igt@gen9_exec_parse@unaligned-jump.html
   [131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-5/igt@gen9_exec_parse@unaligned-jump.html

  * igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
    - {shard-rkl}:        [SKIP][132] ([i915#1845] / [i915#4098]) -> [PASS][133] +12 similar issues
   [132]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-2/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html
   [133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html

  * igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions:
    - shard-glk:          [FAIL][134] ([i915#2346]) -> [PASS][135]
   [134]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html
   [135]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk8/igt@kms_cursor_legacy@flip-vs-cursor@atomic-transitions.html

  * igt@kms_flip@flip-vs-expired-vblank@c-dp1:
    - shard-apl:          [FAIL][136] ([i915#79]) -> [PASS][137]
   [136]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl3/igt@kms_flip@flip-vs-expired-vblank@c-dp1.html
   [137]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl7/igt@kms_flip@flip-vs-expired-vblank@c-dp1.html

  * igt@kms_frontbuffer_tracking@fbc-badstride:
    - {shard-rkl}:        [SKIP][138] ([i915#1849] / [i915#4098]) -> [PASS][139] +11 similar issues
   [138]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-4/igt@kms_frontbuffer_tracking@fbc-badstride.html
   [139]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@kms_frontbuffer_tracking@fbc-badstride.html

  * igt@kms_properties@crtc-properties-atomic:
    - {shard-rkl}:        [SKIP][140] ([i915#1849]) -> [PASS][141]
   [140]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-4/igt@kms_properties@crtc-properties-atomic.html
   [141]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@kms_properties@crtc-properties-atomic.html

  * igt@kms_psr@psr2_sprite_mmap_gtt:
    - shard-iclb:         [SKIP][142] ([fdo#109441]) -> [PASS][143] +2 similar issues
   [142]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb6/igt@kms_psr@psr2_sprite_mmap_gtt.html
   [143]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_gtt.html

  * igt@kms_psr@sprite_plane_move:
    - {shard-rkl}:        [SKIP][144] ([i915#1072]) -> [PASS][145]
   [144]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-4/igt@kms_psr@sprite_plane_move.html
   [145]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-6/igt@kms_psr@sprite_plane_move.html

  * igt@kms_psr_stress_test@flip-primary-invalidate-overlay:
    - shard-tglb:         [SKIP][146] ([i915#5519]) -> [PASS][147]
   [146]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-tglb2/igt@kms_psr_stress_test@flip-primary-invalidate-overlay.html
   [147]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb2/igt@kms_psr_stress_test@flip-primary-invalidate-overlay.html

  * igt@kms_vblank@pipe-a-ts-continuation-suspend:
    - shard-apl:          [DMESG-WARN][148] ([i915#180]) -> [PASS][149]
   [148]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl6/igt@kms_vblank@pipe-a-ts-continuation-suspend.html
   [149]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl7/igt@kms_vblank@pipe-a-ts-continuation-suspend.html

  * igt@perf@gen12-mi-rpc:
    - {shard-rkl}:        [SKIP][150] ([fdo#109289]) -> [PASS][151]
   [150]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-rkl-5/igt@perf@gen12-mi-rpc.html
   [151]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-rkl-1/igt@perf@gen12-mi-rpc.html

  * igt@perf_pmu@render-node-busy@vcs0:
    - {shard-dg1}:        [FAIL][152] -> [PASS][153]
   [152]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-dg1-13/igt@perf_pmu@render-node-busy@vcs0.html
   [153]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-dg1-19/igt@perf_pmu@render-node-busy@vcs0.html

  
#### Warnings ####

  * igt@gem_pread@exhaustion:
    - shard-glk:          [INCOMPLETE][154] ([i915#7248]) -> [WARN][155] ([i915#2658]) +1 similar issue
   [154]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-glk3/igt@gem_pread@exhaustion.html
   [155]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-glk5/igt@gem_pread@exhaustion.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-apl:          [INCOMPLETE][156] ([i915#7248]) -> [WARN][157] ([i915#2658])
   [156]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl6/igt@gem_pwrite@basic-exhaustion.html
   [157]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl1/igt@gem_pwrite@basic-exhaustion.html
    - shard-tglb:         [INCOMPLETE][158] ([i915#7248]) -> [WARN][159] ([i915#2658])
   [158]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-tglb7/igt@gem_pwrite@basic-exhaustion.html
   [159]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-tglb1/igt@gem_pwrite@basic-exhaustion.html

  * igt@kms_psr2_sf@cursor-plane-move-continuous-sf:
    - shard-iclb:         [SKIP][160] ([i915#2920]) -> [SKIP][161] ([i915#658])
   [160]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-iclb2/igt@kms_psr2_sf@cursor-plane-move-continuous-sf.html
   [161]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-iclb3/igt@kms_psr2_sf@cursor-plane-move-continuous-sf.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][162], [FAIL][163], [FAIL][164], [FAIL][165]) ([fdo#109271] / [i915#3002] / [i915#4312]) -> ([FAIL][166], [FAIL][167]) ([i915#3002] / [i915#4312])
   [162]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl7/igt@runner@aborted.html
   [163]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl2/igt@runner@aborted.html
   [164]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl6/igt@runner@aborted.html
   [165]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12325/shard-apl6/igt@runner@aborted.html
   [166]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl2/igt@runner@aborted.html
   [167]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/shard-apl6/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109292]: https://bugs.freedesktop.org/show_bug.cgi?id=109292
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109314]: https://bugs.freedesktop.org/show_bug.cgi?id=109314
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
  [fdo#110725]: https://bugs.freedesktop.org/show_bug.cgi?id=110725
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
  [i915#2436]: https://gitlab.freedesktop.org/drm/intel/issues/2436
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#2681]: https://gitlab.freedesktop.org/drm/intel/issues/2681
  [i915#2684]: https://gitlab.freedesktop.org/drm/intel/issues/2684
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
  [i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
  [i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#404]: https://gitlab.freedesktop.org/drm/intel/issues/404
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
  [i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#433]: https://gitlab.freedesktop.org/drm/intel/issues/433
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4767]: https://gitlab.freedesktop.org/drm/intel/issues/4767
  [i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4855]: https://gitlab.freedesktop.org/drm/intel/issues/4855
  [i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
  [i915#4877]: https://gitlab.freedesktop.org/drm/intel/issues/4877
  [i915#4879]: https://gitlab.freedesktop.org/drm/intel/issues/4879
  [i915#4880]: https://gitlab.freedesktop.org/drm/intel/issues/4880
  [i915#4884]: https://gitlab.freedesktop.org/drm/intel/issues/4884
  [i915#4885]: https://gitlab.freedesktop.org/drm/intel/issues/4885
  [i915#4958]: https://gitlab.freedesktop.org/drm/intel/issues/4958
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#4998]: https://gitlab.freedesktop.org/drm/intel/issues/4998
  [i915#5099]: https://gitlab.freedesktop.org/drm/intel/issues/5099
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#5327]: https://gitlab.freedesktop.org/drm/intel/issues/5327
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5519]: https://gitlab.freedesktop.org/drm/intel/issues/5519
  [i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
  [i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
  [i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
  [i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
  [i915#6301]: https://gitlab.freedesktop.org/drm/intel/issues/6301
  [i915#6344]: https://gitlab.freedesktop.org/drm/intel/issues/6344
  [i915#6412]: https://gitlab.freedesktop.org/drm/intel/issues/6412
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
  [i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
  [i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
  [i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
  [i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
  [i915#7037]: https://gitlab.freedesktop.org/drm/intel/issues/7037
  [i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#7178]: https://gitlab.freedesktop.org/drm/intel/issues/7178
  [i915#7248]: https://gitlab.freedesktop.org/drm/intel/issues/7248
  [i915#7316]: https://gitlab.freedesktop.org/drm/intel/issues/7316
  [i915#768]: https://gitlab.freedesktop.org/drm/intel/issues/768
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7032 -> IGTPW_8018
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_12325: 1a90222aa5e5bb86ffcbde5ba9611659a23f0df6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8018: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html
  IGT_7032: 372c56225e12578a7a4a6bcc5b79eb40b643fcde @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8018/index.html

[-- Attachment #2: Type: text/html, Size: 51366 bytes --]

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

end of thread, other threads:[~2022-10-31 22:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 16:30 [igt-dev] [PATCH i-g-t v3 1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 2/3] tests/crc: s/"auto"/IGT_PIPE_CRC_SOURCE_AUTO/ Ville Syrjala
2022-10-19 16:30 ` [igt-dev] [PATCH i-g-t v3 3/3] lib/crc: Move pipe CRC stuff out from igt_debugfs Ville Syrjala
2022-10-20  8:18   ` Petri Latvala
2022-10-20  9:45   ` Kamil Konieczny
2022-10-20  9:52     ` Ville Syrjälä
2022-10-20 10:08       ` Petri Latvala
2022-10-19 17:32 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ Patchwork
2022-10-20 10:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev2) Patchwork
2022-10-20 10:20 ` [igt-dev] ✗ GitLab.Pipeline: warning " Patchwork
2022-10-31 19:23 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/3] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/ (rev3) Patchwork
2022-10-31 22:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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.