All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation
@ 2022-05-06  7:11 Jouni Högander
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests Jouni Högander
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jouni Högander @ 2022-05-06  7:11 UTC (permalink / raw)
  To: igt-dev; +Cc: Mark Pearson, Petri Latvala

This patch set is introducing couple of new testcases to stress PSR2
selective fetch are calculation:

1. Updating plane is partially or fully out of visible area
2. Updating plane is using only part of framebuffer.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Mark Pearson <markpearson@lenovo.com>
Cc: Petri Latvala <petri.latvala@intel.com>

Jouni Högander (3):
  tests/kms_psr2_sf: Move continuous testcase preparation for new tests
  tests/kms_psr2_sf: Add new move continuous testcases
  tests/i915/kms_psr2_sf: add sel fetch/big fb test

 tests/i915/kms_psr2_sf.c | 340 ++++++++++++++++++++++++++++++---------
 1 file changed, 266 insertions(+), 74 deletions(-)

-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests
  2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
@ 2022-05-06  7:11 ` Jouni Högander
  2022-05-18 10:35   ` Kahola, Mika
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases Jouni Högander
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jouni Högander @ 2022-05-06  7:11 UTC (permalink / raw)
  To: igt-dev

Modify current move continuous testcase to ease up adding new
testcases.

Remove exceeding visible area as testcases to perform this are about
to be added as separate testcases.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 tests/i915/kms_psr2_sf.c | 90 +++++++++++++++++++++++++++-------------
 1 file changed, 61 insertions(+), 29 deletions(-)

diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
index d4cddb62..bf0eab23 100644
--- a/tests/i915/kms_psr2_sf.c
+++ b/tests/i915/kms_psr2_sf.c
@@ -53,8 +53,11 @@ enum plane_move_postion {
 	POS_TOP_RIGHT,
 	POS_BOTTOM_LEFT,
 	POS_BOTTOM_RIGHT,
-	POS_BOTTOM_LEFT_NEGATIVE,
-	POS_TOP_RIGHT_NEGATIVE,
+	POS_CENTER,
+	POS_TOP,
+	POS_BOTTOM,
+	POS_LEFT,
+	POS_RIGHT,
 };
 
 typedef struct {
@@ -411,34 +414,42 @@ static void plane_move_expected_output(enum plane_move_postion pos)
 	manual(expected);
 }
 
-static void plane_move_continuous_expected_output(enum plane_move_postion pos)
+static void plane_move_continuous_expected_output(data_t *data)
 {
 	char expected[128] = {};
+	int ret;
 
-	switch (pos) {
+	switch (data->pos) {
 	case POS_TOP_LEFT:
-		sprintf(expected,
-			"screen Green with Blue box on top left corner");
+		ret = sprintf(expected,
+			      "screen Green with Blue box on top left corner");
 		break;
 	case POS_TOP_RIGHT:
-		sprintf(expected,
-			"screen Green with Blue box on top right corner");
+		ret = sprintf(expected,
+			      "screen Green with Blue box on top right corner");
 		break;
 	case POS_BOTTOM_LEFT:
-		sprintf(expected,
-			"screen Green with Blue box on bottom left corner");
+		ret = sprintf(expected,
+			      "screen Green with Blue box on bottom left corner");
 		break;
 	case POS_BOTTOM_RIGHT:
-		sprintf(expected,
-			"screen Green with Blue box on bottom right corner");
+		ret = sprintf(expected,
+			      "screen Green with Blue box on bottom right corner");
 		break;
-	case POS_BOTTOM_LEFT_NEGATIVE:
-		sprintf(expected,
-			"screen Green with Blue box on bottom left corner (partly exceeding area)");
+	case POS_CENTER:
+		ret = sprintf(expected, "screen Green with Blue box on center");
 		break;
-	case POS_TOP_RIGHT_NEGATIVE:
-		sprintf(expected,
-			"screen Green with Blue box on top right corner (partly exceeding area)");
+	case POS_TOP:
+		ret = sprintf(expected, "screen Green with Blue box on top");
+		break;
+	case POS_BOTTOM:
+		ret = sprintf(expected, "screen Green with Blue box on bottom");
+		break;
+	case POS_LEFT:
+		ret = sprintf(expected, "screen Green with Blue box on left");
+		break;
+	case POS_RIGHT:
+		ret = sprintf(expected, "screen Green with Blue box on right");
 		break;
 	default:
 		igt_assert(false);
@@ -530,8 +541,7 @@ static void damaged_plane_move(data_t *data)
 
 	expected_output(data);
 }
-
-static void plane_move_continuous(data_t *data)
+static void get_target_coords(data_t *data, int *x, int *y)
 {
 	int target_x, target_y;
 
@@ -544,28 +554,50 @@ static void plane_move_continuous(data_t *data)
 		target_x = data->mode->hdisplay - data->fb_test.width;
 		target_y = 0;
 		break;
-	case POS_TOP_RIGHT_NEGATIVE:
-		target_x = data->mode->hdisplay - data->fb_test.width;
-		target_y = -data->fb_test.width / 2;
-		break;
 	case POS_BOTTOM_LEFT:
 		target_x = 0;
 		target_y = data->mode->vdisplay - data->fb_test.height;
 		break;
-	case POS_BOTTOM_LEFT_NEGATIVE:
-		target_x = -data->fb_test.width / 2;
-		target_y = data->mode->vdisplay - data->fb_test.height;
-		break;
 	case POS_BOTTOM_RIGHT:
 		target_x = data->mode->hdisplay - data->fb_test.width;
 		target_y = data->mode->vdisplay - data->fb_test.height;
 		break;
+	case POS_CENTER:
+		target_x = data->mode->hdisplay / 2;
+		target_y = data->mode->vdisplay / 2;
+		break;
+	case POS_BOTTOM:
+		target_x = data->mode->hdisplay / 2;
+		target_y = data->mode->vdisplay - data->fb_test.height;
+		break;
+	case POS_TOP:
+		target_x = data->mode->hdisplay / 2;
+		target_y = 0;
+		break;
+	case POS_RIGHT:
+		target_x = data->mode->hdisplay - data->fb_test.width;
+		target_y = data->mode->vdisplay / 2;
+		break;
+	case POS_LEFT:
+		target_x = 0;
+		target_y = data->mode->vdisplay / 2;
+		break;
 	default:
 		igt_assert(false);
 	}
 
+	*x = target_x;
+	*y = target_y;
+}
+
+static void plane_move_continuous(data_t *data)
+{
+	int target_x, target_y;
+
 	igt_assert(psr_wait_entry(data->debugfs_fd, PSR_MODE_2));
 
+	get_target_coords(data, &target_x, &target_y);
+
 	while (data->cur_x != target_x || data->cur_y != target_y) {
 		if (data->cur_x < target_x)
 			data->cur_x += min(target_x - data->cur_x, 20);
@@ -650,7 +682,7 @@ static void run(data_t *data)
 		 * over iterations.
 		 */
 		data->cur_x = data->cur_y = 0;
-		for (i = POS_TOP_LEFT; i <= POS_TOP_RIGHT_NEGATIVE; i++) {
+		for (i = POS_TOP_LEFT; i <= POS_RIGHT; i++) {
 			data->pos = i;
 			plane_move_continuous(data);
 		}
-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases
  2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests Jouni Högander
@ 2022-05-06  7:11 ` Jouni Högander
  2022-05-18 10:36   ` Kahola, Mika
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test Jouni Högander
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jouni Högander @ 2022-05-06  7:11 UTC (permalink / raw)
  To: igt-dev

Adding new continuous move testcases for cursor and overlay
planes. These new testcases are testing selective fetch when updated
plane is fully or partially out of visible area. This was found to
reveal bug in selective fetch area calculation:

https://gitlab.freedesktop.org/drm/intel/-/issues/5440

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 tests/i915/kms_psr2_sf.c | 98 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 2 deletions(-)

diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
index bf0eab23..07dc770b 100644
--- a/tests/i915/kms_psr2_sf.c
+++ b/tests/i915/kms_psr2_sf.c
@@ -45,6 +45,8 @@ enum operations {
 	PLANE_UPDATE_CONTINUOUS,
 	PLANE_MOVE,
 	PLANE_MOVE_CONTINUOUS,
+	PLANE_MOVE_CONTINUOUS_EXCEED,
+	PLANE_MOVE_CONTINUOUS_EXCEED_FULLY,
 	OVERLAY_PRIM_UPDATE
 };
 
@@ -89,6 +91,9 @@ static const char *op_str(enum operations op)
 		[PLANE_UPDATE] = "plane-update",
 		[PLANE_UPDATE_CONTINUOUS] = "plane-update-continuous",
 		[PLANE_MOVE_CONTINUOUS] = "plane-move-continuous",
+		[PLANE_MOVE_CONTINUOUS_EXCEED] = "plane-move-continuous-exceed",
+		[PLANE_MOVE_CONTINUOUS_EXCEED_FULLY] =
+		"plane-move-continuous-exceed-fully",
 		[PLANE_MOVE] = "plane-move",
 		[OVERLAY_PRIM_UPDATE] = "overlay-primary-update",
 	};
@@ -455,6 +460,12 @@ static void plane_move_continuous_expected_output(data_t *data)
 		igt_assert(false);
 	}
 
+	if (ret) {
+		if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED)
+			sprintf(expected + ret, "(partly exceeding area)");
+		else if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED_FULLY)
+			sprintf(expected + ret, "(fully exceeding area)");
+	}
 	manual(expected);
 }
 
@@ -477,7 +488,9 @@ static void expected_output(data_t *data)
 		plane_move_expected_output(data->pos);
 		break;
 	case PLANE_MOVE_CONTINUOUS:
-		plane_move_continuous_expected_output(data->pos);
+	case PLANE_MOVE_CONTINUOUS_EXCEED:
+	case PLANE_MOVE_CONTINUOUS_EXCEED_FULLY:
+		plane_move_continuous_expected_output(data);
 		break;
 	case PLANE_UPDATE:
 		plane_update_expected_output(data->test_plane_id,
@@ -543,7 +556,7 @@ static void damaged_plane_move(data_t *data)
 }
 static void get_target_coords(data_t *data, int *x, int *y)
 {
-	int target_x, target_y;
+	int target_x, target_y, exceed_x, exceed_y;
 
 	switch (data->pos) {
 	case POS_TOP_LEFT:
@@ -586,6 +599,49 @@ static void get_target_coords(data_t *data, int *x, int *y)
 		igt_assert(false);
 	}
 
+	if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED) {
+		exceed_x  = data->fb_test.width / 2;
+		exceed_y  = data->fb_test.height / 2;
+	} else if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED_FULLY) {
+		exceed_x  = data->fb_test.width;
+		exceed_y  = data->fb_test.height;
+	}
+
+	if (data->op != PLANE_MOVE_CONTINUOUS) {
+		switch (data->pos) {
+		case POS_TOP_LEFT:
+			target_x -= exceed_x;
+			target_y -= exceed_y;
+			break;
+		case POS_TOP_RIGHT:
+			target_x += exceed_x;
+			target_y -= exceed_y;
+			break;
+		case POS_BOTTOM_LEFT:
+			target_x -= exceed_x;
+			target_y += exceed_y;
+			break;
+		case POS_BOTTOM_RIGHT:
+			target_x += exceed_x;
+			target_y += exceed_y;
+			break;
+		case POS_BOTTOM:
+			target_y += exceed_y;
+			break;
+		case POS_TOP:
+			target_y -= exceed_y;
+			break;
+		case POS_RIGHT:
+			target_x += exceed_x;
+			break;
+		case POS_LEFT:
+			target_x -= exceed_x;
+			break;
+		case POS_CENTER:
+			break;
+		}
+	}
+
 	*x = target_x;
 	*y = target_y;
 }
@@ -677,6 +733,8 @@ static void run(data_t *data)
 		damaged_plane_move(data);
 		break;
 	case PLANE_MOVE_CONTINUOUS:
+	case PLANE_MOVE_CONTINUOUS_EXCEED:
+	case PLANE_MOVE_CONTINUOUS_EXCEED_FULLY:
 		/*
 		 * Start from top left corner and keep plane position
 		 * over iterations.
@@ -805,6 +863,24 @@ igt_main
 		cleanup(&data);
 	}
 
+	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
+	igt_describe("Test that selective fetch works on moving cursor plane exceeding partially visible area (no update)");
+	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
+		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+		prepare(&data);
+		run(&data);
+		cleanup(&data);
+	}
+
+	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
+	igt_describe("Test that selective fetch works on moving cursor plane exceeding fully visible area (no update)");
+	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
+		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
+		prepare(&data);
+		run(&data);
+		cleanup(&data);
+	}
+
 	/* Only for overlay plane */
 	data.op = PLANE_MOVE;
 	/* Verify overlay plane move selective fetch */
@@ -828,6 +904,24 @@ igt_main
 		cleanup(&data);
 	}
 
+	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
+	igt_describe("Test that selective fetch works on moving overlay plane partially exceeding visible area (no update)");
+	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
+		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+		prepare(&data);
+		run(&data);
+		cleanup(&data);
+	}
+
+	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
+	igt_describe("Test that selective fetch works on moving overlay plane fully exceeding visible area (no update)");
+	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
+		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
+		prepare(&data);
+		run(&data);
+		cleanup(&data);
+	}
+
 	/* Verify primary plane selective fetch with overplay plane blended */
 	data.op = OVERLAY_PRIM_UPDATE;
 	igt_describe("Test that selective fetch works on primary plane "
-- 
2.25.1

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

* [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test
  2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests Jouni Högander
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases Jouni Högander
@ 2022-05-06  7:11 ` Jouni Högander
  2022-05-18 10:36   ` Kahola, Mika
  2022-05-06  9:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Testcases for selective fetch area calculation Patchwork
  2022-05-06 12:09 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 1 reply; 9+ messages in thread
From: Jouni Högander @ 2022-05-06  7:11 UTC (permalink / raw)
  To: igt-dev

Add new testcase for testing selective fetch using big framebuffer.
New testcase is using much bigger fb than what is the visible area
and setting visible offset to half of the width and the height.
This reveals issues in selective fetch area calculation:

https://gitlab.freedesktop.org/drm/intel/-/issues/5440

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 tests/i915/kms_psr2_sf.c | 152 ++++++++++++++++++++++++++++-----------
 1 file changed, 109 insertions(+), 43 deletions(-)

diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
index 07dc770b..5f3dccaf 100644
--- a/tests/i915/kms_psr2_sf.c
+++ b/tests/i915/kms_psr2_sf.c
@@ -73,6 +73,7 @@ typedef struct {
 	struct igt_fb *fb_continuous;
 	uint32_t primary_format;
 	int damage_area_count;
+	int big_fb_width, big_fb_height;
 	struct drm_mode_rect plane_update_clip[MAX_DAMAGE_AREAS];
 	struct drm_mode_rect plane_move_clip;
 	struct drm_mode_rect cursor_clip;
@@ -80,6 +81,7 @@ typedef struct {
 	enum plane_move_postion pos;
 	int test_plane_id;
 	igt_plane_t *test_plane;
+	bool big_fb_test;
 	cairo_t *cr;
 	uint32_t screen_changes;
 	int cur_x, cur_y;
@@ -152,7 +154,7 @@ static void set_clip(struct drm_mode_rect *clip, int x, int y, int width,
 }
 
 static void plane_update_setup_squares(data_t *data, igt_fb_t *fb, uint32_t h,
-				       uint32_t v)
+				       uint32_t v, int pos_x, int pos_y)
 {
 	int x, y;
 	int width = SQUARE_SIZE;
@@ -161,36 +163,36 @@ static void plane_update_setup_squares(data_t *data, igt_fb_t *fb, uint32_t h,
 	switch (data->damage_area_count) {
 	case 5:
 		/*Bottom right corner*/
-		x = h - SQUARE_SIZE;
-		y = v - SQUARE_SIZE;
+		x = pos_x + h - SQUARE_SIZE;
+		y = pos_y + v - SQUARE_SIZE;
 
 		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
 		set_clip(&data->plane_update_clip[4], x, y, width, height);
 	case 4:
 		/*Bottom left corner*/
-		x = 0;
-		y = v - SQUARE_SIZE;
+		x = pos_x;
+		y = pos_y + v - SQUARE_SIZE;
 
 		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
 		set_clip(&data->plane_update_clip[3], x, y, width, height);
 	case 3:
 		/*Top right corner*/
-		x = h - SQUARE_SIZE;
-		y = 0;
+		x = pos_x + h - SQUARE_SIZE;
+		y = pos_y;
 
 		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
 		set_clip(&data->plane_update_clip[2], x, y, width, height);
 	case 2:
 		/*Top left corner*/
-		x = 0;
-		y = 0;
+		x = pos_x;
+		y = pos_y;
 
 		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
 		set_clip(&data->plane_update_clip[1], x, y, width, height);
 	case 1:
 		/*Center*/
-		x = h/2 - SQUARE_SIZE/2;
-		y = v/2 - SQUARE_SIZE/2;
+		x = pos_x + h / 2 - SQUARE_SIZE / 2;
+		y = pos_y + v / 2 - SQUARE_SIZE / 2;
 
 		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
 		set_clip(&data->plane_update_clip[0], x, y, width, height);
@@ -201,30 +203,30 @@ static void plane_update_setup_squares(data_t *data, igt_fb_t *fb, uint32_t h,
 }
 
 static void plane_move_setup_square(data_t *data, igt_fb_t *fb, uint32_t h,
-				       uint32_t v)
+				    uint32_t v, int pos_x, int pos_y)
 {
 	int x = 0, y = 0;
 
 	switch (data->pos) {
 	case POS_TOP_LEFT:
 		/*Bottom right corner*/
-		x = h - SQUARE_SIZE;
-		y = v - SQUARE_SIZE;
+		x = pos_x + h - SQUARE_SIZE;
+		y = pos_y + v - SQUARE_SIZE;
 		break;
 	case POS_TOP_RIGHT:
 		/*Bottom left corner*/
-		x = 0;
-		y = v - SQUARE_SIZE;
+		x = pos_x;
+		y = pos_y + v - SQUARE_SIZE;
 		break;
 	case POS_BOTTOM_LEFT:
 		/*Top right corner*/
-		x = h - SQUARE_SIZE;
-		y = 0;
+		x = pos_x + h - SQUARE_SIZE;
+		y = pos_y + 0;
 		break;
 	case POS_BOTTOM_RIGHT:
 		/*Top left corner*/
-		x = 0;
-		y = 0;
+		x = pos_x;
+		y = pos_y;
 		break;
 	default:
 		igt_assert(false);
@@ -238,10 +240,23 @@ static void plane_move_setup_square(data_t *data, igt_fb_t *fb, uint32_t h,
 static void prepare(data_t *data)
 {
 	igt_plane_t *primary, *sprite = NULL, *cursor = NULL;
+	int fb_w, fb_h, x, y, view_w, view_h;
+
+	if (data->big_fb_test) {
+		fb_w = data->big_fb_width;
+		fb_h = data->big_fb_height;
+		x = fb_w / 2;
+		y = fb_h / 2;
+		view_w = data->mode->hdisplay;
+		view_h = data->mode->vdisplay;
+	} else {
+		fb_w = view_w = data->mode->hdisplay;
+		fb_h = view_h = data->mode->vdisplay;
+		x = y = 0;
+	}
 
 	/* all green frame */
-	igt_create_color_fb(data->drm_fd,
-			    data->mode->hdisplay, data->mode->vdisplay,
+	igt_create_color_fb(data->drm_fd, fb_w, fb_h,
 			    data->primary_format,
 			    DRM_FORMAT_MOD_LINEAR,
 			    0.0, 1.0, 0.0,
@@ -256,16 +271,14 @@ static void prepare(data_t *data)
 						   DRM_PLANE_TYPE_OVERLAY);
 		/*All blue plane*/
 		igt_create_color_fb(data->drm_fd,
-				    data->mode->hdisplay/2,
-				    data->mode->vdisplay/2,
+				    fb_w / 2, fb_h / 2,
 				    DRM_FORMAT_XRGB8888,
 				    DRM_FORMAT_MOD_LINEAR,
 				    0.0, 0.0, 1.0,
 				    &data->fb_overlay);
 
 		igt_create_color_fb(data->drm_fd,
-				    data->mode->hdisplay/2,
-				    data->mode->vdisplay/2,
+				    fb_w / 2, fb_h / 2,
 				    DRM_FORMAT_XRGB8888,
 				    DRM_FORMAT_MOD_LINEAR,
 				    0.0, 0.0, 1.0,
@@ -275,30 +288,32 @@ static void prepare(data_t *data)
 
 		if (data->op == PLANE_MOVE) {
 			plane_move_setup_square(data, &data->fb_test,
-					   data->mode->hdisplay/2,
-					   data->mode->vdisplay/2);
+						view_w / 2, view_h / 2,
+						x, y);
 
 		} else {
 			plane_update_setup_squares(data, &data->fb_test,
-					   data->mode->hdisplay/2,
-					   data->mode->vdisplay/2);
+						   view_w / 2, view_h / 2,
+						   x, y);
 		}
 
 		igt_plane_set_fb(sprite, &data->fb_overlay);
+		igt_fb_set_position(&data->fb_overlay, sprite, x, y);
+		igt_fb_set_size(&data->fb_overlay, primary, view_w / 2,
+				view_h / 2);
+		igt_plane_set_size(sprite, view_w / 2, view_h / 2);
 		data->test_plane = sprite;
 		break;
 
 	case DRM_PLANE_TYPE_PRIMARY:
-		igt_create_color_fb(data->drm_fd,
-			    data->mode->hdisplay, data->mode->vdisplay,
-			    DRM_FORMAT_XRGB8888,
-			    DRM_FORMAT_MOD_LINEAR,
-			    0.0, 1.0, 0.0,
-			    &data->fb_test);
+		igt_create_color_fb(data->drm_fd, fb_w, fb_h,
+				    DRM_FORMAT_XRGB8888,
+				    DRM_FORMAT_MOD_LINEAR,
+				    0.0, 1.0, 0.0,
+				    &data->fb_test);
 
 		plane_update_setup_squares(data, &data->fb_test,
-					   data->mode->hdisplay,
-					   data->mode->vdisplay);
+					   view_w, view_h, x, y);
 		data->fb_continuous = &data->fb_primary;
 		data->test_plane = primary;
 
@@ -306,15 +321,17 @@ static void prepare(data_t *data)
 			sprite = igt_output_get_plane_type(data->output,
 						   DRM_PLANE_TYPE_OVERLAY);
 
-			igt_create_color_fb(data->drm_fd,
-					    data->mode->hdisplay,
-					    data->mode->vdisplay,
+			igt_create_color_fb(data->drm_fd, fb_w, fb_h,
 					    DRM_FORMAT_XRGB8888,
 					    DRM_FORMAT_MOD_LINEAR,
 					    0.0, 0.0, 1.0,
 					    &data->fb_overlay);
 
 			igt_plane_set_fb(sprite, &data->fb_overlay);
+			igt_fb_set_position(&data->fb_overlay, sprite, x, y);
+			igt_fb_set_size(&data->fb_overlay, primary, view_w,
+					view_h);
+			igt_plane_set_size(sprite, view_w, view_h);
 			igt_plane_set_prop_value(sprite, IGT_PLANE_ALPHA,
 						 0x6060);
 		}
@@ -349,7 +366,11 @@ static void prepare(data_t *data)
 	}
 
 	igt_plane_set_fb(primary, &data->fb_primary);
-
+	igt_fb_set_position(&data->fb_primary, primary, x, y);
+	igt_fb_set_size(&data->fb_overlay, primary, view_w,
+			view_h);
+	igt_plane_set_size(primary, view_w, view_h);
+	igt_plane_set_position(primary, 0, 0);
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 }
 
@@ -515,14 +536,27 @@ static void damaged_plane_move(data_t *data)
 	igt_plane_t *test_plane = data->test_plane;
 	uint32_t h = data->mode->hdisplay;
 	uint32_t v = data->mode->vdisplay;
+	int x, y;
 
-	igt_plane_set_fb(test_plane, &data->fb_test);
+	if (data->big_fb_test) {
+		x = data->big_fb_width / 2;
+		y = data->big_fb_height / 2;
+	} else {
+		x = y = 0;
+	}
 
 	if (data->test_plane_id == DRM_PLANE_TYPE_OVERLAY) {
 		h = h/2;
 		v = v/2;
 	}
 
+	igt_plane_set_fb(test_plane, &data->fb_test);
+
+	igt_fb_set_position(&data->fb_test, test_plane, x,
+			    y);
+	igt_fb_set_size(&data->fb_test, test_plane, h, v);
+	igt_plane_set_size(test_plane, h, v);
+
 	igt_plane_replace_prop_blob(test_plane, IGT_PLANE_FB_DAMAGE_CLIPS,
 				    &data->plane_move_clip,
 				    sizeof(struct drm_mode_rect));
@@ -677,6 +711,14 @@ static void damaged_plane_update(data_t *data)
 	igt_plane_t *test_plane = data->test_plane;
 	uint32_t h = data->mode->hdisplay;
 	uint32_t v = data->mode->vdisplay;
+	int x, y;
+
+	if (data->big_fb_test) {
+		x = data->big_fb_width / 2;
+		y = data->big_fb_height / 2;
+	} else {
+		x = y = 0;
+	}
 
 	if (data->test_plane_id == DRM_PLANE_TYPE_OVERLAY) {
 		h = h/2;
@@ -701,6 +743,9 @@ static void damaged_plane_update(data_t *data)
 						    data->damage_area_count);
 	}
 
+	igt_fb_set_position(data->fb_continuous, test_plane, x, y);
+	igt_fb_set_size(data->fb_continuous, test_plane, h, v);
+	igt_plane_set_size(test_plane, h, v);
 	igt_plane_set_position(data->test_plane, 0, 0);
 	igt_display_commit2(&data->display, COMMIT_ATOMIC);
 
@@ -786,6 +831,7 @@ igt_main
 	int i;
 
 	igt_fixture {
+		drmModeResPtr res;
 		int r;
 
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
@@ -807,6 +853,12 @@ igt_main
 		data.op = PLANE_UPDATE;
 		data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
 		data.primary_format = DRM_FORMAT_XRGB8888;
+
+		res = drmModeGetResources(data.drm_fd);
+		data.big_fb_width = res->max_width;
+		data.big_fb_height = res->max_height;
+		igt_info("Big framebuffer size %dx%d\n",
+			 data.big_fb_width, data.big_fb_height);
 		prepare(&data);
 		r = psr_wait_entry(data.debugfs_fd, PSR_MODE_2);
 		if (!r)
@@ -832,6 +884,20 @@ igt_main
 		}
 	}
 
+	/* Verify primary plane selective fetch with big fb */
+	data.big_fb_test = 1;
+	igt_describe("Test that selective fetch works on primary plane with big fb");
+	igt_subtest_f("primary-%s-sf-dmg-area-big-fb", op_str(data.op)) {
+		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
+			data.damage_area_count = i;
+			data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
+			prepare(&data);
+			run(&data);
+			cleanup(&data);
+		}
+	}
+	data.big_fb_test = 0;
+
 	/* Verify overlay plane selective fetch */
 	igt_describe("Test that selective fetch works on overlay plane");
 	igt_subtest_f("overlay-%s-sf-dmg-area", op_str(data.op)) {
-- 
2.25.1

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

* [igt-dev] ✓ Fi.CI.BAT: success for Testcases for selective fetch area calculation
  2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
                   ` (2 preceding siblings ...)
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test Jouni Högander
@ 2022-05-06  9:39 ` Patchwork
  2022-05-06 12:09 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
  4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2022-05-06  9:39 UTC (permalink / raw)
  To: Jouni Högander; +Cc: igt-dev

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

== Series Details ==

Series: Testcases for selective fetch area calculation
URL   : https://patchwork.freedesktop.org/series/103661/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11616 -> IGTPW_7050
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (42 -> 41)
------------------------------

  Missing    (1): fi-bsw-cyan 


Changes
-------

  No changes found


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6467 -> IGTPW_7050

  CI-20190529: 20190529
  CI_DRM_11616: 65a5fe9ac96c60bd6dfcc44a0bb8d584912ea53d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7050: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/index.html
  IGT_6467: 929abc51cdd48d673efa03e025b1f31b557972ed @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


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

+igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-fully-sf
+igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf
+igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf
+igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-sf
+igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-big-fb

== Logs ==

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

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

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

* [igt-dev] ✓ Fi.CI.IGT: success for Testcases for selective fetch area calculation
  2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
                   ` (3 preceding siblings ...)
  2022-05-06  9:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Testcases for selective fetch area calculation Patchwork
@ 2022-05-06 12:09 ` Patchwork
  4 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2022-05-06 12:09 UTC (permalink / raw)
  To: Jouni Högander; +Cc: igt-dev

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

== Series Details ==

Series: Testcases for selective fetch area calculation
URL   : https://patchwork.freedesktop.org/series/103661/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_11616_full -> IGTPW_7050_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

Participating hosts (12 -> 9)
------------------------------

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

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

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

### IGT changes ###

#### Possible regressions ####

  * {igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf} (NEW):
    - {shard-tglu}:       NOTRUN -> [SKIP][1] +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-tglu-6/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html
    - {shard-rkl}:        NOTRUN -> [SKIP][2] +3 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-5/igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf.html

  
#### Suppressed ####

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

  * {igt@kms_plane_scaling@scaler-with-modifier-unity-scaling}:
    - {shard-rkl}:        NOTRUN -> [SKIP][3] +1 similar issue
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-2/igt@kms_plane_scaling@scaler-with-modifier-unity-scaling.html

  * igt@kms_vblank@pipe-d-accuracy-idle:
    - {shard-rkl}:        NOTRUN -> [INCOMPLETE][4]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-5/igt@kms_vblank@pipe-d-accuracy-idle.html

  
New tests
---------

  New tests have been introduced between CI_DRM_11616_full and IGTPW_7050_full:

### New IGT tests (5) ###

  * igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-fully-sf:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_psr2_sf@cursor-plane-move-continuous-exceed-sf:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-fully-sf:
    - Statuses : 3 skip(s)
    - Exec time: [0.0] s

  * igt@kms_psr2_sf@overlay-plane-move-continuous-exceed-sf:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  * igt@kms_psr2_sf@primary-plane-update-sf-dmg-area-big-fb:
    - Statuses : 2 skip(s)
    - Exec time: [0.0] s

  

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_create@create-massive:
    - shard-snb:          NOTRUN -> [DMESG-WARN][5] ([i915#4991])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb6/igt@gem_create@create-massive.html

  * igt@gem_ctx_persistence@engines-mixed:
    - shard-snb:          NOTRUN -> [SKIP][6] ([fdo#109271] / [i915#1099]) +1 similar issue
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb2/igt@gem_ctx_persistence@engines-mixed.html

  * igt@gem_exec_flush@basic-batch-kernel-default-wb:
    - shard-snb:          [PASS][7] -> [SKIP][8] ([fdo#109271]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-snb4/igt@gem_exec_flush@basic-batch-kernel-default-wb.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb6/igt@gem_exec_flush@basic-batch-kernel-default-wb.html

  * igt@i915_hangman@engine-engine-hang:
    - shard-snb:          NOTRUN -> [SKIP][9] ([fdo#109271]) +255 similar issues
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb5/igt@i915_hangman@engine-engine-hang.html

  * igt@kms_color_chamelium@pipe-c-ctm-green-to-red:
    - shard-snb:          NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +11 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb4/igt@kms_color_chamelium@pipe-c-ctm-green-to-red.html

  
#### Possible fixes ####

  * igt@gem_eio@unwedge-stress:
    - {shard-rkl}:        ([TIMEOUT][11], [TIMEOUT][12]) ([i915#3063]) -> [PASS][13]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-4/igt@gem_eio@unwedge-stress.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-2/igt@gem_eio@unwedge-stress.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-2/igt@gem_eio@unwedge-stress.html
    - {shard-tglu}:       [TIMEOUT][14] ([i915#3063]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-tglu-8/igt@gem_eio@unwedge-stress.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-tglu-5/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_fair@basic-none-share@rcs0:
    - {shard-tglu}:       [FAIL][16] ([i915#2842]) -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-tglu-2/igt@gem_exec_fair@basic-none-share@rcs0.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-tglu-3/igt@gem_exec_fair@basic-none-share@rcs0.html

  * igt@gem_exec_flush@basic-wb-ro-before-default:
    - shard-snb:          [SKIP][18] ([fdo#109271]) -> [PASS][19] +2 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-snb6/igt@gem_exec_flush@basic-wb-ro-before-default.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-snb4/igt@gem_exec_flush@basic-wb-ro-before-default.html

  * igt@i915_pm_rps@waitboost:
    - {shard-rkl}:        [FAIL][20] ([i915#4016]) -> [PASS][21]
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-2/igt@i915_pm_rps@waitboost.html
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-5/igt@i915_pm_rps@waitboost.html

  * igt@kms_cursor_legacy@pipe-c-forked-bo:
    - {shard-rkl}:        [SKIP][22] ([i915#4070]) -> [PASS][23]
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-1/igt@kms_cursor_legacy@pipe-c-forked-bo.html
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-4/igt@kms_cursor_legacy@pipe-c-forked-bo.html

  * igt@kms_cursor_legacy@pipe-c-single-move:
    - {shard-rkl}:        ([SKIP][24], [PASS][25]) ([i915#4070]) -> [PASS][26]
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-2/igt@kms_cursor_legacy@pipe-c-single-move.html
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-rkl-5/igt@kms_cursor_legacy@pipe-c-single-move.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-rkl-5/igt@kms_cursor_legacy@pipe-c-single-move.html

  
#### Warnings ####

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][27], [FAIL][28], [FAIL][29], [FAIL][30], [FAIL][31], [FAIL][32], [FAIL][33], [FAIL][34], [FAIL][35], [FAIL][36], [FAIL][37], [FAIL][38], [FAIL][39], [FAIL][40], [FAIL][41], [FAIL][42], [FAIL][43], [FAIL][44], [FAIL][45], [FAIL][46], [FAIL][47], [FAIL][48], [FAIL][49], [FAIL][50], [FAIL][51]) ([i915#5917]) -> ([FAIL][52], [FAIL][53], [FAIL][54], [FAIL][55], [FAIL][56], [FAIL][57], [FAIL][58], [FAIL][59], [FAIL][60], [FAIL][61], [FAIL][62], [FAIL][63], [FAIL][64], [FAIL][65], [FAIL][66], [FAIL][67], [FAIL][68], [FAIL][69], [FAIL][70], [FAIL][71], [FAIL][72], [FAIL][73], [FAIL][74], [FAIL][75], [FAIL][76]) ([fdo#109271] / [i915#5917])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl1/igt@runner@aborted.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl1/igt@runner@aborted.html
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl3/igt@runner@aborted.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl7/igt@runner@aborted.html
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl4/igt@runner@aborted.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl7/igt@runner@aborted.html
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl7/igt@runner@aborted.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl6/igt@runner@aborted.html
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl2/igt@runner@aborted.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl3/igt@runner@aborted.html
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl6/igt@runner@aborted.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl3/igt@runner@aborted.html
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl2/igt@runner@aborted.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl4/igt@runner@aborted.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl6/igt@runner@aborted.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl2/igt@runner@aborted.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl4/igt@runner@aborted.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl6/igt@runner@aborted.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl2/igt@runner@aborted.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl7/igt@runner@aborted.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl1/igt@runner@aborted.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl3/igt@runner@aborted.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl8/igt@runner@aborted.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl8/igt@runner@aborted.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11616/shard-apl8/igt@runner@aborted.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl3/igt@runner@aborted.html
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl2/igt@runner@aborted.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl3/igt@runner@aborted.html
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl4/igt@runner@aborted.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl4/igt@runner@aborted.html
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl3/igt@runner@aborted.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl4/igt@runner@aborted.html
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl4/igt@runner@aborted.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl6/igt@runner@aborted.html
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl1/igt@runner@aborted.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl1/igt@runner@aborted.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl2/igt@runner@aborted.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl1/igt@runner@aborted.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl1/igt@runner@aborted.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl2/igt@runner@aborted.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl6/igt@runner@aborted.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl7/igt@runner@aborted.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl8/igt@runner@aborted.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl8/igt@runner@aborted.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl7/igt@runner@aborted.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl8/igt@runner@aborted.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl7/igt@runner@aborted.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl6/igt@runner@aborted.html
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl8/igt@runner@aborted.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/shard-apl6/igt@runner@aborted.html

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

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109291]: https://bugs.freedesktop.org/show_bug.cgi?id=109291
  [fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
  [fdo#109302]: https://bugs.freedesktop.org/show_bug.cgi?id=109302
  [fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
  [fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
  [fdo#109313]: https://bugs.freedesktop.org/show_bug.cgi?id=109313
  [fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#110254]: https://bugs.freedesktop.org/show_bug.cgi?id=110254
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111314]: https://bugs.freedesktop.org/show_bug.cgi?id=111314
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [fdo#112022]: https://bugs.freedesktop.org/show_bug.cgi?id=112022
  [fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
  [i915#1063]: https://gitlab.freedesktop.org/drm/intel/issues/1063
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1099]: https://gitlab.freedesktop.org/drm/intel/issues/1099
  [i915#1149]: https://gitlab.freedesktop.org/drm/intel/issues/1149
  [i915#1155]: https://gitlab.freedesktop.org/drm/intel/issues/1155
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#1769]: https://gitlab.freedesktop.org/drm/intel/issues/1769
  [i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
  [i915#1850]: https://gitlab.freedesktop.org/drm/intel/issues/1850
  [i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
  [i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
  [i915#2435]: https://gitlab.freedesktop.org/drm/intel/issues/2435
  [i915#2436]: https://gitlab.freedesktop.org/drm/intel/issues/2436
  [i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2530]: https://gitlab.freedesktop.org/drm/intel/issues/2530
  [i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
  [i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
  [i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
  [i915#2994]: https://gitlab.freedesktop.org/drm/intel/issues/2994
  [i915#3002]: https://gitlab.freedesktop.org/drm/intel/issues/3002
  [i915#3012]: https://gitlab.freedesktop.org/drm/intel/issues/3012
  [i915#3063]: https://gitlab.freedesktop.org/drm/intel/issues/3063
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
  [i915#3318]: https://gitlab.freedesktop.org/drm/intel/issues/3318
  [i915#3319]: https://gitlab.freedesktop.org/drm/intel/issues/3319
  [i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3469]: https://gitlab.freedesktop.org/drm/intel/issues/3469
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3639]: https://gitlab.freedesktop.org/drm/intel/issues/3639
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3690]: https://gitlab.freedesktop.org/drm/intel/issues/3690
  [i915#3701]: https://gitlab.freedesktop.org/drm/intel/issues/3701
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
  [i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
  [i915#4016]: https://gitlab.freedesktop.org/drm/intel/issues/4016
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
  [i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4278]: https://gitlab.freedesktop.org/drm/intel/issues/4278
  [i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
  [i915#4369]: https://gitlab.freedesktop.org/drm/intel/issues/4369
  [i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
  [i915#4525]: https://gitlab.freedesktop.org/drm/intel/issues/4525
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4941]: https://gitlab.freedesktop.org/drm/intel/issues/4941
  [i915#4991]: https://gitlab.freedesktop.org/drm/intel/issues/4991
  [i915#5076]: https://gitlab.freedesktop.org/drm/intel/issues/5076
  [i915#5098]: https://gitlab.freedesktop.org/drm/intel/issues/5098
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5287]: https://gitlab.freedesktop.org/drm/intel/issues/5287
  [i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
  [i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
  [i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
  [i915#5614]: https://gitlab.freedesktop.org/drm/intel/issues/5614
  [i915#5691]: https://gitlab.freedesktop.org/drm/intel/issues/5691
  [i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
  [i915#5917]: https://gitlab.freedesktop.org/drm/intel/issues/5917
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658


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

  * CI: CI-20190529 -> None
  * IGT: IGT_6467 -> IGTPW_7050
  * Piglit: piglit_4509 -> None

  CI-20190529: 20190529
  CI_DRM_11616: 65a5fe9ac96c60bd6dfcc44a0bb8d584912ea53d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_7050: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_7050/index.html
  IGT_6467: 929abc51cdd48d673efa03e025b1f31b557972ed @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

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

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

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

* Re: [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests Jouni Högander
@ 2022-05-18 10:35   ` Kahola, Mika
  0 siblings, 0 replies; 9+ messages in thread
From: Kahola, Mika @ 2022-05-18 10:35 UTC (permalink / raw)
  To: Hogander, Jouni, igt-dev

The compiler nags about calling a plane_move_continuous_expected_output() with incorrect argument.

./tests/i915/kms_psr2_sf.c: In function ‘plane_move_continuous_expected_output’:
../tests/i915/kms_psr2_sf.c:420:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
  420 |  int ret;
      |      ^~~
../tests/i915/kms_psr2_sf.c: In function ‘expected_output’:
../tests/i915/kms_psr2_sf.c:480:45: error: incompatible type for argument 1 of ‘plane_move_continuous_expected_output’
  480 |   plane_move_continuous_expected_output(data->pos);
      |                                         ~~~~^~~~~
      |                                             |
      |                                             enum plane_move_postion
../tests/i915/kms_psr2_sf.c:417:59: note: expected ‘data_t *’ but argument is of type ‘enum plane_move_postion’
  417 | static void plane_move_continuous_expected_output(data_t *data)

This is fixed later on in the series but if we want to compile each patch of the series successfully  we would need to change the function call

plane_move_continuous_expected_output(data->pos);
with
plane_move_continuous_expected_output(data);

Still the compiler warns for unused variable 'ret' but that’s a minor thing.

With this function call fix, this is

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Jouni
> Högander
> Sent: Friday, May 6, 2022 10:11 AM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous
> testcase preparation for new tests
> 
> Modify current move continuous testcase to ease up adding new testcases.
> 
> Remove exceeding visible area as testcases to perform this are about to be
> added as separate testcases.
> 
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  tests/i915/kms_psr2_sf.c | 90 +++++++++++++++++++++++++++-------------
>  1 file changed, 61 insertions(+), 29 deletions(-)
> 
> diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c index
> d4cddb62..bf0eab23 100644
> --- a/tests/i915/kms_psr2_sf.c
> +++ b/tests/i915/kms_psr2_sf.c
> @@ -53,8 +53,11 @@ enum plane_move_postion {
>  	POS_TOP_RIGHT,
>  	POS_BOTTOM_LEFT,
>  	POS_BOTTOM_RIGHT,
> -	POS_BOTTOM_LEFT_NEGATIVE,
> -	POS_TOP_RIGHT_NEGATIVE,
> +	POS_CENTER,
> +	POS_TOP,
> +	POS_BOTTOM,
> +	POS_LEFT,
> +	POS_RIGHT,
>  };
> 
>  typedef struct {
> @@ -411,34 +414,42 @@ static void plane_move_expected_output(enum
> plane_move_postion pos)
>  	manual(expected);
>  }
> 
> -static void plane_move_continuous_expected_output(enum
> plane_move_postion pos)
> +static void plane_move_continuous_expected_output(data_t *data)
>  {
>  	char expected[128] = {};
> +	int ret;
> 
> -	switch (pos) {
> +	switch (data->pos) {
>  	case POS_TOP_LEFT:
> -		sprintf(expected,
> -			"screen Green with Blue box on top left corner");
> +		ret = sprintf(expected,
> +			      "screen Green with Blue box on top left corner");
>  		break;
>  	case POS_TOP_RIGHT:
> -		sprintf(expected,
> -			"screen Green with Blue box on top right corner");
> +		ret = sprintf(expected,
> +			      "screen Green with Blue box on top right corner");
>  		break;
>  	case POS_BOTTOM_LEFT:
> -		sprintf(expected,
> -			"screen Green with Blue box on bottom left corner");
> +		ret = sprintf(expected,
> +			      "screen Green with Blue box on bottom left
> corner");
>  		break;
>  	case POS_BOTTOM_RIGHT:
> -		sprintf(expected,
> -			"screen Green with Blue box on bottom right corner");
> +		ret = sprintf(expected,
> +			      "screen Green with Blue box on bottom right
> corner");
>  		break;
> -	case POS_BOTTOM_LEFT_NEGATIVE:
> -		sprintf(expected,
> -			"screen Green with Blue box on bottom left corner
> (partly exceeding area)");
> +	case POS_CENTER:
> +		ret = sprintf(expected, "screen Green with Blue box on center");
>  		break;
> -	case POS_TOP_RIGHT_NEGATIVE:
> -		sprintf(expected,
> -			"screen Green with Blue box on top right corner (partly
> exceeding area)");
> +	case POS_TOP:
> +		ret = sprintf(expected, "screen Green with Blue box on top");
> +		break;
> +	case POS_BOTTOM:
> +		ret = sprintf(expected, "screen Green with Blue box on
> bottom");
> +		break;
> +	case POS_LEFT:
> +		ret = sprintf(expected, "screen Green with Blue box on left");
> +		break;
> +	case POS_RIGHT:
> +		ret = sprintf(expected, "screen Green with Blue box on right");
>  		break;
>  	default:
>  		igt_assert(false);
> @@ -530,8 +541,7 @@ static void damaged_plane_move(data_t *data)
> 
>  	expected_output(data);
>  }
> -
> -static void plane_move_continuous(data_t *data)
> +static void get_target_coords(data_t *data, int *x, int *y)
>  {
>  	int target_x, target_y;
> 
> @@ -544,28 +554,50 @@ static void plane_move_continuous(data_t *data)
>  		target_x = data->mode->hdisplay - data->fb_test.width;
>  		target_y = 0;
>  		break;
> -	case POS_TOP_RIGHT_NEGATIVE:
> -		target_x = data->mode->hdisplay - data->fb_test.width;
> -		target_y = -data->fb_test.width / 2;
> -		break;
>  	case POS_BOTTOM_LEFT:
>  		target_x = 0;
>  		target_y = data->mode->vdisplay - data->fb_test.height;
>  		break;
> -	case POS_BOTTOM_LEFT_NEGATIVE:
> -		target_x = -data->fb_test.width / 2;
> -		target_y = data->mode->vdisplay - data->fb_test.height;
> -		break;
>  	case POS_BOTTOM_RIGHT:
>  		target_x = data->mode->hdisplay - data->fb_test.width;
>  		target_y = data->mode->vdisplay - data->fb_test.height;
>  		break;
> +	case POS_CENTER:
> +		target_x = data->mode->hdisplay / 2;
> +		target_y = data->mode->vdisplay / 2;
> +		break;
> +	case POS_BOTTOM:
> +		target_x = data->mode->hdisplay / 2;
> +		target_y = data->mode->vdisplay - data->fb_test.height;
> +		break;
> +	case POS_TOP:
> +		target_x = data->mode->hdisplay / 2;
> +		target_y = 0;
> +		break;
> +	case POS_RIGHT:
> +		target_x = data->mode->hdisplay - data->fb_test.width;
> +		target_y = data->mode->vdisplay / 2;
> +		break;
> +	case POS_LEFT:
> +		target_x = 0;
> +		target_y = data->mode->vdisplay / 2;
> +		break;
>  	default:
>  		igt_assert(false);
>  	}
> 
> +	*x = target_x;
> +	*y = target_y;
> +}
> +
> +static void plane_move_continuous(data_t *data) {
> +	int target_x, target_y;
> +
>  	igt_assert(psr_wait_entry(data->debugfs_fd, PSR_MODE_2));
> 
> +	get_target_coords(data, &target_x, &target_y);
> +
>  	while (data->cur_x != target_x || data->cur_y != target_y) {
>  		if (data->cur_x < target_x)
>  			data->cur_x += min(target_x - data->cur_x, 20); @@ -
> 650,7 +682,7 @@ static void run(data_t *data)
>  		 * over iterations.
>  		 */
>  		data->cur_x = data->cur_y = 0;
> -		for (i = POS_TOP_LEFT; i <= POS_TOP_RIGHT_NEGATIVE; i++) {
> +		for (i = POS_TOP_LEFT; i <= POS_RIGHT; i++) {
>  			data->pos = i;
>  			plane_move_continuous(data);
>  		}
> --
> 2.25.1


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

* Re: [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases Jouni Högander
@ 2022-05-18 10:36   ` Kahola, Mika
  0 siblings, 0 replies; 9+ messages in thread
From: Kahola, Mika @ 2022-05-18 10:36 UTC (permalink / raw)
  To: Hogander, Jouni, igt-dev

> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Jouni
> Högander
> Sent: Friday, May 6, 2022 10:11 AM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move
> continuous testcases
> 
> Adding new continuous move testcases for cursor and overlay planes. These
> new testcases are testing selective fetch when updated plane is fully or partially
> out of visible area. This was found to reveal bug in selective fetch area
> calculation:
> 
> https://gitlab.freedesktop.org/drm/intel/-/issues/5440
> 
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>

Reviewed-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  tests/i915/kms_psr2_sf.c | 98 +++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 96 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c index
> bf0eab23..07dc770b 100644
> --- a/tests/i915/kms_psr2_sf.c
> +++ b/tests/i915/kms_psr2_sf.c
> @@ -45,6 +45,8 @@ enum operations {
>  	PLANE_UPDATE_CONTINUOUS,
>  	PLANE_MOVE,
>  	PLANE_MOVE_CONTINUOUS,
> +	PLANE_MOVE_CONTINUOUS_EXCEED,
> +	PLANE_MOVE_CONTINUOUS_EXCEED_FULLY,
>  	OVERLAY_PRIM_UPDATE
>  };
> 
> @@ -89,6 +91,9 @@ static const char *op_str(enum operations op)
>  		[PLANE_UPDATE] = "plane-update",
>  		[PLANE_UPDATE_CONTINUOUS] = "plane-update-continuous",
>  		[PLANE_MOVE_CONTINUOUS] = "plane-move-continuous",
> +		[PLANE_MOVE_CONTINUOUS_EXCEED] = "plane-move-
> continuous-exceed",
> +		[PLANE_MOVE_CONTINUOUS_EXCEED_FULLY] =
> +		"plane-move-continuous-exceed-fully",
>  		[PLANE_MOVE] = "plane-move",
>  		[OVERLAY_PRIM_UPDATE] = "overlay-primary-update",
>  	};
> @@ -455,6 +460,12 @@ static void
> plane_move_continuous_expected_output(data_t *data)
>  		igt_assert(false);
>  	}
> 
> +	if (ret) {
> +		if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED)
> +			sprintf(expected + ret, "(partly exceeding area)");
> +		else if (data->op ==
> PLANE_MOVE_CONTINUOUS_EXCEED_FULLY)
> +			sprintf(expected + ret, "(fully exceeding area)");
> +	}
>  	manual(expected);
>  }
> 
> @@ -477,7 +488,9 @@ static void expected_output(data_t *data)
>  		plane_move_expected_output(data->pos);
>  		break;
>  	case PLANE_MOVE_CONTINUOUS:
> -		plane_move_continuous_expected_output(data->pos);
> +	case PLANE_MOVE_CONTINUOUS_EXCEED:
> +	case PLANE_MOVE_CONTINUOUS_EXCEED_FULLY:
> +		plane_move_continuous_expected_output(data);
>  		break;
>  	case PLANE_UPDATE:
>  		plane_update_expected_output(data->test_plane_id,
> @@ -543,7 +556,7 @@ static void damaged_plane_move(data_t *data)  }
> static void get_target_coords(data_t *data, int *x, int *y)  {
> -	int target_x, target_y;
> +	int target_x, target_y, exceed_x, exceed_y;
> 
>  	switch (data->pos) {
>  	case POS_TOP_LEFT:
> @@ -586,6 +599,49 @@ static void get_target_coords(data_t *data, int *x, int
> *y)
>  		igt_assert(false);
>  	}
> 
> +	if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED) {
> +		exceed_x  = data->fb_test.width / 2;
> +		exceed_y  = data->fb_test.height / 2;
> +	} else if (data->op == PLANE_MOVE_CONTINUOUS_EXCEED_FULLY) {
> +		exceed_x  = data->fb_test.width;
> +		exceed_y  = data->fb_test.height;
> +	}
> +
> +	if (data->op != PLANE_MOVE_CONTINUOUS) {
> +		switch (data->pos) {
> +		case POS_TOP_LEFT:
> +			target_x -= exceed_x;
> +			target_y -= exceed_y;
> +			break;
> +		case POS_TOP_RIGHT:
> +			target_x += exceed_x;
> +			target_y -= exceed_y;
> +			break;
> +		case POS_BOTTOM_LEFT:
> +			target_x -= exceed_x;
> +			target_y += exceed_y;
> +			break;
> +		case POS_BOTTOM_RIGHT:
> +			target_x += exceed_x;
> +			target_y += exceed_y;
> +			break;
> +		case POS_BOTTOM:
> +			target_y += exceed_y;
> +			break;
> +		case POS_TOP:
> +			target_y -= exceed_y;
> +			break;
> +		case POS_RIGHT:
> +			target_x += exceed_x;
> +			break;
> +		case POS_LEFT:
> +			target_x -= exceed_x;
> +			break;
> +		case POS_CENTER:
> +			break;
> +		}
> +	}
> +
>  	*x = target_x;
>  	*y = target_y;
>  }
> @@ -677,6 +733,8 @@ static void run(data_t *data)
>  		damaged_plane_move(data);
>  		break;
>  	case PLANE_MOVE_CONTINUOUS:
> +	case PLANE_MOVE_CONTINUOUS_EXCEED:
> +	case PLANE_MOVE_CONTINUOUS_EXCEED_FULLY:
>  		/*
>  		 * Start from top left corner and keep plane position
>  		 * over iterations.
> @@ -805,6 +863,24 @@ igt_main
>  		cleanup(&data);
>  	}
> 
> +	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
> +	igt_describe("Test that selective fetch works on moving cursor plane
> exceeding partially visible area (no update)");
> +	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
> +		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
> +		prepare(&data);
> +		run(&data);
> +		cleanup(&data);
> +	}
> +
> +	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
> +	igt_describe("Test that selective fetch works on moving cursor plane
> exceeding fully visible area (no update)");
> +	igt_subtest_f("cursor-%s-sf", op_str(data.op)) {
> +		data.test_plane_id = DRM_PLANE_TYPE_CURSOR;
> +		prepare(&data);
> +		run(&data);
> +		cleanup(&data);
> +	}
> +
>  	/* Only for overlay plane */
>  	data.op = PLANE_MOVE;
>  	/* Verify overlay plane move selective fetch */ @@ -828,6 +904,24 @@
> igt_main
>  		cleanup(&data);
>  	}
> 
> +	data.op = PLANE_MOVE_CONTINUOUS_EXCEED;
> +	igt_describe("Test that selective fetch works on moving overlay plane
> partially exceeding visible area (no update)");
> +	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
> +		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
> +		prepare(&data);
> +		run(&data);
> +		cleanup(&data);
> +	}
> +
> +	data.op = PLANE_MOVE_CONTINUOUS_EXCEED_FULLY;
> +	igt_describe("Test that selective fetch works on moving overlay plane
> fully exceeding visible area (no update)");
> +	igt_subtest_f("overlay-%s-sf", op_str(data.op)) {
> +		data.test_plane_id = DRM_PLANE_TYPE_OVERLAY;
> +		prepare(&data);
> +		run(&data);
> +		cleanup(&data);
> +	}
> +
>  	/* Verify primary plane selective fetch with overplay plane blended */
>  	data.op = OVERLAY_PRIM_UPDATE;
>  	igt_describe("Test that selective fetch works on primary plane "
> --
> 2.25.1


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

* Re: [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test
  2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test Jouni Högander
@ 2022-05-18 10:36   ` Kahola, Mika
  0 siblings, 0 replies; 9+ messages in thread
From: Kahola, Mika @ 2022-05-18 10:36 UTC (permalink / raw)
  To: Hogander, Jouni, igt-dev

> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Jouni
> Högander
> Sent: Friday, May 6, 2022 10:11 AM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb
> test
> 
> Add new testcase for testing selective fetch using big framebuffer.
> New testcase is using much bigger fb than what is the visible area and setting
> visible offset to half of the width and the height.
> This reveals issues in selective fetch area calculation:
> 
> https://gitlab.freedesktop.org/drm/intel/-/issues/5440
> 
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> ---
>  tests/i915/kms_psr2_sf.c | 152 ++++++++++++++++++++++++++++-----------
>  1 file changed, 109 insertions(+), 43 deletions(-)
> 
> diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c index
> 07dc770b..5f3dccaf 100644
> --- a/tests/i915/kms_psr2_sf.c
> +++ b/tests/i915/kms_psr2_sf.c
> @@ -73,6 +73,7 @@ typedef struct {
>  	struct igt_fb *fb_continuous;
>  	uint32_t primary_format;
>  	int damage_area_count;
> +	int big_fb_width, big_fb_height;
>  	struct drm_mode_rect plane_update_clip[MAX_DAMAGE_AREAS];
>  	struct drm_mode_rect plane_move_clip;
>  	struct drm_mode_rect cursor_clip;
> @@ -80,6 +81,7 @@ typedef struct {
>  	enum plane_move_postion pos;
>  	int test_plane_id;
>  	igt_plane_t *test_plane;
> +	bool big_fb_test;
>  	cairo_t *cr;
>  	uint32_t screen_changes;
>  	int cur_x, cur_y;
> @@ -152,7 +154,7 @@ static void set_clip(struct drm_mode_rect *clip, int x, int
> y, int width,  }
> 
>  static void plane_update_setup_squares(data_t *data, igt_fb_t *fb, uint32_t h,
> -				       uint32_t v)
> +				       uint32_t v, int pos_x, int pos_y)
>  {
>  	int x, y;
>  	int width = SQUARE_SIZE;
> @@ -161,36 +163,36 @@ static void plane_update_setup_squares(data_t
> *data, igt_fb_t *fb, uint32_t h,
>  	switch (data->damage_area_count) {
>  	case 5:
>  		/*Bottom right corner*/
> -		x = h - SQUARE_SIZE;
> -		y = v - SQUARE_SIZE;
> +		x = pos_x + h - SQUARE_SIZE;
> +		y = pos_y + v - SQUARE_SIZE;
> 
>  		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
>  		set_clip(&data->plane_update_clip[4], x, y, width, height);
>  	case 4:
>  		/*Bottom left corner*/
> -		x = 0;
> -		y = v - SQUARE_SIZE;
> +		x = pos_x;
> +		y = pos_y + v - SQUARE_SIZE;
> 
>  		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
>  		set_clip(&data->plane_update_clip[3], x, y, width, height);
>  	case 3:
>  		/*Top right corner*/
> -		x = h - SQUARE_SIZE;
> -		y = 0;
> +		x = pos_x + h - SQUARE_SIZE;
> +		y = pos_y;
> 
>  		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
>  		set_clip(&data->plane_update_clip[2], x, y, width, height);
>  	case 2:
>  		/*Top left corner*/
> -		x = 0;
> -		y = 0;
> +		x = pos_x;
> +		y = pos_y;
> 
>  		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
>  		set_clip(&data->plane_update_clip[1], x, y, width, height);
>  	case 1:
>  		/*Center*/
> -		x = h/2 - SQUARE_SIZE/2;
> -		y = v/2 - SQUARE_SIZE/2;
> +		x = pos_x + h / 2 - SQUARE_SIZE / 2;
> +		y = pos_y + v / 2 - SQUARE_SIZE / 2;
> 
>  		draw_rect(data, fb, x, y, width, height, 1.0, 1.0, 1.0, 1.0);
>  		set_clip(&data->plane_update_clip[0], x, y, width, height); @@
> -201,30 +203,30 @@ static void plane_update_setup_squares(data_t *data,
> igt_fb_t *fb, uint32_t h,  }
> 
>  static void plane_move_setup_square(data_t *data, igt_fb_t *fb, uint32_t h,
> -				       uint32_t v)
> +				    uint32_t v, int pos_x, int pos_y)
>  {
>  	int x = 0, y = 0;
> 
>  	switch (data->pos) {
>  	case POS_TOP_LEFT:
>  		/*Bottom right corner*/
> -		x = h - SQUARE_SIZE;
> -		y = v - SQUARE_SIZE;
> +		x = pos_x + h - SQUARE_SIZE;
> +		y = pos_y + v - SQUARE_SIZE;
>  		break;
>  	case POS_TOP_RIGHT:
>  		/*Bottom left corner*/
> -		x = 0;
> -		y = v - SQUARE_SIZE;
> +		x = pos_x;
> +		y = pos_y + v - SQUARE_SIZE;
>  		break;
>  	case POS_BOTTOM_LEFT:
>  		/*Top right corner*/
> -		x = h - SQUARE_SIZE;
> -		y = 0;
> +		x = pos_x + h - SQUARE_SIZE;
> +		y = pos_y + 0;
>  		break;
>  	case POS_BOTTOM_RIGHT:
>  		/*Top left corner*/
> -		x = 0;
> -		y = 0;
> +		x = pos_x;
> +		y = pos_y;
>  		break;
>  	default:
>  		igt_assert(false);
> @@ -238,10 +240,23 @@ static void plane_move_setup_square(data_t *data,
> igt_fb_t *fb, uint32_t h,  static void prepare(data_t *data)  {
>  	igt_plane_t *primary, *sprite = NULL, *cursor = NULL;
> +	int fb_w, fb_h, x, y, view_w, view_h;
> +
> +	if (data->big_fb_test) {
> +		fb_w = data->big_fb_width;
> +		fb_h = data->big_fb_height;
> +		x = fb_w / 2;
> +		y = fb_h / 2;
> +		view_w = data->mode->hdisplay;
> +		view_h = data->mode->vdisplay;
> +	} else {
> +		fb_w = view_w = data->mode->hdisplay;
> +		fb_h = view_h = data->mode->vdisplay;
> +		x = y = 0;
> +	}
> 
>  	/* all green frame */
> -	igt_create_color_fb(data->drm_fd,
> -			    data->mode->hdisplay, data->mode->vdisplay,
> +	igt_create_color_fb(data->drm_fd, fb_w, fb_h,
>  			    data->primary_format,
>  			    DRM_FORMAT_MOD_LINEAR,
>  			    0.0, 1.0, 0.0,
> @@ -256,16 +271,14 @@ static void prepare(data_t *data)
> 
> DRM_PLANE_TYPE_OVERLAY);
>  		/*All blue plane*/
>  		igt_create_color_fb(data->drm_fd,
> -				    data->mode->hdisplay/2,
> -				    data->mode->vdisplay/2,
> +				    fb_w / 2, fb_h / 2,
>  				    DRM_FORMAT_XRGB8888,
>  				    DRM_FORMAT_MOD_LINEAR,
>  				    0.0, 0.0, 1.0,
>  				    &data->fb_overlay);
> 
>  		igt_create_color_fb(data->drm_fd,
> -				    data->mode->hdisplay/2,
> -				    data->mode->vdisplay/2,
> +				    fb_w / 2, fb_h / 2,
>  				    DRM_FORMAT_XRGB8888,
>  				    DRM_FORMAT_MOD_LINEAR,
>  				    0.0, 0.0, 1.0,
> @@ -275,30 +288,32 @@ static void prepare(data_t *data)
> 
>  		if (data->op == PLANE_MOVE) {
>  			plane_move_setup_square(data, &data->fb_test,
> -					   data->mode->hdisplay/2,
> -					   data->mode->vdisplay/2);
> +						view_w / 2, view_h / 2,
> +						x, y);
> 
>  		} else {
>  			plane_update_setup_squares(data, &data->fb_test,
> -					   data->mode->hdisplay/2,
> -					   data->mode->vdisplay/2);
> +						   view_w / 2, view_h / 2,
> +						   x, y);
>  		}
> 
>  		igt_plane_set_fb(sprite, &data->fb_overlay);
> +		igt_fb_set_position(&data->fb_overlay, sprite, x, y);
> +		igt_fb_set_size(&data->fb_overlay, primary, view_w / 2,
> +				view_h / 2);
> +		igt_plane_set_size(sprite, view_w / 2, view_h / 2);
>  		data->test_plane = sprite;
>  		break;
> 
>  	case DRM_PLANE_TYPE_PRIMARY:
> -		igt_create_color_fb(data->drm_fd,
> -			    data->mode->hdisplay, data->mode->vdisplay,
> -			    DRM_FORMAT_XRGB8888,
> -			    DRM_FORMAT_MOD_LINEAR,
> -			    0.0, 1.0, 0.0,
> -			    &data->fb_test);
> +		igt_create_color_fb(data->drm_fd, fb_w, fb_h,
> +				    DRM_FORMAT_XRGB8888,
> +				    DRM_FORMAT_MOD_LINEAR,
> +				    0.0, 1.0, 0.0,
> +				    &data->fb_test);
> 
>  		plane_update_setup_squares(data, &data->fb_test,
> -					   data->mode->hdisplay,
> -					   data->mode->vdisplay);
> +					   view_w, view_h, x, y);
>  		data->fb_continuous = &data->fb_primary;
>  		data->test_plane = primary;
> 
> @@ -306,15 +321,17 @@ static void prepare(data_t *data)
>  			sprite = igt_output_get_plane_type(data->output,
> 
> DRM_PLANE_TYPE_OVERLAY);
> 
> -			igt_create_color_fb(data->drm_fd,
> -					    data->mode->hdisplay,
> -					    data->mode->vdisplay,
> +			igt_create_color_fb(data->drm_fd, fb_w, fb_h,
>  					    DRM_FORMAT_XRGB8888,
>  					    DRM_FORMAT_MOD_LINEAR,
>  					    0.0, 0.0, 1.0,
>  					    &data->fb_overlay);
> 
>  			igt_plane_set_fb(sprite, &data->fb_overlay);
> +			igt_fb_set_position(&data->fb_overlay, sprite, x, y);
> +			igt_fb_set_size(&data->fb_overlay, primary, view_w,
> +					view_h);
> +			igt_plane_set_size(sprite, view_w, view_h);
>  			igt_plane_set_prop_value(sprite, IGT_PLANE_ALPHA,
>  						 0x6060);
>  		}
> @@ -349,7 +366,11 @@ static void prepare(data_t *data)
>  	}
> 
>  	igt_plane_set_fb(primary, &data->fb_primary);
> -
> +	igt_fb_set_position(&data->fb_primary, primary, x, y);
> +	igt_fb_set_size(&data->fb_overlay, primary, view_w,
> +			view_h);
> +	igt_plane_set_size(primary, view_w, view_h);
> +	igt_plane_set_position(primary, 0, 0);
>  	igt_display_commit2(&data->display, COMMIT_ATOMIC);  }
> 
> @@ -515,14 +536,27 @@ static void damaged_plane_move(data_t *data)
>  	igt_plane_t *test_plane = data->test_plane;
>  	uint32_t h = data->mode->hdisplay;
>  	uint32_t v = data->mode->vdisplay;
> +	int x, y;
> 
> -	igt_plane_set_fb(test_plane, &data->fb_test);
> +	if (data->big_fb_test) {
> +		x = data->big_fb_width / 2;
> +		y = data->big_fb_height / 2;
> +	} else {
> +		x = y = 0;
> +	}
> 
>  	if (data->test_plane_id == DRM_PLANE_TYPE_OVERLAY) {
>  		h = h/2;
>  		v = v/2;
>  	}
> 
> +	igt_plane_set_fb(test_plane, &data->fb_test);
> +
> +	igt_fb_set_position(&data->fb_test, test_plane, x,
> +			    y);
> +	igt_fb_set_size(&data->fb_test, test_plane, h, v);
> +	igt_plane_set_size(test_plane, h, v);
> +
>  	igt_plane_replace_prop_blob(test_plane,
> IGT_PLANE_FB_DAMAGE_CLIPS,
>  				    &data->plane_move_clip,
>  				    sizeof(struct drm_mode_rect));
> @@ -677,6 +711,14 @@ static void damaged_plane_update(data_t *data)
>  	igt_plane_t *test_plane = data->test_plane;
>  	uint32_t h = data->mode->hdisplay;
>  	uint32_t v = data->mode->vdisplay;
> +	int x, y;
> +
> +	if (data->big_fb_test) {
> +		x = data->big_fb_width / 2;
> +		y = data->big_fb_height / 2;
> +	} else {
> +		x = y = 0;
> +	}
> 
>  	if (data->test_plane_id == DRM_PLANE_TYPE_OVERLAY) {
>  		h = h/2;
> @@ -701,6 +743,9 @@ static void damaged_plane_update(data_t *data)
>  						    data->damage_area_count);
>  	}
> 
> +	igt_fb_set_position(data->fb_continuous, test_plane, x, y);
> +	igt_fb_set_size(data->fb_continuous, test_plane, h, v);
> +	igt_plane_set_size(test_plane, h, v);
>  	igt_plane_set_position(data->test_plane, 0, 0);
>  	igt_display_commit2(&data->display, COMMIT_ATOMIC);
> 
> @@ -786,6 +831,7 @@ igt_main
>  	int i;
> 
>  	igt_fixture {
> +		drmModeResPtr res;
>  		int r;
> 
>  		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> @@ -807,6 +853,12 @@ igt_main
>  		data.op = PLANE_UPDATE;
>  		data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
>  		data.primary_format = DRM_FORMAT_XRGB8888;
> +
> +		res = drmModeGetResources(data.drm_fd);
> +		data.big_fb_width = res->max_width;
> +		data.big_fb_height = res->max_height;
> +		igt_info("Big framebuffer size %dx%d\n",
> +			 data.big_fb_width, data.big_fb_height);
>  		prepare(&data);
>  		r = psr_wait_entry(data.debugfs_fd, PSR_MODE_2);
>  		if (!r)
> @@ -832,6 +884,20 @@ igt_main
>  		}
>  	}
> 
> +	/* Verify primary plane selective fetch with big fb */
> +	data.big_fb_test = 1;
> +	igt_describe("Test that selective fetch works on primary plane with big
> fb");
> +	igt_subtest_f("primary-%s-sf-dmg-area-big-fb", op_str(data.op)) {
> +		for (i = 1; i <= MAX_DAMAGE_AREAS; i++) {
> +			data.damage_area_count = i;
> +			data.test_plane_id = DRM_PLANE_TYPE_PRIMARY;
> +			prepare(&data);
> +			run(&data);
> +			cleanup(&data);
> +		}
> +	}
> +	data.big_fb_test = 0;
> +
>  	/* Verify overlay plane selective fetch */
>  	igt_describe("Test that selective fetch works on overlay plane");
>  	igt_subtest_f("overlay-%s-sf-dmg-area", op_str(data.op)) {
> --
> 2.25.1


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

end of thread, other threads:[~2022-05-18 10:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  7:11 [igt-dev] [PATCH i-g-t 0/3] Testcases for selective fetch area calculation Jouni Högander
2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_psr2_sf: Move continuous testcase preparation for new tests Jouni Högander
2022-05-18 10:35   ` Kahola, Mika
2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_psr2_sf: Add new move continuous testcases Jouni Högander
2022-05-18 10:36   ` Kahola, Mika
2022-05-06  7:11 ` [igt-dev] [PATCH i-g-t 3/3] tests/i915/kms_psr2_sf: add sel fetch/big fb test Jouni Högander
2022-05-18 10:36   ` Kahola, Mika
2022-05-06  9:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Testcases for selective fetch area calculation Patchwork
2022-05-06 12:09 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.