Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 4/4] kms_flip: add subtests for the DPMS OFF->modeset->flip sequence
Date: Wed, 22 May 2013 17:40:48 +0300	[thread overview]
Message-ID: <1369233648-5873-4-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1369233648-5873-1-git-send-email-imre.deak@intel.com>

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@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

  parent reply	other threads:[~2013-05-22 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 14:40 [PATCH 1/4] lib: fix exit handler when multiple handlers are registered Imre Deak
2013-05-22 14:40 ` [PATCH 2/4] lib: export the exit handler interface Imre Deak
2013-05-22 14:40 ` [PATCH 3/4] kms_flip: do a DPMS ON when exiting with error Imre Deak
2013-05-22 14:40 ` Imre Deak [this message]
2013-05-22 16:18   ` [PATCH 4/4] kms_flip: add subtests for the DPMS OFF->modeset->flip sequence Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369233648-5873-4-git-send-email-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox