Skip to contentSkip to conversation

kms plane scaling tests.

PATCH In review Maarten Lankhorst 3 participants 17 messages Jan 12, 2018 – Jan 15, 2018 Library code

lore
Share & tools
lore
#0 lore raw

v2 cover kms plane scaling tests.

This series fixes the current scaler igt test failures and enhances kms_plane_scaling and kms_plane for covering subtests below:
- verify all the supported pixel formats in planes
- combination of rotation and scaling
- combination of tiling and scaling
- multi-plane/multi-pipe scaling

I've cleaned up the previous series sent out by Vidya Srinivas, and split out some patches for clarity.

Jyoti Yadav (3):
tests/kms_plane_scaling: test scaling with tiling rotation and pixel
formats, v2.
tests/kms_plane_scaling: test scaler with clipping clamping, v2. tests/kms_plane_scaling: test for multi pipe with scaling

Maarten Lankhorst (4):
tests/kms_plane_scaling: Move the actual test to its own function. tests/kms_plane_scaling: Convert from simple test to full test tests/kms_plane_scaling: Clean up tests to work better with igt_kms. lib/igt_kms: Add more braces around macros

Mahesh Kumar (2):
tests/kms_plane: Run test for all supported pixel formats, v2. tests/kms_plane_scaling: Fix basic scaling test, v2.

 lib/igt_kms.h             |  16 +-
 tests/kms_plane.c         | 103 ++++++++
 tests/kms_plane_scaling.c | 645 ++++++++++++++++++++++++++++++++--------------
 3 files changed, 568 insertions(+), 196 deletions(-)
Signature · 6 lines
2.15.1

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

PATCH v2 1/9 tests/kms_plane: Run test for all supported pixel formats, v2.

From: Mahesh Kumar <[email protected]>

This patch adds a subtest related to pixel format testing. The test tries to create framebuffer with all supported pixel formats on every plane, and tries to draw them using cairo and commits the same on display.

Changes since v1:
- Make the test more generic and try on all planes, including legacy cursor.

---
 tests/kms_plane.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)
tests/kms_plane.c +103 -0
index 92bf67f1018c..9672763fe619 100644
@@ -368,6 +368,105 @@ test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags)
 	igt_skip_on(connected_outs == 0);
 }
 
+static bool can_draw(uint32_t drm_format)
+{
+	const uint32_t *drm_formats;
+	int format_count, i;
+
+	igt_get_all_cairo_formats(&drm_formats, &format_count);
+
+	for (i = 0; i < format_count; i++)
+		if (drm_formats[i] == drm_format)
+			return true;
+
+	return false;
+}
+
+static void test_format_plane(data_t *data, enum pipe pipe,
+			      igt_output_t *output, igt_plane_t *plane)
+{
+	igt_plane_t *primary;
+	struct igt_fb primary_fb, fb;
+	drmModeModeInfo *mode;
+	cairo_t *cr;
+	int i;
+	uint32_t format;
+	uint64_t width, height;
+
+	mode = igt_output_get_mode(output);
+	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
+		width = mode->hdisplay;
+		height = mode->vdisplay;
+	} else {
+		if (!plane->drm_plane) {
+			igt_debug("Only legacy cursor ioctl supported, skipping cursor plane\n");
+			return;
+		}
+		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_WIDTH, &width));
+		do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height));
+	}
+
+	igt_debug("Testing connector %s on %s plane %s.%u\n",
+		  igt_output_name(output), kmstest_plane_type_name(plane->type),
+		  kmstest_pipe_name(pipe), plane->index);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &primary_fb);
+
+	igt_output_set_pipe(output, pipe);
+	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
+	igt_plane_set_fb(primary, &primary_fb);
+
+	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
+
+	for (i = 0; i < plane->drm_plane->count_formats; i++) {
+		format = plane->drm_plane->formats[i];
+
+		if (!can_draw(format))
+			continue;
+
+		igt_debug("Testing format 0x%x on %s.%u\n",
+			  format, kmstest_pipe_name(pipe), plane->index);
+
+		igt_create_fb(data->drm_fd, width, height,
+			      format, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
+
+		cr = igt_get_cairo_ctx(data->drm_fd, &fb);
+		igt_paint_color(cr, 0, 0, width, height,
+				0.0, 1.0, 0.0);
+		if (width >= 164 && height >= 164)
+			igt_paint_color(cr, 100, 100, 64, 64, 0.0, 0.0, 0.0);
+		igt_assert(cairo_status(cr) == 0);
+		cairo_destroy(cr);
+
+		igt_plane_set_fb(plane, &fb);
+		igt_display_commit2(&data->display, COMMIT_UNIVERSAL);
+
+		igt_remove_fb(data->drm_fd, &fb);
+	}
+
+	igt_plane_set_fb(primary, NULL);
+	igt_plane_set_fb(plane, NULL);
+	igt_remove_fb(data->drm_fd, &primary_fb);
+}
+
+static void
+test_pixel_formats(data_t *data, enum pipe pipe)
+{
+	igt_output_t *output;
+
+	igt_display_require_output_on_pipe(&data->display, pipe);
+
+	for_each_valid_output_on_pipe(&data->display, pipe, output) {
+		igt_plane_t *plane;
+
+		for_each_plane_on_pipe(&data->display, pipe, plane)
+			test_format_plane(data, pipe, output, plane);
+
+		igt_output_set_pipe(output, PIPE_ANY);
+	}
+}
+
 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 {
@@ -376,6 +475,10 @@ run_tests_for_pipe_plane(data_t *data, enum pipe pipe)
 		igt_require(data->display.pipes[pipe].n_planes > 0);
 	}
 
+	igt_subtest_f("pixel-format-pipe-%s-planes",
+		      kmstest_pipe_name(pipe))
+		test_pixel_formats(data, pipe);
+
 	igt_subtest_f("plane-position-covered-pipe-%s-planes",
 		      kmstest_pipe_name(pipe))
 		test_plane_position(data, pipe, TEST_POSITION_FULLY_COVERED);
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 1/9
#2 lore raw

Re: [PATCH i-g-t v2 1/9] tests/kms_plane: Run test for all supported pixel formats, v2.

Quoted 11 lines · Maarten Lankhorst

From: Mahesh Kumar <[email protected]>

This patch adds a subtest related to pixel format testing. The test tries to create framebuffer with all supported pixel formats on every plane,
and tries to draw them using cairo and commits the same on display.

Changes since v1:
- Make the test more generic and try on all planes, including legacy cursor.

Quoted 147 lines

---
 tests/kms_plane.c | 103
++++++++++++++++++++++++++++++++++++++++++++++++++++++

 1 file changed, 103 insertions(+)
tests/kms_plane.c +0 -0
index 92bf67f1018c..9672763fe619 100644
@@ -368,6 +368,105 @@ test_plane_panning(data_t *data, enum pipe
 pipe, unsigned int flags)
  	igt_skip_on(connected_outs == 0);
  }

tests/kms_plane.c +16 -0
+static bool can_draw(uint32_t drm_format)
+{
+	const uint32_t *drm_formats;
+	int format_count, i;
+
+	igt_get_all_cairo_formats(&drm_formats, &format_count);
+
+	for (i = 0; i < format_count; i++)
+		if (drm_formats[i] == drm_format)
+			return true;
+
+	return false;
+}
+
+static void test_format_plane(data_t *data, enum pipe pipe,
+			      igt_output_t *output, igt_plane_t

*plane)

tests/kms_plane.c +16 -0
+{
+	igt_plane_t *primary;
+	struct igt_fb primary_fb, fb;
+	drmModeModeInfo *mode;
+	cairo_t *cr;
+	int i;
+	uint32_t format;
+	uint64_t width, height;
+
+	mode = igt_output_get_mode(output);
+	if (plane->type != DRM_PLANE_TYPE_CURSOR) {
+		width = mode->hdisplay;
+		height = mode->vdisplay;
+	} else {
+		if (!plane->drm_plane) {
+			igt_debug("Only legacy cursor ioctl

supported, skipping cursor plane\n");

tests/kms_plane.c +3 -0
+			return;
+		}
+		do_or_die(drmGetCap(data->drm_fd,

DRM_CAP_CURSOR_WIDTH, &width));

tests/kms_plane.c +1 -0
+		do_or_die(drmGetCap(data->drm_fd,

DRM_CAP_CURSOR_HEIGHT, &height));

tests/kms_plane.c +4 -0
+	}
+
+	igt_debug("Testing connector %s on %s plane %s.%u\n",
+		  igt_output_name(output),

kmstest_plane_type_name(plane->type),

tests/kms_plane.c +4 -0
+		  kmstest_pipe_name(pipe), plane->index);
+
+	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+		      DRM_FORMAT_XRGB8888,

LOCAL_DRM_FORMAT_MOD_NONE, &primary_fb);

tests/kms_plane.c +3 -0
+
+	igt_output_set_pipe(output, pipe);
+	primary = igt_output_get_plane_type(output,

DRM_PLANE_TYPE_PRIMARY);

tests/kms_plane.c +3 -0
+	igt_plane_set_fb(primary, &primary_fb);
+
+	igt_display_commit2(&data->display, data->display.is_atomic

? COMMIT_ATOMIC : COMMIT_LEGACY);

tests/kms_plane.c +9 -0
+
+	for (i = 0; i < plane->drm_plane->count_formats; i++) {
+		format = plane->drm_plane->formats[i];
+
+		if (!can_draw(format))
+			continue;
+
+		igt_debug("Testing format 0x%x on %s.%u\n",
+			  format, kmstest_pipe_name(pipe), plane-
Quoted 1 line

index);

tests/kms_plane.c +3 -0
+
+		igt_create_fb(data->drm_fd, width, height,
+			      format, LOCAL_DRM_FORMAT_MOD_NONE,

&fb);

tests/kms_plane.c +6 -0
+
+		cr = igt_get_cairo_ctx(data->drm_fd, &fb);
+		igt_paint_color(cr, 0, 0, width, height,
+				0.0, 1.0, 0.0);
+		if (width >= 164 && height >= 164)
+			igt_paint_color(cr, 100, 100, 64, 64, 0.0,

0.0, 0.0);

tests/kms_plane.c +5 -0
+		igt_assert(cairo_status(cr) == 0);
+		cairo_destroy(cr);
+
+		igt_plane_set_fb(plane, &fb);
+		igt_display_commit2(&data->display,

COMMIT_UNIVERSAL);

tests/kms_plane.c +17 -0
+
+		igt_remove_fb(data->drm_fd, &fb);
+	}
+
+	igt_plane_set_fb(primary, NULL);
+	igt_plane_set_fb(plane, NULL);
+	igt_remove_fb(data->drm_fd, &primary_fb);
+}
+
+static void
+test_pixel_formats(data_t *data, enum pipe pipe)
+{
+	igt_output_t *output;
+
+	igt_display_require_output_on_pipe(&data->display, pipe);
+
+	for_each_valid_output_on_pipe(&data->display, pipe, output)

{

tests/kms_plane.c +4 -0
+		igt_plane_t *plane;
+
+		for_each_plane_on_pipe(&data->display, pipe, plane)
+			test_format_plane(data, pipe, output,

plane);

tests/kms_plane.c +5 -0
+
+		igt_output_set_pipe(output, PIPE_ANY);
+	}
+}
+

 static void
 run_tests_for_pipe_plane(data_t *data, enum pipe pipe) {

tests/kms_plane.c +0 -0
@@ -376,6 +475,10 @@ run_tests_for_pipe_plane(data_t *data, enum pipe
 pipe)
  		igt_require(data->display.pipes[pipe].n_planes > 0);
  	}

tests/kms_plane.c +4 -0
+	igt_subtest_f("pixel-format-pipe-%s-planes",
+		      kmstest_pipe_name(pipe))
+		test_pixel_formats(data, pipe);
+

  igt_subtest_f("plane-position-covered-pipe-%s-planes", kmstest_pipe_name(pipe)) test_plane_position(data, pipe, TEST_POSITION_FULLY_COVERED);

Signature · 6 lines
Mika Kahola - Intel OTC

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

PATCH v2 2/9 tests/kms_plane_scaling: Move the actual test to its own function.

In reply to Maarten Lankhorst

We will add more subtests in the future, it's more clear if we split out the actual test to its own function first.

---
 tests/kms_plane_scaling.c | 226 ++++++++++++++++++++++++----------------------
 1 file changed, 117 insertions(+), 109 deletions(-)
tests/kms_plane_scaling.c +117 -109
index 403df47e2d3b..37e05158b968 100644
@@ -163,144 +163,151 @@ static void iterate_plane_scaling(data_t *d, drmModeModeInfo *mode)
 	}
 }
 
-static void test_plane_scaling(data_t *d)
+static void
+test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 {
 	igt_display_t *display = &d->display;
-	igt_output_t *output;
-	enum pipe pipe;
-	int valid_tests = 0;
+	drmModeModeInfo *mode;
 	int primary_plane_scaling = 0; /* For now */
 
-	igt_require(d->num_scalers);
+	igt_output_set_pipe(output, pipe);
+	mode = igt_output_get_mode(output);
+
+	/* allocate fb2 with image size */
+	d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
+					DRM_FORMAT_XRGB8888,
+					LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+					FILE_NAME, &d->fb2);
+	igt_assert(d->fb_id2);
+
+	d->fb_id3 = igt_create_pattern_fb(d->drm_fd,
+					  mode->hdisplay, mode->vdisplay,
+					  DRM_FORMAT_XRGB8888,
+					  LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+					  &d->fb3);
+	igt_assert(d->fb_id3);
+
+	/* Set up display with plane 1 */
+	d->plane1 = igt_output_get_plane(output, 0);
+	prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_UNIVERSAL);
+
+	if (primary_plane_scaling) {
+		/* Primary plane upscaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
+		igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-	for_each_pipe_with_valid_output(display, pipe, output) {
-		drmModeModeInfo *mode;
-
-		igt_output_set_pipe(output, pipe);
-
-		mode = igt_output_get_mode(output);
-
-		/* allocate fb2 with image size */
-		d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
-						DRM_FORMAT_XRGB8888,
-						LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-						FILE_NAME, &d->fb2);
-		igt_assert(d->fb_id2);
-
-		d->fb_id3 = igt_create_pattern_fb(d->drm_fd,
-						  mode->hdisplay, mode->vdisplay,
-						  DRM_FORMAT_XRGB8888,
-						  LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-						  &d->fb3);
-		igt_assert(d->fb_id3);
-
-		/* Set up display with plane 1 */
-		d->plane1 = igt_output_get_plane(output, 0);
-		prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_UNIVERSAL);
-
-		if (primary_plane_scaling) {
-			/* Primary plane upscaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
-			igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
+		/* Primary plane 1:1 no scaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
+		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	}
 
-			/* Primary plane 1:1 no scaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
-			igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
-		}
+	/* Set up fb2->plane2 mapping. */
+	d->plane2 = igt_output_get_plane(output, 1);
+	igt_plane_set_fb(d->plane2, &d->fb2);
 
-		/* Set up fb2->plane2 mapping. */
-		d->plane2 = igt_output_get_plane(output, 1);
-		igt_plane_set_fb(d->plane2, &d->fb2);
+	/* 2nd plane windowed */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
+	igt_plane_set_position(d->plane2, 100, 100);
+	igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		/* 2nd plane windowed */
-		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
-		igt_plane_set_position(d->plane2, 100, 100);
-		igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	iterate_plane_scaling(d, mode);
 
-		iterate_plane_scaling(d, mode);
+	/* 2nd plane up scaling */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, 500, 500);
+	igt_plane_set_position(d->plane2, 10, 10);
+	igt_plane_set_size(d->plane2, mode->hdisplay-20, mode->vdisplay-20);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		/* 2nd plane up scaling */
-		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, 500, 500);
-		igt_plane_set_position(d->plane2, 10, 10);
-		igt_plane_set_size(d->plane2, mode->hdisplay-20, mode->vdisplay-20);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	/* 2nd plane downscaling */
+	igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d->fb2.height);
+	igt_plane_set_position(d->plane2, 10, 10);
+	igt_plane_set_size(d->plane2, 500, 500 * d->fb2.height/d->fb2.width);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		/* 2nd plane downscaling */
-		igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d->fb2.height);
-		igt_plane_set_position(d->plane2, 10, 10);
-		igt_plane_set_size(d->plane2, 500, 500 * d->fb2.height/d->fb2.width);
+	if (primary_plane_scaling) {
+		/* Primary plane up scaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
 		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	}
 
-		if (primary_plane_scaling) {
-			/* Primary plane up scaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
-			igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
-		}
+	/* Set up fb3->plane3 mapping. */
+	d->plane3 = igt_output_get_plane(output, 2);
+	igt_plane_set_fb(d->plane3, &d->fb3);
+
+	/* 3rd plane windowed - no scaling */
+	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d->fb3.height-300);
+	igt_plane_set_position(d->plane3, 100, 100);
+	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		/* Set up fb3->plane3 mapping. */
-		d->plane3 = igt_output_get_plane(output, 2);
-		igt_plane_set_fb(d->plane3, &d->fb3);
+	/* Switch scaler from plane 2 to plane 3 */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
+	igt_plane_set_position(d->plane2, 100, 100);
+	igt_plane_set_size(d->plane2, d->fb2.width-200, d->fb2.height-200);
 
-		/* 3rd plane windowed - no scaling */
-		igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-		igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d->fb3.height-300);
-		igt_plane_set_position(d->plane3, 100, 100);
-		igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-400, d->fb3.height-400);
+	igt_plane_set_position(d->plane3, 10, 10);
+	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+	if (primary_plane_scaling) {
+		/* Switch scaler from plane 1 to plane 2 */
+		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
 
-		/* Switch scaler from plane 2 to plane 3 */
 		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
+		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-500,d->fb2.height-500);
 		igt_plane_set_position(d->plane2, 100, 100);
-		igt_plane_set_size(d->plane2, d->fb2.width-200, d->fb2.height-200);
-
-		igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-		igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-400, d->fb3.height-400);
-		igt_plane_set_position(d->plane3, 10, 10);
-		igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
+		igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
 		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	}
 
-		if (primary_plane_scaling) {
-			/* Switch scaler from plane 1 to plane 2 */
-			igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
-			igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-
-			igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-			igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-500,d->fb2.height-500);
-			igt_plane_set_position(d->plane2, 100, 100);
-			igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
-		}
+	/* back to single plane mode */
+	igt_plane_set_fb(d->plane2, NULL);
+	igt_plane_set_fb(d->plane3, NULL);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
-		/* back to single plane mode */
-		igt_plane_set_fb(d->plane2, NULL);
-		igt_plane_set_fb(d->plane3, NULL);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	cleanup_crtc(d, output, d->plane1);
+}
 
+static void test_plane_scaling(data_t *d, enum pipe pipe)
+{
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	igt_require(d->num_scalers);
+
+	for_each_valid_output_on_pipe(&d->display, pipe, output) {
+		test_plane_scaling_on_pipe(d, pipe, output);
+		igt_output_set_pipe(output, PIPE_ANY);
 		valid_tests++;
-		cleanup_crtc(d, output, d->plane1);
 	}
+
 	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }
 
 igt_simple_main
 {
 	data_t data = {};
+	enum pipe pipe;
 
 	igt_skip_on_simulation();
 
@@ -312,7 +319,8 @@ igt_simple_main
 
 	data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
 
-	test_plane_scaling(&data);
+	for_each_pipe_static(pipe)
+		test_plane_scaling(&data, pipe);
 
 	igt_display_fini(&data.display);
 }
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 2/9
#4 lore raw

Re: [PATCH i-g-t v2 2/9] tests/kms_plane_scaling: Move the actual test to its own function.

Quoted 3 lines · Maarten Lankhorst

We will add more subtests in the future, it's more clear if we split out the actual test to its own function first.

Quoted 341 lines

---
 tests/kms_plane_scaling.c | 226 ++++++++++++++++++++++++----------
------------

 1 file changed, 117 insertions(+), 109 deletions(-)
tests/kms_plane_scaling.c +0 -0
index 403df47e2d3b..37e05158b968 100644
@@ -163,144 +163,151 @@ static void iterate_plane_scaling(data_t *d,
 drmModeModeInfo *mode)
  	}
  }

tests/kms_plane_scaling.c +2 -1
-static void test_plane_scaling(data_t *d)
+static void
+test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t

