From patchwork Thu Jun 25 15:21:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 6676021 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 392809F380 for ; Thu, 25 Jun 2015 15:21:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65D0A206D4 for ; Thu, 25 Jun 2015 15:21:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7AF59206CB for ; Thu, 25 Jun 2015 15:21:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9B9D6EC54; Thu, 25 Jun 2015 08:21:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DFDB6EC54 for ; Thu, 25 Jun 2015 08:21:47 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 25 Jun 2015 08:21:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,677,1427785200"; d="scan'208";a="717572037" Received: from unknown (HELO strange.ger.corp.intel.com) ([10.252.34.49]) by orsmga001.jf.intel.com with ESMTP; 25 Jun 2015 08:21:46 -0700 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Thu, 25 Jun 2015 16:21:41 +0100 Message-Id: <1435245703-31083-2-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435245703-31083-1-git-send-email-damien.lespiau@intel.com> References: <1435245703-31083-1-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/4] skl_compute_wrpll: Print the average deviation 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 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 It's interesting to watch the effect of some algorithm tweaks on the average deviation between the central freq and the dco freq. A metric we'd like to minimize. Signed-off-by: Damien Lespiau --- tools/skl_compute_wrpll.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/skl_compute_wrpll.c b/tools/skl_compute_wrpll.c index 55f2df4..be4fc26 100644 --- a/tools/skl_compute_wrpll.c +++ b/tools/skl_compute_wrpll.c @@ -29,6 +29,8 @@ #include #include +#include "igt_stats.h" + #define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) #define WARN(cond, msg) printf(msg) @@ -844,6 +846,9 @@ static void test_run(struct test_ops *test) { unsigned int m; unsigned p_odd_even[2] = { 0, 0 }; + igt_stats_t stats; + + igt_stats_init(&stats, ARRAY_SIZE(modes)); for (m = 0; m < ARRAY_SIZE(modes); m++) { struct skl_wrpll_params params = {}; @@ -871,6 +876,8 @@ static void test_run(struct test_ops *test) diff = abs_diff(dco_freq, central_freq); deviation = div64_u64(10000 * diff, central_freq); + igt_stats_push(&stats, deviation); + if (dco_freq > central_freq) { if (deviation > 100) printf("failed constraint for %dHz " @@ -892,6 +899,9 @@ static void test_run(struct test_ops *test) } printf("even/odd dividers: %d/%d\n", p_odd_even[0], p_odd_even[1]); + printf("average deviation: %.2lf\n", igt_stats_get_average(&stats)); + + igt_stats_fini(&stats); } int main(int argc, char **argv)