All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [i-g-t][PATCH 1/2] kms_flip: Make flip events optional
Date: Wed, 30 Jan 2013 14:52:23 +0200	[thread overview]
Message-ID: <1359550344-14761-2-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1359550344-14761-1-git-send-email-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Pass an argument to do_page_flip() telling it whether to request flip
events.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_flip.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 61fe6a0..97bd145 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -223,13 +223,13 @@ static void clear_flag(unsigned int *v, unsigned int flag)
 	*v &= ~flag;
 }
 
-static int do_page_flip(struct test_output *o, int fb_id)
+static int do_page_flip(struct test_output *o, int fb_id, bool event)
 {
 	int ret;
 
-	ret = drmModePageFlip(drm_fd, o->crtc, fb_id, DRM_MODE_PAGE_FLIP_EVENT,
-				o);
-	if (ret == 0)
+	ret = drmModePageFlip(drm_fd, o->crtc, fb_id, event ? DRM_MODE_PAGE_FLIP_EVENT : 0,
+				event ? o : NULL);
+	if (ret == 0 && event)
 		set_flag(&o->pending_events, EVENT_FLIP);
 
 	return ret;
@@ -544,7 +544,7 @@ static unsigned int run_test_step(struct test_output *o)
 	}
 
 	if (do_flip && (o->flags & TEST_EINVAL) && o->flip_state.count > 0)
-		assert(do_page_flip(o, new_fb_id) == expected_einval);
+		assert(do_page_flip(o, new_fb_id, true) == expected_einval);
 
 	if (do_vblank && (o->flags & TEST_EINVAL) && o->vblank_state.count > 0)
 		assert(do_wait_for_vblank(o, o->pipe, target_seq, &vbl_reply)
@@ -567,7 +567,7 @@ static unsigned int run_test_step(struct test_output *o)
 	printf("."); fflush(stdout);
 
 	if (do_flip)
-		do_or_die(do_page_flip(o, new_fb_id));
+		do_or_die(do_page_flip(o, new_fb_id, true));
 
 	if (do_vblank) {
 		do_or_die(do_wait_for_vblank(o, o->pipe, target_seq,
@@ -581,7 +581,7 @@ static unsigned int run_test_step(struct test_output *o)
 	}
 
 	if (do_flip && (o->flags & TEST_EBUSY))
-		assert(do_page_flip(o, new_fb_id) == -EBUSY);
+		assert(do_page_flip(o, new_fb_id, true) == -EBUSY);
 
 	if (do_flip && (o->flags & TEST_RMFB))
 		recreate_fb(o);
@@ -621,7 +621,7 @@ static unsigned int run_test_step(struct test_output *o)
 		       == -EINVAL);
 
 	if (do_flip && (o->flags & TEST_EINVAL))
-		assert(do_page_flip(o, new_fb_id) == expected_einval);
+		assert(do_page_flip(o, new_fb_id, true) == expected_einval);
 
 	return completed_events;
 }
@@ -907,7 +907,7 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration)
 	if (o->flags & TEST_CHECK_TS)
 		sleep(1);
 
-	if (do_page_flip(o, o->fb_ids[1])) {
+	if (do_page_flip(o, o->fb_ids[1], true)) {
 		fprintf(stderr, "failed to page flip: %s\n", strerror(errno));
 		exit(4);
 	}
-- 
1.7.12.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2013-01-30 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 12:52 [i-g-t][PATCH 0/2] Test for page flip hangs ville.syrjala
2013-01-30 12:52 ` ville.syrjala [this message]
2013-01-30 12:52 ` [i-g-t][PATCH 2/2] kms_flip: Add flip-vs-modeset-vs-hang test ville.syrjala
2013-01-30 15:06 ` [i-g-t][PATCH 0/2] Test for page flip hangs Daniel Vetter
2013-01-30 15:06 ` 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=1359550344-14761-2-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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 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.