[PATCH 4/4] kms_flip: add subtests for the DPMS OFF->modeset->flip sequence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a double buffer and a single buffer version of the above sequence,
to check if the modeset does a DPMS ON.

Tested on IVB, with and without the relevant kernel fix, got the
expected results.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 tests/kms_flip.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 83293ba..735b4dd 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -62,6 +62,8 @@
 #define TEST_HANG		(1 << 14)
 #define TEST_NOEVENT		(1 << 15)
 #define TEST_FB_BAD_TILING	(1 << 16)
+#define TEST_SINGLE_BUFFER	(1 << 17)
+#define TEST_DPMS_OFF		(1 << 18)
 
 #define EVENT_FLIP		(1 << 0)
 #define EVENT_VBLANK		(1 << 1)
@@ -678,7 +680,9 @@ static unsigned int run_test_step(struct test_output *o)
 		emit_dummy_load(o);
 
 
-	o->current_fb_id = !o->current_fb_id;
+	if (!(o->flags & TEST_SINGLE_BUFFER))
+		o->current_fb_id = !o->current_fb_id;
+
 	if (o->flags & TEST_FB_RECREATE)
 		recreate_fb(o);
 	new_fb_id = o->fb_ids[o->current_fb_id];
@@ -712,6 +716,9 @@ static unsigned int run_test_step(struct test_output *o)
 		assert(do_wait_for_vblank(o, o->pipe, target_seq, &vbl_reply)
 		       == -EINVAL);
 
+	if (o->flags & TEST_DPMS_OFF)
+		do_or_die(set_dpms(o, DRM_MODE_DPMS_OFF));
+
 	if (o->flags & TEST_MODESET) {
 		if (drmModeSetCrtc(drm_fd, o->crtc,
 				   o->fb_ids[o->current_fb_id],
@@ -1218,6 +1225,11 @@ int main(int argc, char **argv)
 		{ 15, TEST_FLIP | TEST_MODESET | TEST_HANG | TEST_NOEVENT, "flip-vs-modeset-vs-hang" },
 		{ 15, TEST_FLIP | TEST_PAN | TEST_HANG, "flip-vs-panning-vs-hang" },
 		{ 1, TEST_FLIP | TEST_EINVAL | TEST_FB_BAD_TILING, "flip-vs-bad-tiling" },
+
+		{ 1, TEST_DPMS_OFF | TEST_MODESET | TEST_FLIP,
+					"flip-vs-dpms-off-vs-modeset" },
+		{ 1, TEST_DPMS_OFF | TEST_MODESET | TEST_FLIP | TEST_SINGLE_BUFFER,
+					"single-buffer-flip-vs-dpms-off-vs-modeset" },
 	};
 	int i;
 
-- 
1.8.1.2



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux