From patchwork Thu Oct 22 20:35:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 7467721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 546909F1C3 for ; Thu, 22 Oct 2015 20:35:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 75E902053B for ; Thu, 22 Oct 2015 20:35:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9C96C20451 for ; Thu, 22 Oct 2015 20:35:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24B496E56F; Thu, 22 Oct 2015 13:35:50 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AC8A6E56F for ; Thu, 22 Oct 2015 13:35:49 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2015 13:35:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,184,1444719600"; d="scan'208";a="800533608" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga001.jf.intel.com with SMTP; 22 Oct 2015 13:35:47 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 22 Oct 2015 23:35:46 +0300 From: ville.syrjala@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 22 Oct 2015 23:35:39 +0300 Message-Id: <1445546140-20513-3-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.4.9 In-Reply-To: <1445546140-20513-1-git-send-email-ville.syrjala@linux.intel.com> References: <1445546140-20513-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t 3/4] tests/kms_flip: Improve the accuracy of out frame time calculation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Don't use the rounded vrefresh info to predict the frame duration. Instead calculate if from the clock. Signed-off-by: Ville Syrjälä --- tests/kms_flip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/kms_flip.c b/tests/kms_flip.c index a139d40..48e9062 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -547,7 +547,7 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, static double frame_time(struct test_output *o) { - return 1000.0 * 1000.0 / o->kmode[0].vrefresh; + return 1000.0 * o->kmode[0].htotal * o->kmode[0].vtotal / o->kmode[0].clock; } static void *vblank_wait_thread_func(void *data) @@ -1209,7 +1209,7 @@ static void check_final_state(struct test_output *o, struct event_state *es, int count = es->count; count *= o->seq_step; - expected = elapsed * o->kmode[0].vrefresh / (1000 * 1000); + expected = elapsed / frame_time(o); igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100, "dropped frames, expected %d, counted %d, encoder type %d\n", expected, count, o->kencoder[0]->encoder_type);