*output)
 {
  igt_display_t *display = &d->display;

tests/kms_plane_scaling.c +1 -3
-	igt_output_t *output;
-	enum pipe pipe;
-	int valid_tests = 0;
+	drmModeModeInfo *mode;

  int primary_plane_scaling = 0; /* For now */

tests/kms_plane_scaling.c +7 -1
-	igt_require(d->num_scalers);
+	igt_output_set_pipe(output, pipe);
+	mode = igt_output_get_mode(output);
+
+	/* allocate fb2 with image size */
+	d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
+					DRM_FORMAT_XRGB8888,
+					LOCAL_I915_FORMAT_MOD_X_TILE

D, /* tiled */

tests/kms_plane_scaling.c +5 -0
+					FILE_NAME, &d->fb2);
+	igt_assert(d->fb_id2);
+
+	d->fb_id3 = igt_create_pattern_fb(d->drm_fd,
+					  mode->hdisplay, mode-
Quoted 1 line

vdisplay,

tests/kms_plane_scaling.c +2 -0
+					  DRM_FORMAT_XRGB8888,
+					  LOCAL_I915_FORMAT_MOD_X_TI

LED, /* tiled */

tests/kms_plane_scaling.c +6 -0
+					  &d->fb3);
+	igt_assert(d->fb_id3);
+
+	/* Set up display with plane 1 */
+	d->plane1 = igt_output_get_plane(output, 0);
+	prepare_crtc(d, output, pipe, d->plane1, mode,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +7 -0
+
+	if (primary_plane_scaling) {
+		/* Primary plane upscaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode-
Quoted 1 line

vdisplay);

tests/kms_plane_scaling.c +1 -0
+		igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +0 -11
-	for_each_pipe_with_valid_output(display, pipe, output) {
-		drmModeModeInfo *mode;
-
-		igt_output_set_pipe(output, pipe);
-
-		mode = igt_output_get_mode(output);
-
-		/* allocate fb2 with image size */
-		d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
-						DRM_FORMAT_XRGB8888,
-						LOCAL_I915_FORMAT_MO

D_X_TILED, /* tiled */

tests/kms_plane_scaling.c +0 -5
-						FILE_NAME, &d->fb2);
-		igt_assert(d->fb_id2);
-
-		d->fb_id3 = igt_create_pattern_fb(d->drm_fd,
-						  mode->hdisplay,

mode->vdisplay,

tests/kms_plane_scaling.c +0 -1
-						  DRM_FORMAT_XRGB888

8,

tests/kms_plane_scaling.c +0 -1
-						  LOCAL_I915_FORMAT_

MOD_X_TILED, /* tiled */

tests/kms_plane_scaling.c +0 -6
-						  &d->fb3);
-		igt_assert(d->fb_id3);
-
-		/* Set up display with plane 1 */
-		d->plane1 = igt_output_get_plane(output, 0);
-		prepare_crtc(d, output, pipe, d->plane1, mode,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +0 -4
-
-		if (primary_plane_scaling) {
-			/* Primary plane upscaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 100,

100);

tests/kms_plane_scaling.c +0 -1
-			igt_fb_set_size(&d->fb1, d->plane1, 500,

500);

tests/kms_plane_scaling.c +0 -2
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode-
Quoted 1 line

hdisplay, mode->vdisplay);

tests/kms_plane_scaling.c +0 -1
-			igt_display_commit2(display,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +3 -0
+		/* Primary plane 1:1 no scaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d-
Quoted 1 line

fb1.height);

tests/kms_plane_scaling.c +2 -0
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode-
Quoted 1 line

vdisplay);

tests/kms_plane_scaling.c +2 -0
+		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	}

tests/kms_plane_scaling.c +0 -2
-			/* Primary plane 1:1 no scaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 0,

0);

tests/kms_plane_scaling.c +0 -1
-			igt_fb_set_size(&d->fb1, d->plane1, d-
Quoted 1 line

fb1.width, d->fb1.height);

tests/kms_plane_scaling.c +0 -2
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode-
Quoted 1 line

hdisplay, mode->vdisplay);

tests/kms_plane_scaling.c +0 -1
-			igt_display_commit2(display,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +3 -1
-		}
+	/* Set up fb2->plane2 mapping. */
+	d->plane2 = igt_output_get_plane(output, 1);
+	igt_plane_set_fb(d->plane2, &d->fb2);

tests/kms_plane_scaling.c +3 -3
-		/* Set up fb2->plane2 mapping. */
-		d->plane2 = igt_output_get_plane(output, 1);
-		igt_plane_set_fb(d->plane2, &d->fb2);
+	/* 2nd plane windowed */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d-
Quoted 1 line

fb2.height-200);

tests/kms_plane_scaling.c +2 -0
+	igt_plane_set_position(d->plane2, 100, 100);
+	igt_plane_set_size(d->plane2, mode->hdisplay-200, mode-
Quoted 1 line

vdisplay-200);

tests/kms_plane_scaling.c +1 -0
+	igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +0 -3
-		/* 2nd plane windowed */
-		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-

200, d->fb2.height-200);

tests/kms_plane_scaling.c +0 -2
-		igt_plane_set_position(d->plane2, 100, 100);
-		igt_plane_set_size(d->plane2, mode->hdisplay-200,

mode->vdisplay-200);

tests/kms_plane_scaling.c +1 -1
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	iterate_plane_scaling(d, mode);

tests/kms_plane_scaling.c +5 -1
-		iterate_plane_scaling(d, mode);
+	/* 2nd plane up scaling */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, 500, 500);
+	igt_plane_set_position(d->plane2, 10, 10);
+	igt_plane_set_size(d->plane2, mode->hdisplay-20, mode-
Quoted 1 line

vdisplay-20);

tests/kms_plane_scaling.c +1 -0
+	igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +0 -5
-		/* 2nd plane up scaling */
-		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, 500, 500);
-		igt_plane_set_position(d->plane2, 10, 10);
-		igt_plane_set_size(d->plane2, mode->hdisplay-20,

mode->vdisplay-20);

tests/kms_plane_scaling.c +3 -1
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	/* 2nd plane downscaling */
+	igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d-
Quoted 1 line

fb2.height);

tests/kms_plane_scaling.c +2 -0
+	igt_plane_set_position(d->plane2, 10, 10);
+	igt_plane_set_size(d->plane2, 500, 500 * d->fb2.height/d-
Quoted 1 line

fb2.width);

tests/kms_plane_scaling.c +1 -0
+	igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +0 -3
-		/* 2nd plane downscaling */
-		igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d-
Quoted 1 line

fb2.height);

tests/kms_plane_scaling.c +0 -2
-		igt_plane_set_position(d->plane2, 10, 10);
-		igt_plane_set_size(d->plane2, 500, 500 * d-
Quoted 1 line

fb2.height/d->fb2.width);

tests/kms_plane_scaling.c +6 -0
+	if (primary_plane_scaling) {
+		/* Primary plane up scaling */
+		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode-
Quoted 1 line

vdisplay);

  igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +1 -0
+	}

tests/kms_plane_scaling.c +0 -3
-		if (primary_plane_scaling) {
-			/* Primary plane up scaling */
-			igt_fb_set_position(&d->fb1, d->plane1, 100,

100);

tests/kms_plane_scaling.c +0 -1
-			igt_fb_set_size(&d->fb1, d->plane1, 500,

500);

tests/kms_plane_scaling.c +0 -2
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode-
Quoted 1 line

hdisplay, mode->vdisplay);

tests/kms_plane_scaling.c +0 -1
-			igt_display_commit2(display,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +7 -1
-		}
+	/* Set up fb3->plane3 mapping. */
+	d->plane3 = igt_output_get_plane(output, 2);
+	igt_plane_set_fb(d->plane3, &d->fb3);
+
+	/* 3rd plane windowed - no scaling */
+	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d-
Quoted 1 line

fb3.height-300);

tests/kms_plane_scaling.c +2 -0
+	igt_plane_set_position(d->plane3, 100, 100);
+	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode-
Quoted 1 line

vdisplay-300);

tests/kms_plane_scaling.c +1 -0
+	igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +3 -3
-		/* Set up fb3->plane3 mapping. */
-		d->plane3 = igt_output_get_plane(output, 2);
-		igt_plane_set_fb(d->plane3, &d->fb3);
+	/* Switch scaler from plane 2 to plane 3 */
+	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d-
Quoted 1 line

fb2.height-200);

tests/kms_plane_scaling.c +2 -0
+	igt_plane_set_position(d->plane2, 100, 100);
+	igt_plane_set_size(d->plane2, d->fb2.width-200, d-
Quoted 1 line

fb2.height-200);

tests/kms_plane_scaling.c +0 -3
-		/* 3rd plane windowed - no scaling */
-		igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-		igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-

300, d->fb3.height-300);

tests/kms_plane_scaling.c +0 -2
-		igt_plane_set_position(d->plane3, 100, 100);
-		igt_plane_set_size(d->plane3, mode->hdisplay-300,

mode->vdisplay-300);

tests/kms_plane_scaling.c +2 -1
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-400, d-
Quoted 1 line

fb3.height-400);

tests/kms_plane_scaling.c +2 -0
+	igt_plane_set_position(d->plane3, 10, 10);
+	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode-
Quoted 1 line

vdisplay-300);

tests/kms_plane_scaling.c +6 -0
+	igt_display_commit2(display, COMMIT_UNIVERSAL);
+
+	if (primary_plane_scaling) {
+		/* Switch scaler from plane 1 to plane 2 */
+		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d-
Quoted 1 line

fb1.height);

tests/kms_plane_scaling.c +2 -0
+		igt_plane_set_position(d->plane1, 0, 0);
+		igt_plane_set_size(d->plane1, mode->hdisplay, mode-
Quoted 1 line

vdisplay);

tests/kms_plane_scaling.c +0 -1
-		/* Switch scaler from plane 2 to plane 3 */

  igt_fb_set_position(&d->fb2, d->plane2, 100, 100);

tests/kms_plane_scaling.c +0 -1
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-

200, d->fb2.height-200);

tests/kms_plane_scaling.c +1 -0
+		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-

500,d->fb2.height-500); igt_plane_set_position(d->plane2, 100, 100);

tests/kms_plane_scaling.c +0 -1
-		igt_plane_set_size(d->plane2, d->fb2.width-200, d-
Quoted 1 line

fb2.height-200);

tests/kms_plane_scaling.c +0 -3
-
-		igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-		igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-

400, d->fb3.height-400);

tests/kms_plane_scaling.c +0 -2
-		igt_plane_set_position(d->plane3, 10, 10);
-		igt_plane_set_size(d->plane3, mode->hdisplay-300,

mode->vdisplay-300);

tests/kms_plane_scaling.c +1 -0
+		igt_plane_set_size(d->plane2, mode->hdisplay-200,

mode->vdisplay-200);
  igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +1 -0
+	}

tests/kms_plane_scaling.c +0 -3
-		if (primary_plane_scaling) {
-			/* Switch scaler from plane 1 to plane 2 */
-			igt_fb_set_position(&d->fb1, d->plane1, 0,

0);

tests/kms_plane_scaling.c +0 -1
-			igt_fb_set_size(&d->fb1, d->plane1, d-
Quoted 1 line

fb1.width, d->fb1.height);

tests/kms_plane_scaling.c +0 -2
-			igt_plane_set_position(d->plane1, 0, 0);
-			igt_plane_set_size(d->plane1, mode-
Quoted 1 line

hdisplay, mode->vdisplay);

tests/kms_plane_scaling.c +0 -2
-
-			igt_fb_set_position(&d->fb2, d->plane2, 100,

100);

tests/kms_plane_scaling.c +0 -1
-			igt_fb_set_size(&d->fb2, d->plane2, d-
Quoted 1 line

fb2.width-500,d->fb2.height-500);

tests/kms_plane_scaling.c +0 -2
-			igt_plane_set_position(d->plane2, 100, 100);
-			igt_plane_set_size(d->plane2, mode-
Quoted 1 line

hdisplay-200, mode->vdisplay-200);

tests/kms_plane_scaling.c +0 -1
-			igt_display_commit2(display,

COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +4 -1
-		}
+	/* back to single plane mode */
+	igt_plane_set_fb(d->plane2, NULL);
+	igt_plane_set_fb(d->plane3, NULL);
+	igt_display_commit2(display, COMMIT_UNIVERSAL);

tests/kms_plane_scaling.c +2 -4
-		/* back to single plane mode */
-		igt_plane_set_fb(d->plane2, NULL);
-		igt_plane_set_fb(d->plane3, NULL);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+	cleanup_crtc(d, output, d->plane1);
+}

tests/kms_plane_scaling.c +10 -0
+static void test_plane_scaling(data_t *d, enum pipe pipe)
+{
+	igt_output_t *output;
+	int valid_tests = 0;
+
+	igt_require(d->num_scalers);
+
+	for_each_valid_output_on_pipe(&d->display, pipe, output) {
+		test_plane_scaling_on_pipe(d, pipe, output);
+		igt_output_set_pipe(output, PIPE_ANY);

  valid_tests++;

tests/kms_plane_scaling.c +0 -1
-		cleanup_crtc(d, output, d->plane1);

  }
+
  igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
 }

 igt_simple_main
 {
  data_t data = {};

tests/kms_plane_scaling.c +1 -0
+	enum pipe pipe;


  igt_skip_on_simulation();

tests/kms_plane_scaling.c +0 -0
@@ -312,7 +319,8 @@ igt_simple_main


  data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;

tests/kms_plane_scaling.c +2 -1
-	test_plane_scaling(&data);
+	for_each_pipe_static(pipe)
+		test_plane_scaling(&data, pipe);


  igt_display_fini(&data.display);
 }

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH v2 3/9 tests/kms_plane_scaling: Fix basic scaling test, v2.

In reply to Maarten Lankhorst

From: Mahesh Kumar <[email protected]>

PIPEC doesnt have 3rd plane in GEN9. So, we skip the 3rd plane related scaling test where 2nd OVERLAY plane is not available.

Restricting downscaling to (9/10)x original size of the image to avoid "Max pixel rate limitation" of the hardware.

Later patches in this series will cover corner cases of scaling.

Changes since v1:
- Move out the code reshuffle to a separate commit. (Maarten) This makes it more clear what's fixed.

---
 tests/kms_plane_scaling.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/kms_plane_scaling.c +9 -1
index 37e05158b968..5487f89e5149 100644
@@ -231,7 +231,9 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 	igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
 	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d->fb2.height);
 	igt_plane_set_position(d->plane2, 10, 10);
-	igt_plane_set_size(d->plane2, 500, 500 * d->fb2.height/d->fb2.width);
+
+	/* Downscale (10/9)x of original image */
+	igt_plane_set_size(d->plane2, (d->fb2.width * 10)/9, (d->fb2.height * 10)/9);
 	igt_display_commit2(display, COMMIT_UNIVERSAL);
 
 	if (primary_plane_scaling) {
@@ -247,6 +249,11 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 	d->plane3 = igt_output_get_plane(output, 2);
 	igt_plane_set_fb(d->plane3, &d->fb3);
 
+	if(d->plane3->type == DRM_PLANE_TYPE_CURSOR) {
+		igt_debug("Plane-3 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
+		goto cleanup;
+	}
+
 	/* 3rd plane windowed - no scaling */
 	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
 	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d->fb3.height-300);
@@ -280,6 +287,7 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 		igt_display_commit2(display, COMMIT_UNIVERSAL);
 	}
 
+cleanup:
 	/* back to single plane mode */
 	igt_plane_set_fb(d->plane2, NULL);
 	igt_plane_set_fb(d->plane3, NULL);
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 3/9
#6 lore raw

Re: [PATCH i-g-t v2 3/9] tests/kms_plane_scaling: Fix basic scaling test, v2.

Quoted 9 lines · Maarten Lankhorst

From: Mahesh Kumar <[email protected]>

PIPEC doesnt have 3rd plane in GEN9. So, we skip the 3rd plane related scaling test where 2nd OVERLAY plane is not available.

Restricting downscaling to (9/10)x original size of the image to avoid "Max pixel rate limitation" of the hardware.

Quoted 7 lines

Later patches in this series will cover corner cases of scaling.

Changes since v1:
- Move out the code reshuffle to a separate commit. (Maarten) This makes it more clear what's fixed.

Quoted 51 lines

---
 tests/kms_plane_scaling.c | 10 +++++++++-

 1 file changed, 9 insertions(+), 1 deletion(-)
tests/kms_plane_scaling.c +0 -0
index 37e05158b968..5487f89e5149 100644
@@ -231,7 +231,9 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe
 pipe, igt_output_t *output)
  	igt_fb_set_position(&d->fb2, d->plane2, 0, 0);

  igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d-

Quoted 1 line

fb2.height);

  igt_plane_set_position(d->plane2, 10, 10);

tests/kms_plane_scaling.c +0 -1
-	igt_plane_set_size(d->plane2, 500, 500 * d->fb2.height/d-
Quoted 1 line

fb2.width);

tests/kms_plane_scaling.c +3 -0
+
+	/* Downscale (10/9)x of original image */
+	igt_plane_set_size(d->plane2, (d->fb2.width * 10)/9, (d-
Quoted 1 line

fb2.height * 10)/9);

  igt_display_commit2(display, COMMIT_UNIVERSAL);
  if (primary_plane_scaling) {

tests/kms_plane_scaling.c +0 -0
@@ -247,6 +249,11 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe
 pipe, igt_output_t *output)
  	d->plane3 = igt_output_get_plane(output, 2);
  	igt_plane_set_fb(d->plane3, &d->fb3);

tests/kms_plane_scaling.c +2 -0
+	if(d->plane3->type == DRM_PLANE_TYPE_CURSOR) {
+		igt_debug("Plane-3 doesnt exist on pipe %s\n",

kmstest_pipe_name(pipe));

tests/kms_plane_scaling.c +3 -0
+		goto cleanup;
+	}
+

  /* 3rd plane windowed - no scaling */ igt_fb_set_position(&d->fb3, d->plane3, 100, 100); igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d-

Quoted 1 line

fb3.height-300);

tests/kms_plane_scaling.c +0 -0
@@ -280,6 +287,7 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe
 pipe, igt_output_t *output)
  		igt_display_commit2(display, COMMIT_UNIVERSAL);
  	}


+cleanup:
  /* back to single plane mode */
  igt_plane_set_fb(d->plane2, NULL);
  igt_plane_set_fb(d->plane3, NULL);

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v2 4/9 tests/kms_plane_scaling: Convert from simple test to full test

In reply to Maarten Lankhorst

Convert the test to run subtests per pipe, before we start adding more subtests.

---
 tests/kms_plane_scaling.c | 46 +++++++++++++++++++++-------------------------
 1 file changed, 21 insertions(+), 25 deletions(-)
tests/kms_plane_scaling.c +21 -25
index 5487f89e5149..624e20447780 100644
@@ -170,6 +170,9 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 	drmModeModeInfo *mode;
 	int primary_plane_scaling = 0; /* For now */
 
+	igt_require(d->num_scalers > 0);
+
+	igt_display_reset(display);
 	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
 
@@ -296,39 +299,32 @@ cleanup:
 	cleanup_crtc(d, output, d->plane1);
 }
 
-static void test_plane_scaling(data_t *d, enum pipe pipe)
-{
-	igt_output_t *output;
-	int valid_tests = 0;
-
-	igt_require(d->num_scalers);
-
-	for_each_valid_output_on_pipe(&d->display, pipe, output) {
-		test_plane_scaling_on_pipe(d, pipe, output);
-		igt_output_set_pipe(output, PIPE_ANY);
-		valid_tests++;
-	}
-
-	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
-}
-
-igt_simple_main
+igt_main
 {
 	data_t data = {};
 	enum pipe pipe;
 
 	igt_skip_on_simulation();
 
+	igt_fixture {
+		data.drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_pipe_crc(data.drm_fd);
+		igt_display_init(&data.display, data.drm_fd);
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+	}
 
-	data.drm_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc(data.drm_fd);
-	igt_display_init(&data.display, data.drm_fd);
-	data.devid = intel_get_drm_devid(data.drm_fd);
+	for_each_pipe_static(pipe) igt_subtest_group {
+		igt_output_t *output;
 
-	data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+		igt_fixture
+			igt_display_require_output_on_pipe(&data.display, pipe);
 
-	for_each_pipe_static(pipe)
-		test_plane_scaling(&data, pipe);
+		igt_subtest_f("pipe-%s-plane-scaling", kmstest_pipe_name(pipe))
+			for_each_valid_output_on_pipe(&data.display, pipe, output)
+				test_plane_scaling_on_pipe(&data, pipe, output);
+	}
 
-	igt_display_fini(&data.display);
+	igt_fixture
+		igt_display_fini(&data.display);
 }
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 4/9
#8 lore raw

Re: [PATCH i-g-t v2 4/9] tests/kms_plane_scaling: Convert from simple test to full test

Quoted 3 lines · Maarten Lankhorst

Convert the test to run subtests per pipe, before we start adding more subtests.

Quoted 85 lines

