From efd2895f2380bf87f6821e3ab89005070e9d1925 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Thu, 25 Jun 2015 12:17:23 +0100 Subject: skl_compute_wrpll: Print the average deviation 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(+) (limited to 'tools/skl_compute_wrpll.c') diff --git a/tools/skl_compute_wrpll.c b/tools/skl_compute_wrpll.c index 55f2df4c..be4fc26d 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) -- cgit v1.2.3