Skip to contentSkip to conversation

kms_plane: Remove redundant modeset after CRC capture

PATCH New Arkadiusz Hiler 2 participants 6 messages Feb 7, 2018 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 kms_plane: Remove redundant modeset after CRC capture

From: Imre Deak <[email protected]>

The null modeset after capturing the CRC is redundant; detaching the FB from the plane is enough for the next modeset to work properly. This speed things up especially on slow panels.

---
 tests/kms_plane.c | 1 -
 1 file changed, 1 deletion(-)
tests/kms_plane.c +0 -1
index 54bcffc1..07d5ffe7 100644
@@ -88,7 +88,6 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
 	igt_pipe_crc_collect_crc(data->pipe_crc, crc);
 
 	igt_plane_set_fb(primary, NULL);
-	igt_display_commit(&data->display);
 
 	igt_remove_fb(data->drm_fd, &fb);
 
Signature · 6 lines
2.14.3

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

PATCH 2/4 lib: Export helpers to get rotation/tiling strings

From: Imre Deak <[email protected]>

This is needed for the next patch for some debug prints.

---
 lib/igt_fb.c  | 23 +++++++++++++++++++++++
 lib/igt_fb.h  |  3 +++
 lib/igt_kms.c | 11 +++++++++--
 lib/igt_kms.h |  1 +
 4 files changed, 36 insertions(+), 2 deletions(-)
lib/igt_fb.c +23 -0
index 6fecdd66..0c006062 100644
@@ -1683,6 +1683,29 @@ const char *igt_format_str(uint32_t drm_format)
 	return f ? f->name : "invalid";
 }
 
+/**
+ * igt_tiling_str:
+ * @tiling: tiling ID
+ *
+ * Returns:
+ * Human-readable tiling string for @tiling.
+ */
+const char *igt_tiling_str(uint64_t tiling)
+{
+	switch (tiling) {
+	case LOCAL_DRM_FORMAT_MOD_NONE:
+		return "linear";
+	case LOCAL_I915_FORMAT_MOD_X_TILED:
+		return "X-tiled";
+	case LOCAL_I915_FORMAT_MOD_Y_TILED:
+		return "Y-tiled";
+	case LOCAL_I915_FORMAT_MOD_Yf_TILED:
+		return "Yf-tiled";
+	default:
+		return "N/A";
+	}
+}
+
 /**
  * igt_get_all_cairo_formats:
  * @formats: pointer to pointer to store the allocated formats array
lib/igt_fb.h +3 -0
index 77fd88bb..6e7a773a 100644
@@ -162,6 +162,9 @@ int igt_cairo_printf_line(cairo_t *cr, enum igt_text_align align,
 uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth);
 uint32_t igt_drm_format_to_bpp(uint32_t drm_format);
 const char *igt_format_str(uint32_t drm_format);
+
+const char *igt_tiling_str(uint64_t tiling);
+
 void igt_get_all_cairo_formats(const uint32_t **formats, int *format_count);
 
 #endif /* __IGT_FB_H__ */
lib/igt_kms.c +9 -2
index eb57f4a9..f8acdfc8 100644
@@ -3435,7 +3435,14 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H, IGT_FIXED(h, 0));
 }
 
-static const char *rotation_name(igt_rotation_t rotation)
+/**
+ * igt_rotation_degrees_str:
+ * @rotation: rotation degrees/reflect mask
+ *
+ * Returns:
+ * Human-readable string for the rotation degrees part in @rotation.
+ */
+const char *igt_rotation_degrees_str(igt_rotation_t rotation)
 {
 	switch (rotation & IGT_ROTATION_MASK) {
 	case IGT_ROTATION_0:
@@ -3458,7 +3465,7 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
 
 	LOG(display, "%s.%d: plane_set_rotation(%s)\n",
 	    kmstest_pipe_name(pipe->pipe),
-	    plane->index, rotation_name(rotation));
+	    plane->index, igt_rotation_degrees_str(rotation));
 
 	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, rotation);
 }
lib/igt_kms.h +1 -0
index b7521039..c5b2feb7 100644
@@ -387,6 +387,7 @@ void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd);
 void igt_plane_set_position(igt_plane_t *plane, int x, int y);
 void igt_plane_set_size(igt_plane_t *plane, int w, int h);
 void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);
+const char *igt_rotation_degrees_str(igt_rotation_t rotation);
 void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
 	uint32_t x, uint32_t y);
 void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
Signature · 6 lines
2.14.3

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#2 lore raw

PATCH 3/4 kms_plane: Split helpers creating reference FB and capturing CRC

In reply to Arkadiusz Hiler

From: Imre Deak <[email protected]>

Split creating a reference FB and capturing the CRC for it into separate functions, so in a follow-up patch we can reuse the CRC capture function for a reference FB created in a different way.

---
 tests/kms_plane.c | 50 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 18 deletions(-)
tests/kms_plane.c +32 -18
index 07d5ffe7..7af84d61 100644
@@ -61,11 +61,9 @@ static void test_fini(data_t *data)
 }
 
 static void
-test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
-	      color_t *fb_color, igt_crc_t *crc /* out */)
+test_grab_crc_for_fb(data_t *data, igt_output_t *output, enum pipe pipe,
+		     igt_fb_t *fb, igt_crc_t *crc /* out */)
 {
-	struct igt_fb fb;
-	drmModeModeInfo *mode;
 	igt_plane_t *primary;
 	char *crc_str;
 	int ret;
@@ -74,13 +72,7 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 	primary = igt_output_get_plane(output, 0);
 
-	mode = igt_output_get_mode(output);
-	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    LOCAL_DRM_FORMAT_MOD_NONE,
-			    fb_color->red, fb_color->green, fb_color->blue,
-			    &fb);
-	igt_plane_set_fb(primary, &fb);
+	igt_plane_set_fb(primary, fb);
 
 	ret = igt_display_try_commit2(&data->display, COMMIT_LEGACY);
 	igt_skip_on(ret != 0);
@@ -89,14 +81,24 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 	igt_plane_set_fb(primary, NULL);
 
-	igt_remove_fb(data->drm_fd, &fb);
-
 	crc_str = igt_crc_to_string(crc);
-	igt_debug("CRC for a (%.02f,%.02f,%.02f) fb: %s\n", fb_color->red,
-		  fb_color->green, fb_color->blue, crc_str);
+	igt_debug("CRC for fb: %s\n", crc_str);
 	free(crc_str);
 }
 