---
 tests/kms_plane_scaling.c | 46 +++++++++++++++++++++--------------
-----------

 1 file changed, 21 insertions(+), 25 deletions(-)
tests/kms_plane_scaling.c +0 -0
index 5487f89e5149..624e20447780 100644
@@ -170,6 +170,9 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe
 pipe, igt_output_t *output)
  	drmModeModeInfo *mode;

  int primary_plane_scaling = 0; /* For now */

tests/kms_plane_scaling.c +3 -0
+	igt_require(d->num_scalers > 0);
+
+	igt_display_reset(display);

  igt_output_set_pipe(output, pipe);
  mode = igt_output_get_mode(output);

tests/kms_plane_scaling.c +0 -0
@@ -296,39 +299,32 @@ cleanup:
  	cleanup_crtc(d, output, d->plane1);
  }

tests/kms_plane_scaling.c +0 -14
-static void test_plane_scaling(data_t *d, enum pipe pipe)
-{
-	igt_output_t *output;
-	int valid_tests = 0;
-
-	igt_require(d->num_scalers);
-
-	for_each_valid_output_on_pipe(&d->display, pipe, output) {
-		test_plane_scaling_on_pipe(d, pipe, output);
-		igt_output_set_pipe(output, PIPE_ANY);
-		valid_tests++;
-	}
-
-	igt_require_f(valid_tests, "no valid crtc/connector

combinations found\n");

tests/kms_plane_scaling.c +1 -3
-}
-
-igt_simple_main
+igt_main

 {
  data_t data = {};
  enum pipe pipe;

  igt_skip_on_simulation();

tests/kms_plane_scaling.c +6 -0
+	igt_fixture {
+		data.drm_fd = drm_open_driver(DRIVER_INTEL);
+		igt_require_pipe_crc(data.drm_fd);
+		igt_display_init(&data.display, data.drm_fd);
+		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.num_scalers = intel_gen(data.devid) >= 9 ? 2 :

0;

tests/kms_plane_scaling.c +1 -0
+	}

tests/kms_plane_scaling.c +2 -4
-	data.drm_fd = drm_open_driver(DRIVER_INTEL);
-	igt_require_pipe_crc(data.drm_fd);
-	igt_display_init(&data.display, data.drm_fd);
-	data.devid = intel_get_drm_devid(data.drm_fd);
+	for_each_pipe_static(pipe) igt_subtest_group {
+		igt_output_t *output;

tests/kms_plane_scaling.c +2 -1
-	data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+		igt_fixture
+			igt_display_require_output_on_pipe(&data.dis

play, pipe);

tests/kms_plane_scaling.c +1 -2
-	for_each_pipe_static(pipe)
-		test_plane_scaling(&data, pipe);
+		igt_subtest_f("pipe-%s-plane-scaling",

kmstest_pipe_name(pipe))

tests/kms_plane_scaling.c +1 -0
+			for_each_valid_output_on_pipe(&data.display,

pipe, output)

tests/kms_plane_scaling.c +1 -0
+				test_plane_scaling_on_pipe(&data,

pipe, output);

tests/kms_plane_scaling.c +1 -0
+	}

tests/kms_plane_scaling.c +2 -1
-	igt_display_fini(&data.display);
+	igt_fixture
+		igt_display_fini(&data.display);

 }

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH v2 5/9 tests/kms_plane_scaling: Clean up tests to work better with igt_kms.

In reply to Maarten Lankhorst

The test only runs on gen9+, so we can safely replace all calls with COMMIT_ATOMIC.

Also perform some cleanups by making fb an array, and cleaning up in prepare_crtc. This way failed subtests won't cause failures in other subtests.

---
 tests/kms_plane_scaling.c | 234 ++++++++++++++++++++--------------------------
 1 file changed, 99 insertions(+), 135 deletions(-)
tests/kms_plane_scaling.c +99 -135
index 624e20447780..44ff91d7738f 100644
@@ -40,93 +40,68 @@ typedef struct {
 
 	int num_scalers;
 
-	struct igt_fb fb1;
-	struct igt_fb fb2;
-	struct igt_fb fb3;
-	int fb_id1;
-	int fb_id2;
-	int fb_id3;
-
+	struct igt_fb fb[3];
 	igt_plane_t *plane1;
 	igt_plane_t *plane2;
 	igt_plane_t *plane3;
-	igt_plane_t *plane4;
 } data_t;
 
 #define FILE_NAME   "1080p-left.png"
 
-static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
-			igt_plane_t *plane, drmModeModeInfo *mode, enum igt_commit_style s)
+static void cleanup_crtc(data_t *data)
 {
-	igt_display_t *display = &data->display;
-
-	igt_output_set_pipe(output, pipe);
+	int i;
 
-	/* create the pipe_crc object for this pipe */
 	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+	data->pipe_crc = NULL;
 
-	/* before allocating, free if any older fb */
-	if (data->fb_id1) {
-		igt_remove_fb(data->drm_fd, &data->fb1);
-		data->fb_id1 = 0;
-	}
+	for (i = 0; i < ARRAY_SIZE(data->fb); i++) {
+		if (!data->fb[i].fb_id)
+			continue;
 
-	/* allocate fb for plane 1 */
-	data->fb_id1 = igt_create_pattern_fb(data->drm_fd,
-					     mode->hdisplay, mode->vdisplay,
-					     DRM_FORMAT_XRGB8888,
-					     LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-					     &data->fb1);
-	igt_assert(data->fb_id1);
-
-	/*
-	 * We always set the primary plane to actually enable the pipe as
-	 * there's no way (that works) to light up a pipe with only a sprite
-	 * plane enabled at the moment.
-	 */
-	if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
-		igt_plane_t *primary;
-
-		primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_plane_set_fb(primary, &data->fb1);
+		igt_remove_fb(data->drm_fd, &data->fb[i]);
+		data->fb[i].fb_id = 0;
 	}
-
-	igt_plane_set_fb(plane, &data->fb1);
-	igt_display_commit2(display, s);
 }
 
-static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
+static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
+			igt_plane_t *plane, drmModeModeInfo *mode)
 {
 	igt_display_t *display = &data->display;
 
-	igt_pipe_crc_free(data->pipe_crc);
-	data->pipe_crc = NULL;
+	cleanup_crtc(data);
 
-	if (data->fb_id1) {
-		igt_remove_fb(data->drm_fd, &data->fb1);
-		data->fb_id1 = 0;
-	}
-	if (data->fb_id2) {
-		igt_remove_fb(data->drm_fd, &data->fb2);
-		data->fb_id2 = 0;
-	}
-	if (data->fb_id3) {
-		igt_remove_fb(data->drm_fd, &data->fb3);
-		data->fb_id3 = 0;
-	}
+	igt_display_reset(display);
+	igt_output_set_pipe(output, pipe);
+
+	/* create the pipe_crc object for this pipe */
+	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
+
+	/* allocate fb for plane 1 */
+	igt_create_pattern_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+			      &data->fb[0]);
+
+	igt_plane_set_fb(plane, &data->fb[0]);
 
 	if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
 		igt_plane_t *primary;
+		int ret;
 
+		/* Do we succeed without enabling the primary plane? */
+		ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
+		if (!ret)
+			return;
+
+		/*
+		 * Fallback: set the primary plane to actually enable the pipe.
+		 * Some drivers always require the primary plane to be enabled.
+		 */
 		primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
-		igt_plane_set_fb(primary, NULL);
+		igt_plane_set_fb(primary, &data->fb[0]);
 	}
-
-	igt_plane_set_fb(plane, NULL);
-	igt_output_set_pipe(output, PIPE_ANY);
-
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 }
 
 /* does iterative scaling on plane2 */
@@ -134,31 +109,31 @@ static void iterate_plane_scaling(data_t *d, drmModeModeInfo *mode)
 {
 	igt_display_t *display = &d->display;
 
-	if (mode->hdisplay >= d->fb2.width) {
+	if (mode->hdisplay >= d->fb[1].width) {
 		int w, h;
 		/* fixed fb */
-		igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d->fb2.height);
+		igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
+		igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width, d->fb[1].height);
 		igt_plane_set_position(d->plane2, 0, 0);
 
 		/* adjust plane size */
-		for (w = d->fb2.width; w <= mode->hdisplay; w+=10) {
-			h = w * d->fb2.height / d->fb2.width;
+		for (w = d->fb[1].width; w <= mode->hdisplay; w+=10) {
+			h = w * d->fb[1].height / d->fb[1].width;
 			igt_plane_set_size(d->plane2, w, h);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
+			igt_display_commit2(display, COMMIT_ATOMIC);
 		}
 	} else {
 		int w, h;
 		/* fixed plane */
 		igt_plane_set_position(d->plane2, 0, 0);
 		igt_plane_set_size(d->plane2, mode->hdisplay, mode->vdisplay);
-		igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
+		igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
 
 		/* adjust fb size */
-		for (w = mode->hdisplay; w <= d->fb2.width; w+=10) {
+		for (w = mode->hdisplay; w <= d->fb[1].width; w+=10) {
 			h = w * mode->hdisplay / mode->vdisplay;
-			igt_fb_set_size(&d->fb2, d->plane2, w, h);
-			igt_display_commit2(display, COMMIT_UNIVERSAL);
+			igt_fb_set_size(&d->fb[1], d->plane2, w, h);
+			igt_display_commit2(display, COMMIT_ATOMIC);
 		}
 	}
 }
@@ -172,131 +147,119 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 
 	igt_require(d->num_scalers > 0);
 
-	igt_display_reset(display);
-	igt_output_set_pipe(output, pipe);
 	mode = igt_output_get_mode(output);
 
-	/* allocate fb2 with image size */
-	d->fb_id2 = igt_create_image_fb(d->drm_fd, 0, 0,
-					DRM_FORMAT_XRGB8888,
-					LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-					FILE_NAME, &d->fb2);
-	igt_assert(d->fb_id2);
+	/* Set up display with plane 1 */
+	d->plane1 = &display->pipes[pipe].planes[0];
+	prepare_crtc(d, output, pipe, d->plane1, mode);
 
-	d->fb_id3 = igt_create_pattern_fb(d->drm_fd,
-					  mode->hdisplay, mode->vdisplay,
-					  DRM_FORMAT_XRGB8888,
-					  LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
-					  &d->fb3);
-	igt_assert(d->fb_id3);
+	/* allocate fb[1] with image size */
+	igt_create_image_fb(d->drm_fd, 0, 0,
+			    DRM_FORMAT_XRGB8888,
+			    LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+			    FILE_NAME, &d->fb[1]);
 
-	/* Set up display with plane 1 */
-	d->plane1 = igt_output_get_plane(output, 0);
-	prepare_crtc(d, output, pipe, d->plane1, mode, COMMIT_UNIVERSAL);
+	igt_create_pattern_fb(d->drm_fd,
+			      mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_X_TILED, /* tiled */
+			      &d->fb[2]);
 
 	if (primary_plane_scaling) {
 		/* Primary plane upscaling */
-		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
-		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_fb_set_position(&d->fb[0], d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb[0], d->plane1, 500, 500);
 		igt_plane_set_position(d->plane1, 0, 0);
 		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 
 		/* Primary plane 1:1 no scaling */
-		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
-		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
+		igt_fb_set_position(&d->fb[0], d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb[0], d->plane1, d->fb[0].width, d->fb[0].height);
 		igt_plane_set_position(d->plane1, 0, 0);
 		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 	}
 
-	/* Set up fb2->plane2 mapping. */
+	/* Set up fb[1]->plane2 mapping. */
 	d->plane2 = igt_output_get_plane(output, 1);
-	igt_plane_set_fb(d->plane2, &d->fb2);
+	igt_plane_set_fb(d->plane2, &d->fb[1]);
 
 	/* 2nd plane windowed */
-	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
+	igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-200, d->fb[1].height-200);
 	igt_plane_set_position(d->plane2, 100, 100);
 	igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	iterate_plane_scaling(d, mode);
 
 	/* 2nd plane up scaling */
