diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-25 12:17:23 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2015-06-25 17:22:04 +0100 |
commit | efd2895f2380bf87f6821e3ab89005070e9d1925 (patch) | |
tree | 31b3542e8d05793f1566faae6a8a5a0bb91c10a0 /tools/skl_compute_wrpll.c | |
parent | 06f5f7065fccc5fbb9f65f6f7d348624e2fa0d2b (diff) |
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 <damien.lespiau@intel.com>
Diffstat (limited to 'tools/skl_compute_wrpll.c')
-rw-r--r-- | tools/skl_compute_wrpll.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 <stdlib.h> #include <string.h> +#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) |