From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: [i-g-t PATCH 2/4] flip_test: skip check for last_received_ts for the first event Date: Thu, 22 Nov 2012 15:25:04 +0200 Message-ID: <1353590706-1366-3-git-send-email-imre.deak@intel.com> References: <1353590706-1366-1-git-send-email-imre.deak@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga14.intel.com (mga14.intel.com [143.182.124.37]) by gabe.freedesktop.org (Postfix) with ESMTP id 62E47E5ED7 for ; Thu, 22 Nov 2012 05:25:12 -0800 (PST) In-Reply-To: <1353590706-1366-1-git-send-email-imre.deak@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org The old way worked too, but just skipping the test for the first event is more logical/simpler thing to do. Signed-off-by: Imre Deak --- tests/flip_test.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/flip_test.c b/tests/flip_test.c index 3dfce8e..e2af358 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -362,6 +362,9 @@ static void check_state(struct test_output *o, struct event_state *es) exit(5); } + if (es->count == 0) + return; + if (!timercmp(&es->last_received_ts, &es->current_ts, <)) { fprintf(stderr, "%s ts before the %s was issued!\n", es->name, es->name); @@ -372,9 +375,6 @@ static void check_state(struct test_output *o, struct event_state *es) exit(6); } - if (es->count == 0) - return; - /* This bounding matches the one in DRM_IOCTL_WAIT_VBLANK. */ if (es->current_seq - (es->last_seq + es->seq_step) > 1UL << 23) { fprintf(stderr, "unexpected %s seq %u, should be >= %u\n", @@ -862,9 +862,6 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration) if (o->flags & TEST_CHECK_TS) sleep(1); - gettimeofday(&o->flip_state.last_ts, NULL); - gettimeofday(&o->vblank_state.last_ts, NULL); - if (do_page_flip(o, o->fb_ids[1])) { fprintf(stderr, "failed to page flip: %s\n", strerror(errno)); exit(4); -- 1.7.9.5