-	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-	igt_fb_set_size(&d->fb2, d->plane2, 500, 500);
+	igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb[1], d->plane2, 500, 500);
 	igt_plane_set_position(d->plane2, 10, 10);
 	igt_plane_set_size(d->plane2, mode->hdisplay-20, mode->vdisplay-20);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	/* 2nd plane downscaling */
-	igt_fb_set_position(&d->fb2, d->plane2, 0, 0);
-	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width, d->fb2.height);
+	igt_fb_set_position(&d->fb[1], d->plane2, 0, 0);
+	igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width, d->fb[1].height);
 	igt_plane_set_position(d->plane2, 10, 10);
 
 	/* Downscale (10/9)x of original image */
-	igt_plane_set_size(d->plane2, (d->fb2.width * 10)/9, (d->fb2.height * 10)/9);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_plane_set_size(d->plane2, (d->fb[1].width * 10)/9, (d->fb[1].height * 10)/9);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	if (primary_plane_scaling) {
 		/* Primary plane up scaling */
-		igt_fb_set_position(&d->fb1, d->plane1, 100, 100);
-		igt_fb_set_size(&d->fb1, d->plane1, 500, 500);
+		igt_fb_set_position(&d->fb[0], d->plane1, 100, 100);
+		igt_fb_set_size(&d->fb[0], d->plane1, 500, 500);
 		igt_plane_set_position(d->plane1, 0, 0);
 		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 	}
 
-	/* Set up fb3->plane3 mapping. */
+	/* Set up fb[2]->plane3 mapping. */
 	d->plane3 = igt_output_get_plane(output, 2);
-	igt_plane_set_fb(d->plane3, &d->fb3);
+	igt_plane_set_fb(d->plane3, &d->fb[2]);
 
 	if(d->plane3->type == DRM_PLANE_TYPE_CURSOR) {
 		igt_debug("Plane-3 doesnt exist on pipe %s\n", kmstest_pipe_name(pipe));
-		goto cleanup;
+		return;
 	}
 
 	/* 3rd plane windowed - no scaling */
-	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-300, d->fb3.height-300);
+	igt_fb_set_position(&d->fb[2], d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb[2], d->plane3, d->fb[2].width-300, d->fb[2].height-300);
 	igt_plane_set_position(d->plane3, 100, 100);
 	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	/* Switch scaler from plane 2 to plane 3 */
-	igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
+	igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
+	igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-200, d->fb[1].height-200);
 	igt_plane_set_position(d->plane2, 100, 100);
-	igt_plane_set_size(d->plane2, d->fb2.width-200, d->fb2.height-200);
+	igt_plane_set_size(d->plane2, d->fb[1].width-200, d->fb[1].height-200);
 
-	igt_fb_set_position(&d->fb3, d->plane3, 100, 100);
-	igt_fb_set_size(&d->fb3, d->plane3, d->fb3.width-400, d->fb3.height-400);
+	igt_fb_set_position(&d->fb[2], d->plane3, 100, 100);
+	igt_fb_set_size(&d->fb[2], d->plane3, d->fb[2].width-400, d->fb[2].height-400);
 	igt_plane_set_position(d->plane3, 10, 10);
 	igt_plane_set_size(d->plane3, mode->hdisplay-300, mode->vdisplay-300);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
+	igt_display_commit2(display, COMMIT_ATOMIC);
 
 	if (primary_plane_scaling) {
 		/* Switch scaler from plane 1 to plane 2 */
-		igt_fb_set_position(&d->fb1, d->plane1, 0, 0);
-		igt_fb_set_size(&d->fb1, d->plane1, d->fb1.width, d->fb1.height);
+		igt_fb_set_position(&d->fb[0], d->plane1, 0, 0);
+		igt_fb_set_size(&d->fb[0], d->plane1, d->fb[0].width, d->fb[0].height);
 		igt_plane_set_position(d->plane1, 0, 0);
 		igt_plane_set_size(d->plane1, mode->hdisplay, mode->vdisplay);
 
-		igt_fb_set_position(&d->fb2, d->plane2, 100, 100);
-		igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-500,d->fb2.height-500);
+		igt_fb_set_position(&d->fb[1], d->plane2, 100, 100);
+		igt_fb_set_size(&d->fb[1], d->plane2, d->fb[1].width-500,d->fb[1].height-500);
 		igt_plane_set_position(d->plane2, 100, 100);
 		igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200);
-		igt_display_commit2(display, COMMIT_UNIVERSAL);
+		igt_display_commit2(display, COMMIT_ATOMIC);
 	}
-
-cleanup:
-	/* back to single plane mode */
-	igt_plane_set_fb(d->plane2, NULL);
-	igt_plane_set_fb(d->plane3, NULL);
-	igt_display_commit2(display, COMMIT_UNIVERSAL);
-
-	cleanup_crtc(d, output, d->plane1);
 }
 
 igt_main
@@ -312,6 +275,7 @@ igt_main
 		igt_display_init(&data.display, data.drm_fd);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		data.num_scalers = intel_gen(data.devid) >= 9 ? 2 : 0;
+		igt_require(data.display.is_atomic);
 	}
 
 	for_each_pipe_static(pipe) igt_subtest_group {
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH v2 6/9 tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v2.

In reply to Maarten Lankhorst

From: Jyoti Yadav <[email protected]>

This patch adds subtest for testing scaling in combination with rotation and pixel formats.

Changes since v1:
- Rework test to work with the other changes to kms_plane_scaling. (Maarten)
- Remove hardcodes for MIN/MAX_SRC_WIDTH, and use the value directly. (Maarten)

---
 tests/kms_plane_scaling.c | 161 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 160 insertions(+), 1 deletion(-)
tests/kms_plane_scaling.c +160 -1
index 44ff91d7738f..821d0a9c883b 100644
@@ -48,10 +48,55 @@ typedef struct {
 
 #define FILE_NAME   "1080p-left.png"
 
+#define MAX_ROTATION	4
+static igt_rotation_t get_rotation_angle(int rot)
+{
+	switch (rot) {
+	case 0:
+		return IGT_ROTATION_0;
+		break;
+	case 1:
+		return IGT_ROTATION_90;
+		break;
+	case 2:
+		return IGT_ROTATION_180;
+		break;
+	case 3:
+		return IGT_ROTATION_270;
+		break;
+	default:
+		igt_info("Unknown/Unsupported Rotation %d\n", rot);
+		return IGT_ROTATION_0;
+	}
+}
+
+#define MAX_TILING	4
+static uint64_t get_tiling(int tiling)
+{
+	switch (tiling) {
+	case 0:
+		return LOCAL_DRM_FORMAT_MOD_NONE;
+		break;
+	case 1:
+		return LOCAL_I915_FORMAT_MOD_X_TILED;
+		break;
+	case 2:
+		return LOCAL_I915_FORMAT_MOD_Y_TILED;
+		break;
+	case 3:
+		return LOCAL_I915_FORMAT_MOD_Yf_TILED;
+		break;
+	default:
+		igt_info("Unknown/Unsupported Tiling %d\n", tiling);
+		return LOCAL_DRM_FORMAT_MOD_NONE;
+	}
+}
+
 static void cleanup_crtc(data_t *data)
 {
 	int i;
 
+	igt_display_reset(&data->display);
 	igt_pipe_crc_free(data->pipe_crc);
 	data->pipe_crc = NULL;
 
@@ -71,7 +116,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 
 	cleanup_crtc(data);
 
-	igt_display_reset(display);
 	igt_output_set_pipe(output, pipe);
 
 	/* create the pipe_crc object for this pipe */
@@ -104,6 +148,112 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
 	igt_display_commit2(display, COMMIT_ATOMIC);
 }
 
+static void paint_fb(data_t *d, struct igt_fb *fb)
+{
+	cairo_t *cr;
+
+	cr = igt_get_cairo_ctx(d->drm_fd, fb);
+	igt_paint_color(cr, 0, 0, fb->width, fb->height, 0.0, 1.0, 0.0);
+	igt_assert(cairo_status(cr) == 0);
+	cairo_destroy(cr);
+}
+
+static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
+					 uint32_t pixel_format,
+					 uint64_t tiling, enum pipe pipe,
+					 igt_output_t *output,
+					 igt_rotation_t rot)
+{
+	igt_display_t *display = &d->display;
+	int width, height;
+	drmModeModeInfo *mode;
+
+	cleanup_crtc(d);
+
+	igt_output_set_pipe(output, pipe);
+	mode = igt_output_get_mode(output);
+
+	/* create buffer in the range of  min and max source side limit.*/
+	width = height = 9;
+	igt_create_fb(display->drm_fd, width, height,
+		      pixel_format, tiling, &d->fb[0]);
+	paint_fb(d, &d->fb[0]);
+	igt_plane_set_fb(plane, &d->fb[0]);
+
+	/* Check min to full resolution upscaling */
+	igt_fb_set_position(&d->fb[0], plane, 0, 0);
+	igt_fb_set_size(&d->fb[0], plane, width, height);
+	igt_plane_set_position(plane, 0, 0);
+	igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
+	igt_plane_set_rotation(plane, rot);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	igt_plane_set_fb(plane, NULL);
+	igt_plane_set_position(plane, 0, 0);
+}
+
+static void test_scaler_with_rotation_pipe(data_t *d, enum pipe pipe,
+					   igt_output_t *output)
+{
+	igt_display_t *display = &d->display;
+	igt_plane_t *plane;
+
+	igt_output_set_pipe(output, pipe);
+	for_each_plane_on_pipe(display, pipe, plane) {
+
+		if (plane->type == DRM_PLANE_TYPE_CURSOR)
+			continue;
+
+		for (int i = 0; i < MAX_ROTATION; i++) {
+			igt_rotation_t rot = get_rotation_angle(i);
+			check_scaling_pipe_plane_rot(d, plane, DRM_FORMAT_XRGB8888,
+						     LOCAL_I915_FORMAT_MOD_Y_TILED,
+						     pipe, output, rot);
+		}
+	}
+}
+
+static bool can_draw(uint32_t drm_format)
+{
+	const uint32_t *drm_formats;
+	int format_count, i;
+
+	igt_get_all_cairo_formats(&drm_formats, &format_count);
+
+	for (i = 0; i < format_count; i++)
+		if (drm_formats[i] == drm_format)
+			return true;
+
+	return false;
+}
+
+static void test_scaler_with_pixel_format_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
+{
+	igt_display_t *display = &d->display;
+	igt_plane_t *plane;
+
+	igt_output_set_pipe(output, pipe);
+
+	for_each_plane_on_pipe(display, pipe, plane) {
+		if (plane->type == DRM_PLANE_TYPE_CURSOR)
+			continue;
+
+		for (int i = 0; i < MAX_TILING; i++) {
+			uint64_t tiling = get_tiling(i);
+			int j;
+
+			for (j = 0; j < plane->drm_plane->count_formats; j++) {
+				uint32_t format = plane->drm_plane->formats[j];
+
+				if (can_draw(format))
+					check_scaling_pipe_plane_rot(d, plane,
+								     format, tiling,
+								     pipe, output, IGT_ROTATION_0);
+			}
+		}
+	}
+}
+
 /* does iterative scaling on plane2 */
 static void iterate_plane_scaling(data_t *d, drmModeModeInfo *mode)
 {
@@ -287,6 +437,15 @@ igt_main
 		igt_subtest_f("pipe-%s-plane-scaling", kmstest_pipe_name(pipe))
 			for_each_valid_output_on_pipe(&data.display, pipe, output)
 				test_plane_scaling_on_pipe(&data, pipe, output);
+
+		igt_subtest_f("pipe-%s-scaler-with-pixel-format", kmstest_pipe_name(pipe))
+			for_each_valid_output_on_pipe(&data.display, pipe, output)
+				test_scaler_with_pixel_format_pipe(&data, pipe, output);
+
+		igt_subtest_f("pipe-%s-scaler-with-rotation", kmstest_pipe_name(pipe))
+			for_each_valid_output_on_pipe(&data.display, pipe, output)
+				test_scaler_with_rotation_pipe(&data, pipe, output);
+
 	}
 
 	igt_fixture
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw

PATCH v2 7/9 tests/kms_plane_scaling: test scaler with clipping clamping, v2.

In reply to Maarten Lankhorst

From: Jyoti Yadav <[email protected]>

This patch adds subtest to test scaler clipping and clamping scenario.

Changes since v1:
- Modify test to work with the changes to kms_plane_scaling. (Maarten)

---
 tests/kms_plane_scaling.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
tests/kms_plane_scaling.c +45 -0
index 821d0a9c883b..a0f6db9f96f8 100644
@@ -412,6 +412,48 @@ test_plane_scaling_on_pipe(data_t *d, enum pipe pipe, igt_output_t *output)
 	}
 }
 
+static void
+test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_output_t *output)
+{
+	drmModeModeInfo *mode;
+	igt_require(d->num_scalers);
+
+	/* Gen9 has single scaler in PIPEC */
+	igt_skip_on(intel_gen(d->devid) == 9 && pipe == PIPE_C);
+
+	mode = igt_output_get_mode(output);
+	d->plane1 = &d->display.pipes[pipe].planes[0];
+	prepare_crtc(d, output, pipe, d->plane1, mode);
+
+	igt_create_pattern_fb(d->drm_fd,
+			      mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_X_TILED, &d->fb[1]);
+
+	igt_create_pattern_fb(d->drm_fd,
+			      mode->hdisplay, mode->vdisplay,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[2]);
+
+	igt_plane_set_fb(d->plane1, &d->fb[1]);
+	d->plane2 = igt_output_get_plane(output, 1);
+	igt_plane_set_fb(d->plane2, &d->fb[2]);
+
+	igt_fb_set_position(&d->fb[1], d->plane1, 0, 0);
+	igt_fb_set_size(&d->fb[1], d->plane1, 300, 300);
+	igt_plane_set_position(d->plane1, 100, 400);
+	igt_fb_set_position(&d->fb[2], d->plane2, 0, 0);
+	igt_fb_set_size(&d->fb[2], d->plane2, 400, 400);
+	igt_plane_set_position(d->plane2, 100, 100);
+
+	/* scaled window size is outside the modeset area.*/
+	igt_plane_set_size(d->plane1, mode->hdisplay + 200,
+					    mode->vdisplay + 200);
+	igt_plane_set_size(d->plane2, mode->hdisplay + 100,
+					    mode->vdisplay + 100);
+	igt_display_commit2(&d->display, COMMIT_ATOMIC);
+}
+
 igt_main
 {
 	data_t data = {};
@@ -446,6 +488,9 @@ igt_main
 			for_each_valid_output_on_pipe(&data.display, pipe, output)
 				test_scaler_with_rotation_pipe(&data, pipe, output);
 
+		igt_subtest_f("pipe-%s-scaler-with-clipping-clamping", kmstest_pipe_name(pipe))
+			for_each_valid_output_on_pipe(&data.display, pipe, output)
+				test_scaler_with_clipping_clamping_scenario(&data, pipe, output);
 	}
 
 	igt_fixture
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

PATCH v2 8/9 lib/igt_kms: Add more braces around macros

In reply to Maarten Lankhorst

The next patch wants to call for_each_pipe_with_valid_output with *pipe and *output, this fails miserably without these braces.

---
 lib/igt_kms.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
lib/igt_kms.h +8 -8
index 1cf9422c0d12..85e9564adf34 100644
@@ -430,8 +430,8 @@ static inline bool igt_output_is_connected(igt_output_t *output)
  */
 #define for_each_connected_output(display, output)		\
 	for (int i__ = 0;  assert(igt_can_fail()), i__ < (display)->n_outputs; i__++)	\
-		for_each_if (((output = &(display)->outputs[i__]), \
-			      igt_output_is_connected(output)))
+		for_each_if ((((output) = &(display)->outputs[i__]), \
+			      igt_output_is_connected((output))))
 
 /**
  * for_each_pipe:
@@ -469,11 +469,11 @@ static inline bool igt_output_is_connected(igt_output_t *output)
  * will try every combination of @pipe and @output.
  */
 #define for_each_pipe_with_valid_output(display, pipe, output) \
-	for (int con__ = pipe = 0; \
-	     assert(igt_can_fail()), pipe < igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
+	for (int con__ = (pipe) = 0; \
+	     assert(igt_can_fail()), (pipe) < igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
 	     con__ = (con__ + 1 < (display)->n_outputs) ? con__ + 1 : (pipe = pipe + 1, 0)) \
-		for_each_if (((output = &(display)->outputs[con__]), \
-			     igt_pipe_connector_valid(pipe, output)))
+		for_each_if ((((output) = &(display)->outputs[con__]), \
+			     igt_pipe_connector_valid((pipe), (output))))
 
 /**
  * for_each_valid_output_on_pipe:
@@ -486,8 +486,8 @@ static inline bool igt_output_is_connected(igt_output_t *output)
  * happens.
  */
 #define for_each_valid_output_on_pipe(display, pipe, output) \
-	for_each_connected_output(display, output) \
-		for_each_if (igt_pipe_connector_valid(pipe, output))
+	for_each_connected_output((display), (output)) \
+		for_each_if (igt_pipe_connector_valid((pipe), (output)))
 
 #define for_each_plane_on_pipe(display, pipe, plane)			\
 	for (int j__ = 0; assert(igt_can_fail()), (plane) = &(display)->pipes[(pipe)].planes[j__], \
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v2 8/9
#13 lore raw

Re: [PATCH i-g-t v2 8/9] lib/igt_kms: Add more braces around macros

Quoted 3 lines · Maarten Lankhorst

The next patch wants to call for_each_pipe_with_valid_output with *pipe and *output, this fails miserably without these braces.

Quoted 62 lines

---
 lib/igt_kms.h | 16 ++++++++--------

 1 file changed, 8 insertions(+), 8 deletions(-)
lib/igt_kms.h +0 -0
index 1cf9422c0d12..85e9564adf34 100644
@@ -430,8 +430,8 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)
   */
  #define for_each_connected_output(display, output)		\

  for (int i__ = 0;  assert(igt_can_fail()), i__ < (display)-

Quoted 1 line

n_outputs; i__++) \

lib/igt_kms.h +1 -2
-		for_each_if (((output = &(display)->outputs[i__]), \
-			      igt_output_is_connected(output)))
+		for_each_if ((((output) = &(display)->outputs[i__]), 

\

lib/igt_kms.h +1 -0
+			      igt_output_is_connected((output))))


 /**
  * for_each_pipe:

lib/igt_kms.h +2 -2
@@ -469,11 +469,11 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)
   * will try every combination of @pipe and @output.
   */
  #define for_each_pipe_with_valid_output(display, pipe, output) \
-	for (int con__ = pipe = 0; \
-	     assert(igt_can_fail()), pipe <
 igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
+	for (int con__ = (pipe) = 0; \
+	     assert(igt_can_fail()), (pipe) <
 igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \

       con__ = (con__ + 1 < (display)->n_outputs) ? con__ + 1 : (pipe = pipe + 1, 0)) \

lib/igt_kms.h +0 -1
-		for_each_if (((output = &(display)->outputs[con__]), 

\

lib/igt_kms.h +0 -1
-			     igt_pipe_connector_valid(pipe,

output)))

lib/igt_kms.h +1 -0
+		for_each_if ((((output) = &(display)-
Quoted 1 line

outputs[con__]), \

lib/igt_kms.h +1 -0
+			     igt_pipe_connector_valid((pipe),

(output))))

 /**
  * for_each_valid_output_on_pipe:

lib/igt_kms.h +2 -2
@@ -486,8 +486,8 @@ static inline bool
 igt_output_is_connected(igt_output_t *output)
   * happens.
   */
  #define for_each_valid_output_on_pipe(display, pipe, output) \
-	for_each_connected_output(display, output) \
-		for_each_if (igt_pipe_connector_valid(pipe, output))
+	for_each_connected_output((display), (output)) \
+		for_each_if (igt_pipe_connector_valid((pipe),
 (output)))


 #define for_each_plane_on_pipe(display, pipe, plane) \
  for (int j__ = 0; assert(igt_can_fail()), (plane) = &(display)->pipes[(pipe)].planes[j__], \

Signature · 6 lines
Mika Kahola - Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#14 lore raw

PATCH v2 9/9 tests/kms_plane_scaling: test for multi pipe with scaling

In reply to Maarten Lankhorst

From: Jyoti Yadav <[email protected]>

Add a subtest to display primary and overlay planes on two connected pipes and runs scaling test on both pipes

Changes since v1:
- Commit first before trying any scaling. (Maarten)
- Use the same logic as kms_cursor_legacy to find a pipe and output. (Maarten)
- Rework test to work with how cleanup is handled. (Maarten)

---
 tests/kms_plane_scaling.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 90 insertions(+), 1 deletion(-)
tests/kms_plane_scaling.c +90 -1
index a0f6db9f96f8..836f711d5bf2 100644
@@ -40,10 +40,12 @@ typedef struct {
 
 	int num_scalers;
 
-	struct igt_fb fb[3];
+	struct igt_fb fb[4];
+
 	igt_plane_t *plane1;
 	igt_plane_t *plane2;
 	igt_plane_t *plane3;
+	igt_plane_t *plane4;
 } data_t;
 
 #define FILE_NAME   "1080p-left.png"
@@ -454,6 +456,90 @@ test_scaler_with_clipping_clamping_scenario(data_t *d, enum pipe pipe, igt_outpu
 	igt_display_commit2(&d->display, COMMIT_ATOMIC);
 }
 
+static void find_connected_pipe(igt_display_t *display, bool second, enum pipe *pipe, igt_output_t **output)
+{
+	enum pipe first = PIPE_NONE;
+	igt_output_t *first_output = NULL;
+	bool found = false;
+
+	for_each_pipe_with_valid_output(display, *pipe, *output) {
+		if (first == *pipe || *output == first_output)
+			continue;
+
+		if (second) {
+			first = *pipe;
+			first_output = *output;
+			second = false;
+			continue;
+		}
+
+		return;
+	}
+
+	if (first_output)
+		igt_require_f(found, "No second valid output found\n");
+	else
+		igt_require_f(found, "No valid outputs found\n");
+}
+
+static void test_scaler_with_multi_pipe_plane(data_t *d)
+{
+	igt_display_t *display = &d->display;
+	igt_output_t *output1, *output2;
+	drmModeModeInfo *mode1, *mode2;
+	enum pipe pipe1, pipe2;
+
+	cleanup_crtc(d);
+
+	find_connected_pipe(display, false, &pipe1, &output1);
+	find_connected_pipe(display, true, &pipe2, &output2);
+
+	igt_skip_on(!output1 || !output2);
+
+	igt_output_set_pipe(output1, pipe1);
+	igt_output_set_pipe(output2, pipe2);
+
+	d->plane1 = igt_output_get_plane(output1, 0);
+	d->plane2 = igt_output_get_plane(output1, 1);
+	d->plane3 = igt_output_get_plane(output2, 0);
+	d->plane4 = igt_output_get_plane(output2, 1);
+
+	mode1 = igt_output_get_mode(output1);
+	mode2 = igt_output_get_mode(output2);
+
+	igt_create_pattern_fb(d->drm_fd, 600, 600,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[0]);
+
+	igt_create_pattern_fb(d->drm_fd, 500, 500,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[1]);
+
+	igt_create_pattern_fb(d->drm_fd, 700, 700,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[2]);
+
+	igt_create_pattern_fb(d->drm_fd, 400, 400,
+			      DRM_FORMAT_XRGB8888,
+			      LOCAL_I915_FORMAT_MOD_Y_TILED, &d->fb[3]);
+
+	igt_plane_set_fb(d->plane1, &d->fb[0]);
+	igt_plane_set_fb(d->plane2, &d->fb[1]);
+	igt_plane_set_fb(d->plane3, &d->fb[2]);
+	igt_plane_set_fb(d->plane4, &d->fb[3]);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	/* Upscaling Primary */
+	igt_plane_set_size(d->plane1, mode1->hdisplay, mode1->vdisplay);
+	igt_plane_set_size(d->plane3, mode2->hdisplay, mode2->vdisplay);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+
+	/* Upscaling Sprites */
+	igt_plane_set_size(d->plane2, mode1->hdisplay, mode1->vdisplay);
+	igt_plane_set_size(d->plane4, mode2->hdisplay, mode2->vdisplay);
+	igt_display_commit2(display, COMMIT_ATOMIC);
+}
+
 igt_main
 {
 	data_t data = {};
@@ -493,6 +579,9 @@ igt_main
 				test_scaler_with_clipping_clamping_scenario(&data, pipe, output);
 	}
 
+	igt_subtest_f("2x-scaler-multi-pipe")
+		test_scaler_with_multi_pipe_plane(&data);
+
 	igt_fixture
 		igt_display_fini(&data.display);
 }
Signature · 6 lines
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

✓ Fi.CI.BAT: success for kms plane scaling tests.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms plane scaling tests.
URL : https://patchwork.freedesktop.org/series/36388/
State : success

== Summary ==

IGT patchset tested on top of latest successful build b64c093fe5a2b65201ebf8305491ea923151d6e7 tools: Update .gitignore

with latest DRM-Tip kernel build CI_DRM_3624
353fa2d3afff drm-tip: 2018y-01m-12d-09h-21m-50s UTC integration manifest

Testlist changes:
+igt@kms_plane@pixel-format-pipe-a-planes +igt@kms_plane@pixel-format-pipe-b-planes +igt@kms_plane@pixel-format-pipe-c-planes +igt@kms_plane@pixel-format-pipe-d-planes +igt@kms_plane@pixel-format-pipe-e-planes +igt@kms_plane@pixel-format-pipe-f-planes +igt@kms_plane_scaling@2x-scaler-multi-pipe +igt@kms_plane_scaling@pipe-a-plane-scaling +igt@kms_plane_scaling@pipe-a-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-a-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-a-scaler-with-rotation +igt@kms_plane_scaling@pipe-b-plane-scaling +igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-b-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-b-scaler-with-rotation +igt@kms_plane_scaling@pipe-c-plane-scaling +igt@kms_plane_scaling@pipe-c-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-c-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-c-scaler-with-rotation +igt@kms_plane_scaling@pipe-d-plane-scaling +igt@kms_plane_scaling@pipe-d-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-d-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-d-scaler-with-rotation +igt@kms_plane_scaling@pipe-e-plane-scaling +igt@kms_plane_scaling@pipe-e-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-e-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-e-scaler-with-rotation +igt@kms_plane_scaling@pipe-f-plane-scaling +igt@kms_plane_scaling@pipe-f-scaler-with-clipping-clamping +igt@kms_plane_scaling@pipe-f-scaler-with-pixel-format +igt@kms_plane_scaling@pipe-f-scaler-with-rotation -igt@kms_plane_scaling

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:374s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:488s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:282s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:489s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:490s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:474s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:278s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:515s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:393s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:405s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:412s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:466s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:504s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:456s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:502s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:593s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:433s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:508s
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:495s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:492s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:435s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:398s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:571s
fi-glk-dsi       total:288  pass:175  dwarn:1   dfail:4   fail:0   skip:108 time:314s

== Logs ==

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

#16 lore raw

✓ Fi.CI.IGT: success for kms plane scaling tests.

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: kms plane scaling tests.
URL : https://patchwork.freedesktop.org/series/36388/
State : success

== Summary ==

Test gem_softpin:

        Subgroup noreloc-s3:
                pass       -> SKIP       (shard-snb) fdo#103375
Test kms_flip:
        Subgroup blt-wf_vblank-vs-modeset-interruptible:
                skip       -> PASS       (shard-snb) fdo#104218 +1
        Subgroup basic-flip-vs-modeset:
                pass       -> INCOMPLETE (shard-hsw) fdo#102614
Test gem_exec_parallel:
        Subgroup default-fds:
                skip       -> PASS       (shard-snb)
Test prime_vgem:
        Subgroup fence-wait-blt:
                skip       -> PASS       (shard-snb)
Test perf_pmu:
        Subgroup busy-check-all-rcs0:
                skip       -> PASS       (shard-snb)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                pass       -> FAIL       (shard-snb) fdo#101623
        Subgroup fbc-1p-primscrn-pri-indfb-draw-pwrite:
                fail       -> PASS       (shard-snb) fdo#103167
Test gem_eio:
        Subgroup in-flight-contexts:
                dmesg-warn -> PASS       (shard-snb) fdo#104058 +1
Test gem_pwrite_snooped:
                fail       -> PASS       (shard-snb) fdo#104600
Test gem_partial_pwrite_pread:
        Subgroup write:
                skip       -> PASS       (shard-snb)
Test kms_plane:
        Subgroup plane-panning-bottom-right-suspend-pipe-a-planes:
                pass       -> SKIP       (shard-snb) fdo#102365
Test gem_wait:
        Subgroup write-busy-bsd:
                skip       -> PASS       (shard-snb)

fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#104218 https://bugs.freedesktop.org/show_bug.cgi?id=104218
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#104600 https://bugs.freedesktop.org/show_bug.cgi?id=104600
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365

shard-hsw        total:2658 pass:1490 dwarn:1   dfail:0   fail:16  skip:1150 time:8314s
shard-snb        total:2743 pass:1310 dwarn:1   dfail:0   fail:15  skip:1417 time:7775s
Blacklisted hosts:
shard-apl        total:2743 pass:1697 dwarn:3   dfail:0   fail:24  skip:1019 time:13550s
shard-kbl        total:2743 pass:1821 dwarn:3   dfail:0   fail:23  skip:896 time:10543s

== Logs ==

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