Skip to contentSkip to conversation

lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/

PATCH Superseded Ville Syrjala 2 participants 4 messages Oct 20, 2021

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/

From: Ville Syrjälä <[email protected]>

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

---
 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/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_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 ++-
 33 files changed, 55 insertions(+), 39 deletions(-)
lib/igt_debugfs.c +2 -2
index a5bb95ca32f7..5ead8aa55e03 100644
@@ -715,7 +715,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)
@@ -733,7 +733,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)
lib/igt_debugfs.h +1 -1
index d43ba6c6c7a3..cef456587641 100644
@@ -83,7 +83,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);
tests/amdgpu/amd_color.c +1 -1
index 6d313bae74b5..defe57bd4fb8 100644
@@ -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);
 
tests/amdgpu/amd_max_bpc.c +1 -1
index 4eb759ee219a..8d2520b23512 100644
@@ -126,7 +126,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);
 
tests/i915/gem_pxp.c +2 -1
index 5f269bab9041..0678476827fd 100644
@@ -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);
tests/i915/kms_big_fb.c +2 -2
index 8665903827d8..e7a7eb16d576 100644
@@ -453,7 +453,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);
@@ -510,7 +510,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_set_timeout(5, "Async pageflipping loop got stuck!\n");
tests/i915/kms_ccs.c +2 -1
index 716be5b6539b..0ae64378f517 100644
@@ -532,7 +532,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)) {
tests/i915/kms_draw_crc.c +1 -1
index 82c368e1dc39..7433b334c335 100644
@@ -274,7 +274,7 @@ static void setup_environment(void)
 
 	find_modeset_params();
 	pipe_crc = igt_pipe_crc_new(drm_fd, kmstest_get_crtc_idx(drm_res, ms.crtc_id),
-				    INTEL_PIPE_CRC_SOURCE_AUTO);
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 }
 
 static void teardown_environment(void)
tests/i915/kms_fbcon_fbt.c +1 -1
index 98c452c4f097..831ec867aefb 100644
@@ -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);
tests/i915/kms_flip_scaled_crc.c +1 -1
index 24ca12241be1..8fce41151ce0 100644
@@ -215,7 +215,7 @@ static enum subrval 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);
 
 	for (int i = 0; i < output->config.connector->count_modes; i++) {
 		if (output->config.connector->modes[i].hdisplay == data->attemptmodewidth &&
tests/i915/kms_flip_tiling.c +2 -1
index 913657993a21..4528459ce5bf 100644
@@ -57,7 +57,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);
 }
tests/i915/kms_frontbuffer_tracking.c +2 -1
index d6a884926c48..3805ebbaa625 100644
@@ -1223,7 +1223,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);
 	}
 
tests/i915/kms_mmap_write_crc.c +1 -1
index b17e5fdb6fb7..74b8942ed10e 100644
@@ -188,7 +188,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);
tests/i915/kms_pwrite_crc.c +1 -1
index 44fcfadbe6f5..2e33e5996e6d 100644
@@ -125,7 +125,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);
tests/kms_async_flips.c +1 -1
index 4ff7a196a725..95669c8655a4 100644
@@ -488,7 +488,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);
tests/kms_atomic.c +1 -1
index 1657624e93a8..c10fb2bcded8 100644
@@ -407,7 +407,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);
tests/kms_atomic_transition.c +2 -1
index 4be24f9e3091..a9f2be7bd9ae 100644
@@ -817,7 +817,8 @@ retry:
 		j += 1;
 
 		if (is_i915_device(data->drm_fd))
-			pipe_crcs[i] = igt_pipe_crc_new(data->drm_fd, i, INTEL_PIPE_CRC_SOURCE_AUTO);
+			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)
tests/kms_color.c +1 -1
index 775f35964f61..90e94f19e2db 100644
@@ -683,7 +683,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 
 		data->pipe_crc = igt_pipe_crc_new(data->drm_fd,
 						  primary->pipe->pipe,
-						  INTEL_PIPE_CRC_SOURCE_AUTO);
+						  IGT_PIPE_CRC_SOURCE_AUTO);
 
 		igt_display_require_output_on_pipe(&data->display, p);
 	}
tests/kms_cursor_crc.c +1 -1
index 513c97153e63..8bc767cde0b0 100644
@@ -493,7 +493,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
 	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;
