[PATCH i-g-t] tests/kms_psr2_sf: Add new move continuous testcase

Jouni Högander jouni.hogander at intel.com
Tue May 3 11:23:50 UTC 2022


This testcase is moving cursor on half bottom of screen.
Intention is to find a way to reproduce
https://gitlab.freedesktop.org/drm/intel/-/issues/5440

Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
 tests/i915/kms_psr2_sf.c | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c
index d4cddb62..454769c2 100644
--- a/tests/i915/kms_psr2_sf.c
+++ b/tests/i915/kms_psr2_sf.c
@@ -45,6 +45,7 @@ enum operations {
 	PLANE_UPDATE_CONTINUOUS,
 	PLANE_MOVE,
 	PLANE_MOVE_CONTINUOUS,
+	PLANE_MOVE_CONTINUOUS_BOTTOM_HALF,
 	OVERLAY_PRIM_UPDATE
 };
 
@@ -55,6 +56,8 @@ enum plane_move_postion {
 	POS_BOTTOM_RIGHT,
 	POS_BOTTOM_LEFT_NEGATIVE,
 	POS_TOP_RIGHT_NEGATIVE,
+	POS_CENTER,
+	POS_BOTTOM_EXCEED,
 };
 
 typedef struct {
@@ -86,6 +89,7 @@ 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_BOTTOM_HALF] = "plane-move-continuous-bottom-half",
 		[PLANE_MOVE] = "plane-move",
 		[OVERLAY_PRIM_UPDATE] = "overlay-primary-update",
 	};
@@ -440,6 +444,14 @@ static void plane_move_continuous_expected_output(enum plane_move_postion pos)
 		sprintf(expected,
 			"screen Green with Blue box on top right corner (partly exceeding area)");
 		break;
+	case POS_CENTER:
+		sprintf(expected,
+			"screen Green with Blue box on center");
+		break;
+	case POS_BOTTOM_EXCEED:
+		sprintf(expected,
+			"screen Green. Blue box exceeded fully area I.e. not visible");
+		break;
 	default:
 		igt_assert(false);
 	}
@@ -466,6 +478,7 @@ static void expected_output(data_t *data)
 		plane_move_expected_output(data->pos);
 		break;
 	case PLANE_MOVE_CONTINUOUS:
+	case PLANE_MOVE_CONTINUOUS_BOTTOM_HALF:
 		plane_move_continuous_expected_output(data->pos);
 		break;
 	case PLANE_UPDATE:
@@ -560,6 +573,14 @@ static void plane_move_continuous(data_t *data)
 		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_EXCEED:
+		target_x = 0;
+		target_y = data->mode->vdisplay ;
+		break;
 	default:
 		igt_assert(false);
 	}
@@ -650,10 +671,17 @@ 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_BOTTOM_EXCEED; i++) {
 			data->pos = i;
 			plane_move_continuous(data);
 		}
+	case PLANE_MOVE_CONTINUOUS_BOTTOM_HALF:
+		for (i = 0; i <= 10; i++) {
+			data->pos = POS_CENTER;
+			plane_move_continuous(data);
+			data->pos = POS_BOTTOM_EXCEED;
+			plane_move_continuous(data);
+		}
 		break;
 	default:
 		igt_assert(false);
@@ -773,6 +801,15 @@ igt_main
 		cleanup(&data);
 	}
 
+	data.op = PLANE_MOVE_CONTINUOUS_BOTTOM_HALF;
+	igt_describe("Test that selective fetch works on cursor plane moving in bottom half (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 */
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list