+static void
+test_create_fb_for_output(data_t *data, igt_output_t *output, color_t *fb_color,
+			  igt_fb_t *fb)
+{
+	drmModeModeInfo *mode = igt_output_get_mode(output);
+
+	igt_create_color_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+			    DRM_FORMAT_XRGB8888,
+			    LOCAL_DRM_FORMAT_MOD_NONE,
+			    fb_color->red, fb_color->green, fb_color->blue,
+			    fb);
+}
+
 /*
  * Plane position test.
  *   - We start by grabbing a reference CRC of a full green fb being scanned
@@ -222,11 +224,15 @@ test_plane_position(data_t *data, enum pipe pipe, unsigned int flags)
 
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		igt_fb_t reference_fb;
 		igt_crc_t reference_crc;
 
 		test_init(data, pipe);
 
-		test_grab_crc(data, output, pipe, &green, &reference_crc);
+		test_create_fb_for_output(data, output, &green, &reference_fb);
+		test_grab_crc_for_fb(data, output, pipe, &reference_fb,
+				     &reference_crc);
+		igt_remove_fb(data->drm_fd, &reference_fb);
 
 		for (int plane = 1; plane < n_planes; plane++)
 			test_plane_position_with_output(data, pipe, plane,
@@ -343,13 +349,21 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags)
 
 	for_each_valid_output_on_pipe(&data->display, pipe, output) {
 		int n_planes = data->display.pipes[pipe].n_planes;
+		igt_fb_t red_fb;
+		igt_fb_t blue_fb;
 		igt_crc_t red_crc;
 		igt_crc_t blue_crc;
 
 		test_init(data, pipe);
 
-		test_grab_crc(data, output, pipe, &red, &red_crc);
-		test_grab_crc(data, output, pipe, &blue, &blue_crc);
+		test_create_fb_for_output(data, output, &red, &red_fb);
+		test_create_fb_for_output(data, output, &blue, &blue_fb);
+
+		test_grab_crc_for_fb(data, output, pipe, &red_fb, &red_crc);
+		test_grab_crc_for_fb(data, output, pipe, &blue_fb, &blue_crc);
+
+		igt_remove_fb(data->drm_fd, &blue_fb);
+		igt_remove_fb(data->drm_fd, &red_fb);
 
 		for (int plane = 1; plane < n_planes; plane++)
 			test_plane_panning_with_output(data, pipe, plane,
Signature · 6 lines
2.14.3

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#3 lore raw

PATCH 4/4 kms_plane: Add clipping subtests

In reply to Arkadiusz Hiler

From: Imre Deak <[email protected]>

Add plane clipping subtests displaying a single clipped plane, with the following test cases:
a) plane covering the whole screen, so that clipping is done at all 4 screen edges
b) plane at either of the 4 corners of the screen clipped, so that a 4x4 pixel part of the plane is visible
c) plane at either of the 4 corners of the screen clipped, so that a 2x2 pixel part of the plane is visible

Each of the above cases are tested with all supported planes, tiling modes, rotation degrees and differing pixel format sizes (only 16 bpp and 32 bpp for now). While the a) and b) cases above are supported on all platforms c) is not fully supported on GLK and CNL (which was the primary motivation for this testcase).

Cc Mika Kahola <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Juha-Pekka Heikkilä <[email protected]>
---
 tests/kms_plane.c | 441 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 441 insertions(+)
tests/kms_plane.c +441 -0
index 7af84d61..4e181db1 100644
@@ -41,11 +41,34 @@ typedef struct {
 	int drm_fd;
 	igt_display_t display;
 	igt_pipe_crc_t *pipe_crc;
+	uint32_t devid;
+	uint64_t max_curw;
+	uint64_t max_curh;
 } data_t;
 
 static color_t red   = { 1.0f, 0.0f, 0.0f };
 static color_t green = { 0.0f, 1.0f, 0.0f };
+static color_t yellow = { 1.0f, 1.0f, 0.0f };
 static color_t blue  = { 0.0f, 0.0f, 1.0f };
+static color_t white = { 1.0f, 1.0f, 1.0f };
+
+
+/*
+ * Size of a square plane used to test clipping at the 4 courners of the
+ * display.
+ */
+#define CLIPPED_PLANE_SMALL_SIZE	64
+
+/*
+ * Visible plane size after clipping that works on all platforms for all plane
+ * positions.
+ * The exceptions are GLK/CNL where there must be at least this many pixels
+ * visible from the plane after it's clipped to the left/right edge of the
+ * screen. Not meeting this condition may trigger FIFO underflows and screen
+ * corruption. The cursor plane is an exception that doesn't have this problem
+ * even on GLK/CNL.
+ */
+#define CLIPPED_PLANE_MIN_VALID		4
 
 /*
  * Common code across all tests, acting on data_t
@@ -142,6 +165,111 @@ create_fb_for_mode__position(data_t *data, drmModeModeInfo *mode,
 	igt_put_cairo_ctx(data->drm_fd, fb, cr);
 }
 
+/*
+ * Create a square FB for the plane in the clipping test, divided into 4
+ * quarters solid filled with different colors. Use the given tiling, format
+ * and size and rotate the FB clockwise with the given rotation degrees, so
+ * that the counterclockwise rotation with the same degrees done by the HW
+ * will always result in the same reference FB image.
+ */
+static void
+create_fb_for_mode__clipping_plane(data_t *data, igt_rotation_t rotation,
+				   uint64_t tiling,
+				   uint32_t format,
+				   int size,
+				   struct igt_fb *fb /* out */)
+{
+	color_t corners[] = { red, white, yellow, blue };
+	color_t color;
+	unsigned int fb_id;
+	cairo_t *cr;
+	const int qsize = size / 2;
+	int idx;
+
+	fb_id = igt_create_fb(data->drm_fd, size, size, format, tiling, fb);
+	igt_assert(fb_id);
+
+	cr = igt_get_cairo_ctx(data->drm_fd, fb);
+
+	switch (rotation) {
+	case IGT_ROTATION_0:
+		idx = 0;
+		break;
+	case IGT_ROTATION_90:
+		idx = 3;
+		break;
+	case IGT_ROTATION_180:
+		idx = 2;
+		break;
+	case IGT_ROTATION_270:
+		idx = 1;
+		break;
+	default:
+		igt_assert(0);
+	}
+
+	color = corners[idx];
+	igt_paint_color(cr, 0, 0, qsize, qsize,
+			color.red, color.green, color.blue);
+
+	color = corners[(++idx) % 4];
+	igt_paint_color(cr, qsize, 0, qsize, qsize,
+			color.red, color.green, color.blue);
+
+	color = corners[(++idx) % 4];
+	igt_paint_color(cr, qsize, qsize, qsize, qsize,
+			color.red, color.green, color.blue);
+
+	color = corners[(++idx) % 4];
+	igt_paint_color(cr, 0, qsize, qsize, qsize,
+			color.red, color.green, color.blue);
+
+	igt_assert(cairo_status(cr) == 0);
+	cairo_destroy(cr);
+}
+
+/*
+ * Create a square reference FB for the whole screen in the clipping test,
+ * with the given test plane position and size. See
+ * create_fb_for_mode__clipping_plane() for the layout of the test plane.
+ */
+static void
+create_fb_for_mode__clipping_display(data_t *data, drmModeModeInfo *mode,
+				     int plane_x, int plane_y,
+				     int plane_size,
+				     struct igt_fb *fb /* out */)
+{
+	struct igt_fb plane_fb;
+	unsigned int fb_id;
+	cairo_t *cr;
+	cairo_surface_t *src;
+
+	fb_id = igt_create_fb(data->drm_fd,
+				  mode->hdisplay, mode->vdisplay,
+				  DRM_FORMAT_XRGB8888,
+				  LOCAL_DRM_FORMAT_MOD_NONE,
+				  fb);
+	igt_assert(fb_id);
+
+	create_fb_for_mode__clipping_plane(data, IGT_ROTATION_0,
+					   LOCAL_DRM_FORMAT_MOD_NONE,
+					   DRM_FORMAT_XRGB8888,
+					   plane_size, &plane_fb);
+
+	src = igt_get_cairo_surface(data->drm_fd, &plane_fb);
+
+	cr = igt_get_cairo_ctx(data->drm_fd, fb);
+	igt_paint_color(cr, 0, 0, mode->hdisplay, mode->vdisplay,
+			0, 0, 0);
+
+	cairo_set_source_surface(cr, src, plane_x, plane_y);
+	cairo_rectangle(cr, plane_x, plane_y,
+			plane_size, plane_size);
+	cairo_fill(cr);
+	igt_assert(cairo_status(cr) == 0);
+	cairo_destroy(cr);
+}
+
 enum {
 	TEST_POSITION_FULLY_COVERED = 1 << 0,
 	TEST_DPMS = 1 << 1,
@@ -477,6 +605,303 @@ test_pixel_formats(data_t *data, enum pipe pipe)
 	}
 }
 
+static bool
+bogus_plane_conf(uint32_t devid, igt_plane_t *plane_obj,
+		 int hdisplay, int plane_x, int plane_width)
+{
+	if (!(IS_GEMINILAKE(devid) || IS_CANNONLAKE(devid)))
+		return false;
+
+	if (plane_obj->type == DRM_PLANE_TYPE_CURSOR)
+		return false;
+
+	if (plane_x + plane_width >= CLIPPED_PLANE_MIN_VALID &&
+	    plane_x <= hdisplay - CLIPPED_PLANE_MIN_VALID)
+		return false;
+
+	return true;
+}
+
+static bool
+supported_plane_conf(data_t *data, int plane_type, uint64_t tiling,
+		     uint32_t format, igt_rotation_t rotation,
+		     drmModeModeInfo *mode,
+		     int plane_x, int plane_y, int plane_size)
+{
+	if (intel_gen(data->devid) < 9 &&
+	    tiling != LOCAL_DRM_FORMAT_MOD_NONE)
+		return false;
+
+	/* On GEN<9 the primary plane must cover the full screen. */
+	if (intel_gen(data->devid) < 9 &&
+	    plane_type == DRM_PLANE_TYPE_PRIMARY &&
+	    (plane_x > 0 || plane_y > 0 ||
+	     (plane_x + plane_size < mode->hdisplay) ||
+	     (plane_y + plane_size < mode->vdisplay)))
+		return false;
+
+	if (plane_type == DRM_PLANE_TYPE_CURSOR) {
+		/* For cursor planes only linear/alpha format is supported. */
+		if (tiling != LOCAL_DRM_FORMAT_MOD_NONE ||
+		    format != DRM_FORMAT_ARGB8888)
+			return false;
+
+		if (plane_size > data->max_curw || plane_size > data->max_curh)
+			return false;
+	} else {
+		/*
+		 * For non-cursor planes formats with alpha may result in
+		 * undeterministic CRCs, we use the same sized
+		 * non-alpha XRGB8888 format instead.
+		 */
+		if (format == DRM_FORMAT_ARGB8888)
+			return false;
+
+		if (format == DRM_FORMAT_RGB565 &&
+		    intel_gen(data->devid) < 9 &&
+		    !IS_VALLEYVIEW(data->devid) && !IS_CHERRYVIEW(data->devid))
+			return false;
+	}
+
+	/* RGB565 with rotation is not supported for now. */
+	if (format == DRM_FORMAT_RGB565 && rotation != IGT_ROTATION_0)
+		return false;
+
+	return true;
+}
+
+static void
+test_plane_clipping_format(data_t *data,
+			    enum pipe pipe,
+			    int plane,
+			    igt_output_t *output,
+			    drmModeModeInfo *mode,
+			    int plane_x, int plane_y,
+			    int plane_size,
+			    uint64_t tiling,
+			    igt_rotation_t rotation,
+			    uint32_t format,
+			    igt_crc_t *reference_crc)
+{
+	igt_plane_t *plane_obj;
+	struct igt_fb reference_fb;
+	igt_crc_t crc;
+	int ret;
+
+	igt_debug("  plane %d rotation %s tiling %s format %s\n",
+		  plane,
+		  igt_rotation_degrees_str(rotation),
+		  igt_tiling_str(tiling),
+		  igt_format_str(format));
+
+	igt_output_set_pipe(output, pipe);
+	plane_obj = igt_output_get_plane(output, plane);
+
+	if (!supported_plane_conf(data, plane_obj->type,
+				  tiling, format, rotation,
+				  mode,
+				  plane_x, plane_y,
+				  plane_size))
+		return;
+
+	igt_output_set_pipe(output, pipe);
+
+	create_fb_for_mode__clipping_plane(data, rotation, tiling, format,
+					   plane_size, &reference_fb);
+
+	igt_plane_set_fb(plane_obj, &reference_fb);
+	igt_fb_set_position(&reference_fb, plane_obj, 0, 0);
+
+	igt_plane_set_size(plane_obj, plane_size, plane_size);
+	igt_plane_set_rotation(plane_obj, rotation);
+	igt_plane_set_position(plane_obj, plane_x, plane_y);
+
+	ret = igt_display_try_commit2(&data->display, COMMIT_UNIVERSAL);
+
+	if (!bogus_plane_conf(data->devid, plane_obj, mode->hdisplay,
+			      plane_x, plane_size)) {
+		igt_assert(ret == 0);
+		igt_pipe_crc_collect_crc(data->pipe_crc, &crc);
+		igt_assert_crc_equal(reference_crc, &crc);
+	} else {
+		igt_assert(ret == -EINVAL);
+	}
+
+	igt_plane_set_fb(plane_obj, NULL);
+	igt_plane_set_rotation(plane_obj, IGT_ROTATION_0);
+	igt_plane_set_position(plane_obj, 0, 0);
+
+	igt_output_set_pipe(output, PIPE_ANY);
+
+	igt_remove_fb(data->drm_fd, &reference_fb);
+}
+
+static void
+test_plane_clipping_square(data_t *data, enum pipe pipe,
+			   igt_output_t *output, drmModeModeInfo *mode,
+			   int plane_x, int plane_y, int plane_size)
+{
+	const struct {
+		uint64_t tiling;
+		igt_rotation_t rotation;
+	} rotations[] = {
+		{ LOCAL_DRM_FORMAT_MOD_NONE,		IGT_ROTATION_0 },
+
+		{ LOCAL_I915_FORMAT_MOD_X_TILED,	IGT_ROTATION_0 },
+
+		{ LOCAL_I915_FORMAT_MOD_Y_TILED,	IGT_ROTATION_0 },
+		{ LOCAL_I915_FORMAT_MOD_Y_TILED,	IGT_ROTATION_90 },
+		{ LOCAL_I915_FORMAT_MOD_Y_TILED,	IGT_ROTATION_180 },
+		{ LOCAL_I915_FORMAT_MOD_Y_TILED,	IGT_ROTATION_270 },
+
+		{ LOCAL_I915_FORMAT_MOD_Yf_TILED,	IGT_ROTATION_0 },
+		{ LOCAL_I915_FORMAT_MOD_Yf_TILED,	IGT_ROTATION_90 },
+		{ LOCAL_I915_FORMAT_MOD_Yf_TILED,	IGT_ROTATION_180 },
+		{ LOCAL_I915_FORMAT_MOD_Yf_TILED,	IGT_ROTATION_270 },
+	};
+	const uint32_t formats[] = {
+		DRM_FORMAT_RGB565,
+		DRM_FORMAT_XRGB8888,
+		DRM_FORMAT_ARGB8888,
+	};
+	int n_planes = data->display.pipes[pipe].n_planes;
+	igt_fb_t reference_fb;
+	igt_crc_t reference_crc;
+
+	igt_info("Testing connector %s mode %dx%d using pipe %s: %d,%d@%d,%d\n",
+		 igt_output_name(output),
+		 mode->hdisplay, mode->vdisplay,
+		 kmstest_pipe_name(pipe),
+		 plane_size, plane_size,
+		 plane_x, plane_y);
+
+	test_init(data, pipe);
+
+	create_fb_for_mode__clipping_display(data, mode,
+					     plane_x, plane_y,
+					     plane_size,
+					     &reference_fb);
+
+	test_grab_crc_for_fb(data, output, pipe, &reference_fb,
+			     &reference_crc);
+
+	igt_remove_fb(data->drm_fd, &reference_fb);
+
+	for (int plane = 0; plane < n_planes; plane++)
+		for (int rotation = 0; rotation < ARRAY_SIZE(rotations);
+		     rotation++)
+			for (int format = 0; format < ARRAY_SIZE(formats);
+			     format++)
+				test_plane_clipping_format(data, pipe, plane,
+							    output,
+							    mode,
+							    plane_x, plane_y,
+							    plane_size,
+							    rotations[rotation].tiling,
+							    rotations[rotation].rotation,
+							    formats[format],
+							    &reference_crc);
+
+	test_fini(data);
+}
+
+static void
+test_plane_clipping(data_t *data, enum pipe pipe)
+{
+	igt_output_t *output;
+	int connected_outs = 0;
+
+	for_each_valid_output_on_pipe(&data->display, pipe, output) {
+		drmModeModeInfo *mode;
+		int sq_size;
+
+		igt_output_set_pipe(output, pipe);
+		mode = igt_output_get_mode(output);
+
+		/*
+		 * Test with a square plane bigger than either the width or
+		 * height of the mode. This should pass on all platforms.
+		 */
+		sq_size = mode->hdisplay > mode->vdisplay ?
+			  mode->hdisplay : mode->vdisplay;
+		test_plane_clipping_square(data, pipe, output, mode,
+					   -2,
+					   -2,
+					   sq_size + 4);
+
+		/*
+		 * Test positions in the 4 corners of the screen with a
+		 * CLIPPED_PLANE_MIN_VALID x CLIPPED_PLANE_MIN_VALID square
+		 * visible from the plane. These should pass on all platforms.
+		 */
+		test_plane_clipping_square(data, pipe, output, mode,
+					   -CLIPPED_PLANE_SMALL_SIZE +
+					    CLIPPED_PLANE_MIN_VALID,
+					   -CLIPPED_PLANE_SMALL_SIZE +
+					    CLIPPED_PLANE_MIN_VALID,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   -CLIPPED_PLANE_SMALL_SIZE +
+					    CLIPPED_PLANE_MIN_VALID,
+					   mode->vdisplay -
+					    CLIPPED_PLANE_MIN_VALID,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   mode->hdisplay -
+					    CLIPPED_PLANE_MIN_VALID,
+					   -CLIPPED_PLANE_SMALL_SIZE +
+					    CLIPPED_PLANE_MIN_VALID,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   mode->hdisplay -
+					    CLIPPED_PLANE_MIN_VALID,
+					   mode->vdisplay -
+					    CLIPPED_PLANE_MIN_VALID,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		/*
+		 * Test positions in the 4 corners of the screen with a
+		 * 2 x 2 square visible from the plane. These are valid on all
+		 * platforms except on GLK/CNL where less than
+		 * CLIPPED_PLANE_MIN_VALID pixels visible on the left/right
+		 * edges of the screen may cause FIFO underflow and display
+		 * corruption.
+		 *
+		 * The cursor plane is an exception without this problem.
+		 *
+		 * Use 2 x 2 size as other (odd) sizes may result in an
+		 * incorrect CRC for the cursor plane even though it displays
+		 * correctly and causes no underflow.
+		 */
+		test_plane_clipping_square(data, pipe, output, mode,
+					   -CLIPPED_PLANE_SMALL_SIZE + 2,
+					   -CLIPPED_PLANE_SMALL_SIZE + 2,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   -CLIPPED_PLANE_SMALL_SIZE + 2,
+					   mode->vdisplay - 2,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   mode->hdisplay - 2,
+					   -CLIPPED_PLANE_SMALL_SIZE + 2,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		test_plane_clipping_square(data, pipe, output, mode,
+					   mode->hdisplay - 2,
+					   mode->vdisplay - 2,
+					   CLIPPED_PLANE_SMALL_SIZE);
+
+		connected_outs++;
+	}
+
+	igt_skip_on(connected_outs == 0);
+}
+
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
@@ -513,6 +938,9 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 		      kmstest_pipe_name(pipe))
 		test_plane_panning(data, pipe, TEST_PANNING_BOTTOM_RIGHT |
 					       TEST_SUSPEND_RESUME);
+	igt_subtest_f("plane-clipping-pipe-%s-planes",
+		      kmstest_pipe_name(pipe))
+		test_plane_clipping(data, pipe);
 }
 
 