tests/kms_cursor_edge_walk.c +1 -1
index cce562e0e7eb..29ff216767fd 100644
@@ -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);
tests/kms_cursor_legacy.c +4 -2
index 8136280701e6..c6402690c06f 100644
@@ -1281,7 +1281,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);
 
 	set_cursor_on_pipe(display, pipe, &cursor_fb);
 	igt_display_commit2(display, COMMIT_UNIVERSAL);
@@ -1341,7 +1342,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);
 
 	set_cursor_on_pipe(display, pipe, &cursor_fb);
 	igt_display_commit2(display, COMMIT_UNIVERSAL);
tests/kms_hdr.c +1 -1
index 273263db3672..70bcc855fed5 100644
@@ -165,7 +165,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);
 
tests/kms_multipipe_modeset.c +1 -1
index 6358d9306bc6..1fdfb9a9f7a2 100644
@@ -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);
tests/kms_pipe_crc_basic.c +5 -3
index 0861c46dbd9b..ebfa68d4c1be 100644
@@ -104,7 +104,8 @@ static void test_read_crc(data_t *data, enum pipe pipe, unsigned flags)
 		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);
 
@@ -119,7 +120,8 @@ static void test_read_crc(data_t *data, enum pipe pipe, unsigned flags)
 		} 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);
@@ -203,7 +205,7 @@ static void test_compare_crc(data_t *data, enum pipe pipe)
 	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. */
tests/kms_plane.c +2 -1
index 405d4c2180a6..0773cbb4e135 100644
@@ -74,7 +74,8 @@ static color_t blue  = { 0.0f, 0.0f, 1.0f };
  */
 static void test_init(data_t *data, enum pipe pipe)
 {
-	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);
 }
 
 static void test_fini(data_t *data)
tests/kms_plane_alpha_blend.c +2 -1
index 9e4ee22b43af..afbe0b1b1fd3 100644
@@ -162,7 +162,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;
tests/kms_plane_cursor.c +1 -1
index 9bda47466446..aeaf3e1e1e22 100644
@@ -77,7 +77,7 @@ static void test_init(data_t *data, enum pipe pipe_id)
 	data->cursor = igt_pipe_get_plane_type(data->pipe, DRM_PLANE_TYPE_CURSOR);
 
 	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe_id,
-					  INTEL_PIPE_CRC_SOURCE_AUTO);
+					  IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_set_pipe(data->output, data->pipe_id);
 
tests/kms_plane_lowres.c +1 -1
index 6c0fce86e56e..9bc860435f5c 100644
@@ -192,7 +192,7 @@ test_planes_on_pipe_with_output(data_t *data, igt_plane_t *plane, uint64_t modif
 	create_ref_fb(data, modifier, &mode_lowres, &data->ref_lowres.fb);
 
 	pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
-				    INTEL_PIPE_CRC_SOURCE_AUTO);
+				    IGT_PIPE_CRC_SOURCE_AUTO);
 
 	igt_output_override_mode(data->output, &mode_lowres);
 	igt_plane_set_fb(primary, &data->ref_lowres.fb);
tests/kms_plane_multiple.c +2 -1
index ece00097e87b..3833fc2cadf0 100644
@@ -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");
tests/kms_prime.c +2 -1
index 1ad4b3a638f5..4cd52c69f88b 100644
@@ -206,7 +206,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);
tests/kms_rotation_crc.c +3 -2
index ae477b6044a2..620fd58001a1 100644
@@ -208,7 +208,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);
@@ -710,7 +711,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++) {
tests/kms_universal_plane.c +2 -1
index 2e8958979dd6..0ad2f57485bf 100644
@@ -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);
 
tools/intel_display_crc.c +2 -1
index d1b28ea77371..61291fc2aa88 100644
@@ -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);
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/2 lib/crc: Move pipe CRC stuff out from igt_debugfs

From: Ville Syrjälä <[email protected]>

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@
@@
igt_pipe_crc_new(...)

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

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

---
 lib/igt.h                       |   1 +
 lib/igt_chamelium.h             |   1 +
 lib/igt_debugfs.c               | 558 -----------------------------
 lib/igt_debugfs.h               |  57 ---
 lib/igt_fb.h                    |   1 +
 lib/igt_pipe_crc.c              | 602 ++++++++++++++++++++++++++++++++
 lib/igt_pipe_crc.h              |  91 +++++
 lib/meson.build                 |   1 +
 tests/i915/kms_mmap_write_crc.c |   1 +
 tools/intel_display_crc.c       |   1 +
 10 files changed, 699 insertions(+), 615 deletions(-)
 create mode 100644 lib/igt_pipe_crc.c
 create mode 100644 lib/igt_pipe_crc.h
lib/igt.h +1 -0
index 0bf98aa5d767..014714b92950 100644
@@ -38,6 +38,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
lib/igt_chamelium.h +1 -0
index f40e848e4f67..af88fec914bd 100644
@@ -36,6 +36,7 @@
 
 struct igt_fb;
 struct edid;
+typedef struct _igt_crc igt_crc_t;
 
 struct chamelium;
 struct chamelium_port;
lib/igt_debugfs.c +0 -558

576 lines not on this page · raw message

lib/igt_debugfs.h +0 -57

63 lines not on this page · raw message

lib/igt_fb.h +1 -0
index c61d9e7219ff..265d1fc448e6 100644
@@ -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
lib/igt_pipe_crc.c new file +602 -0

602 lines not on this page · raw message

lib/igt_pipe_crc.h new file +91 -0

91 lines not on this page · raw message

lib/meson.build +1 -0
index c3080fc82c29..6c1cea14e508 100644
@@ -22,6 +22,7 @@ lib_sources = [
 	'igt_matrix.c',
 	'igt_params.c',
 	'igt_perf.c',
+	'igt_pipe_crc.c',
 	'igt_primes.c',
 	'igt_rand.c',
 	'igt_rapl.c',
tests/i915/kms_mmap_write_crc.c +1 -0
index 74b8942ed10e..1010d399f3bc 100644
@@ -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"
tools/intel_display_crc.c +1 -0
index 61291fc2aa88..357ffb8229f6 100644
@@ -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;
Signature · 1 line
2.32.0
#2 lore raw

[igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,1/2] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

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

== Summary ==

IGT patchset build failed on latest successful build 5e32858ad62342f9ae5207e0432bf6f4c896d165 intel-ci: Stop executing kms_bw

  igt_crc_t local_capture_crc;
            ^~~~~~~~~~~~~~~~~
../lib/igt_chamelium.c:1729:12: warning: unused variable ‘local_reference_crc’ [-Wunused-variable]
  igt_crc_t local_reference_crc;
            ^~~~~~~~~~~~~~~~~~~
In file included from ../lib/igt_chamelium.c:40:
../lib/igt_chamelium.c: In function ‘chamelium_assert_crc_eq_or_dump’:
../lib/igt_chamelium.c:1819:35: error: implicit declaration of function ‘igt_crc_to_string’; did you mean ‘g_quark_to_string’? [-Werror=implicit-function-declaration]
  igt_debug("Reference CRC: %s\n", igt_crc_to_string(reference_crc));
                                   ^~~~~~~~~~~~~~~~~
../lib/igt_core.h:1208:64: note: in definition of macro ‘igt_debug’
 #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f)
                                                                ^
../lib/igt_chamelium.c:1819:35: warning: nested extern declaration of ‘igt_crc_to_string’ [-Wnested-externs]
  igt_debug("Reference CRC: %s\n", igt_crc_to_string(reference_crc));
                                   ^~~~~~~~~~~~~~~~~
../lib/igt_core.h:1208:64: note: in definition of macro ‘igt_debug’
 #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f)
                                                                ^
../lib/igt_chamelium.c:1819:12: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
  igt_debug("Reference CRC: %s\n", igt_crc_to_string(reference_crc));
            ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_core.h:1208:64: note: in definition of macro ‘igt_debug’
 #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f)
                                                                ^
../lib/igt_chamelium.c:1820:12: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘int’ [-Wformat=]
  igt_debug("Captured CRC: %s\n", igt_crc_to_string(capture_crc));
            ^~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/igt_core.h:1208:64: note: in definition of macro ‘igt_debug’
 #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f)
                                                                ^
../lib/igt_chamelium.c:1822:7: error: implicit declaration of function ‘igt_check_crc_equal’; did you mean ‘igt_force_dsc_enable’? [-Werror=implicit-function-declaration]
  eq = igt_check_crc_equal(reference_crc, capture_crc);
       ^~~~~~~~~~~~~~~~~~~
       igt_force_dsc_enable
../lib/igt_chamelium.c:1822:7: warning: nested extern declaration of ‘igt_check_crc_equal’ [-Wnested-externs]
../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
   reference_crc = malloc(sizeof(igt_crc_t));
                                 ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
  igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
                                    ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
  fb_crc->ret = calloc(1, sizeof(igt_crc_t));
                                 ^~~~~~~~~

cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.

#3 lore raw

[igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/2] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/crc: s/INTEL_PIPE_CRC_SOURCE_AUTO/IGT_PIPE_CRC_SOURCE_AUTO/
URL : https://patchwork.freedesktop.org/series/96047/
State : warning

== Summary ==

Pipeline status: FAILED.

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

build:tests-debian-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941197):
../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}

     reference_crc = malloc(sizeof(igt_crc_t));
                                   ^~~~~~~~~
  ../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
  ../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
    igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
                                      ^~~~~~~~~
  ../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
  ../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
    fb_crc->ret = calloc(1, sizeof(igt_crc_t));
                                   ^~~~~~~~~

cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
section_end:1634722541:step_script
section_start:1634722541:cleanup_file_variables
Cleaning up file based variables
section_end:1634722548:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941192):
../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
1908 | reference_crc = malloc(sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2119 | igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2163 | fb_crc->ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
section_end:1634722546:step_script
section_start:1634722546:cleanup_file_variables
Cleaning up file based variables
section_end:1634722549:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-clang has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941196):

                 ^
  ../lib/igt_chamelium.c:2119:29: error: invalid application of 'sizeof' to an incomplete type 'igt_crc_t' (aka 'struct _igt_crc')
          igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
                                     ^     ~~~~~~~~~~~
  ../lib/igt_fb.h:44:16: note: forward declaration of 'struct _igt_crc'
  typedef struct _igt_crc igt_crc_t;
                 ^
  ../lib/igt_chamelium.c:2163:26: error: invalid application of 'sizeof' to an incomplete type 'igt_crc_t' (aka 'struct _igt_crc')
          fb_crc->ret = calloc(1, sizeof(igt_crc_t));
                                  ^     ~~~~~~~~~~~
  ../lib/igt_fb.h:44:16: note: forward declaration of 'struct _igt_crc'
  typedef struct _igt_crc igt_crc_t;
                 ^

4 warnings and 17 errors generated.
ninja: build stopped: subcommand failed.
section_end:1634722503:step_script
section_start:1634722503:cleanup_file_variables
Cleaning up file based variables
section_end:1634722505:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libdrm-nouveau has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941195):
../lib/igt_chamelium.c:1822:7: warning: nested extern declaration of ‘igt_check_crc_equal’ [-Wnested-externs] ../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
1908 | reference_crc = malloc(sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2119 | igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2163 | fb_crc->ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
section_end:1634722493:step_script
section_start:1634722493:cleanup_file_variables
Cleaning up file based variables
section_end:1634722495:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-no-libunwind has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941193):
../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
1908 | reference_crc = malloc(sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2119 | igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2163 | fb_crc->ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
section_end:1634722546:step_script
section_start:1634722546:cleanup_file_variables
Cleaning up file based variables
section_end:1634722549:cleanup_file_variables
ERROR: Job failed: exit code 1

build:tests-fedora-oldest-meson has failed (https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/-/jobs/14941194):
../lib/igt_chamelium.c: In function ‘chamelium_frame_match_or_dump’:
../lib/igt_chamelium.c:1908:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
1908 | reference_crc = malloc(sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc’:
../lib/igt_chamelium.c:2119:36: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2119 | igt_crc_t *ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
../lib/igt_chamelium.c: In function ‘chamelium_calculate_fb_crc_async_start’:
../lib/igt_chamelium.c:2163:33: error: invalid application of ‘sizeof’ to incomplete type ‘igt_crc_t’ {aka ‘struct _igt_crc’}
2163 | fb_crc->ret = calloc(1, sizeof(igt_crc_t));
| ^~~~~~~~~
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
section_end:1634722546:step_script
section_start:1634722546:cleanup_file_variables
Cleaning up file based variables
section_end:1634722549:cleanup_file_variables
ERROR: Job failed: exit code 1

== Logs ==

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