summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Moon <anandx.ram.moon@intel.com>2020-11-02 09:02:43 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-03 16:31:33 +0000
commitb6247cc06d76b48ec2a3a0b13ffbd25aec8a42ff (patch)
tree1f98524a2803394167cc21e33531ec6fde7afce3
parent12d370cb57e0cfcb781c87ad9e15e68b17a1f41f (diff)
tests/kms_setmode: basic Improve accuracy with using of confidence interval
Using confidence interval formula accuracy is estimates approximately at 95% when {X} is the average of a sample of size n. Use this confidence interval formula as used in statistics to estimate the accuracy. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/31 Cc: Dorota Czaplejewicz <dorota.czaplejewicz@collabora.co.uk> Signed-off-by: Anand Moon <anandx.ram.moon@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/igt_stats.c11
-rw-r--r--lib/igt_stats.h1
-rw-r--r--tests/kms_setmode.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/lib/igt_stats.c b/lib/igt_stats.c
index 0fbf712c..e0859a03 100644
--- a/lib/igt_stats.c
+++ b/lib/igt_stats.c
@@ -550,6 +550,17 @@ double igt_stats_get_std_deviation(igt_stats_t *stats)
}
/**
+ * igt_stats_get_std_error:
+ * @stats: An #igt_stats_t instance
+ *
+ * Retrieves the standard error of the mean from the @stats dataset.
+ */
+double igt_stats_get_std_error(igt_stats_t *stats)
+{
+ return igt_stats_get_std_deviation(stats) / sqrt(stats->n_values);
+}
+
+/**
* igt_stats_get_iqm:
* @stats: An #igt_stats_t instance
*
diff --git a/lib/igt_stats.h b/lib/igt_stats.h
index 5faeced4..e8ee5a58 100644
--- a/lib/igt_stats.h
+++ b/lib/igt_stats.h
@@ -81,6 +81,7 @@ double igt_stats_get_trimean(igt_stats_t *stats);
double igt_stats_get_median(igt_stats_t *stats);
double igt_stats_get_variance(igt_stats_t *stats);
double igt_stats_get_std_deviation(igt_stats_t *stats);
+double igt_stats_get_std_error(igt_stats_t *stats);
/**
* igt_mean:
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 92f3ead2..928a5a8c 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -494,7 +494,7 @@ static void check_timings(int crtc_idx, const drmModeModeInfo *kmode)
* which depend on timing, giving the lowest acceptable MTBF of 5.6s
* for 60Hz sampling rate.
*/
- accuracy = 3. * stddev;
+ accuracy = 3. * igt_stats_get_std_error(&stats);
igt_info("Expected frametime: %.0fus; measured %.1fus +- %.3fus accuracy %.2f%% [%.2f scanlines]\n",
expected, mean, stddev,