@@ -525,8 +953,21 @@ igt_main
 	igt_skip_on_simulation();
 
 	igt_fixture {
+		int ret;
+
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 
+		data.devid = intel_get_drm_devid(data.drm_fd);
+
+		data.max_curw = 64;
+		data.max_curh = 64;
+		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH,
+				&data.max_curw);
+		igt_assert(ret == 0 || errno == EINVAL);
+		ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_HEIGHT,
+				&data.max_curh);
+		igt_assert(ret == 0 || errno == EINVAL);
+
 		kmstest_set_vt_graphics_mode();
 
 		igt_require_pipe_crc(data.drm_fd);
Signature · 6 lines
2.14.3

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#4 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] kms_plane: Remove redundant modeset after CRC capture

In reply to Arkadiusz Hiler
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/4] kms_plane: Remove redundant modeset after CRC capture
URL : https://patchwork.freedesktop.org/series/37817/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 2baf7ece5b6d2faccedc56527ec91623f41a85e4 lib: Move __gem_context_create to common ioctl wrapper library.

with latest DRM-Tip kernel build CI_DRM_3735
94ca1ebb0652 drm-tip: 2018y-02m-07d-13h-38m-30s UTC integration manifest

Testlist changes:
+igt@kms_plane@plane-clipping-pipe-a-planes
+igt@kms_plane@plane-clipping-pipe-b-planes
+igt@kms_plane@plane-clipping-pipe-c-planes
+igt@kms_plane@plane-clipping-pipe-d-planes
+igt@kms_plane@plane-clipping-pipe-e-planes
+igt@kms_plane@plane-clipping-pipe-f-planes

Test gem_mmap_gtt:

        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:419s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:425s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:384s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:500s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:484s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:472s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:577s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:419s
fi-gdg-551       total:288  pass:180  dwarn:0   dfail:0   fail:0   skip:108 time:285s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:390s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:415s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:459s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:500s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:450s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:606s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:428s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:486s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:484s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:417s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:432s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:527s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:399s

Blacklisted hosts:
fi-glk-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:477s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_885/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#5 lore raw

[igt-dev] ✗ Fi.CI.IGT: warning for series starting with [i-g-t,1/4] kms_plane: Remove redundant modeset after CRC capture

In reply to Arkadiusz Hiler
== Series Details ==

== Series Details ==

Series: series starting with [i-g-t,1/4] kms_plane: Remove redundant modeset after CRC capture
URL : https://patchwork.freedesktop.org/series/37817/
State : warning

== Summary ==

Test perf:

        Subgroup buffer-fill:
                fail       -> PASS       (shard-apl) fdo#103755
        Subgroup enable-disable:
                fail       -> PASS       (shard-apl) fdo#103715
Test kms_flip:
        Subgroup 2x-flip-vs-expired-vblank:
                fail       -> PASS       (shard-hsw) fdo#102887
        Subgroup modeset-vs-vblank-race-interruptible:
                fail       -> PASS       (shard-hsw) fdo#103060
        Subgroup 2x-flip-vs-dpms-off-vs-modeset:
                pass       -> DMESG-WARN (shard-hsw)
        Subgroup flip-vs-blocking-wf-vblank:
                fail       -> PASS       (shard-apl) fdo#100368 +1
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-indfb-draw-blt:
                pass       -> FAIL       (shard-apl) fdo#101623 +2
Test kms_cursor_crc:
        Subgroup cursor-128x128-suspend:
                skip       -> PASS       (shard-snb) fdo#103880
Test kms_plane:
        Subgroup plane-position-covered-pipe-a-planes:
                pass       -> SKIP       (shard-snb)
Test gem_eio:
        Subgroup in-flight:
                dmesg-warn -> PASS       (shard-snb) fdo#104058
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047

fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:3410 pass:1759 dwarn:2   dfail:0   fail:23  skip:1624 time:12594s
shard-hsw        total:3448 pass:1757 dwarn:2   dfail:0   fail:14  skip:1674 time:11544s
shard-snb        total:3448 pass:1352 dwarn:1   dfail:0   fail:10  skip:2085 time:6662s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_885/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev