summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-11-20 15:09:56 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2020-11-24 14:12:36 +0000
commit08b13995b85df26a77212e4fb21fd772976ef33c (patch)
treea3c39c2e6999aae70d02b17e4778d4b06e0c2442 /tests
parent50361845e873bb2c7820d3eace1add980c420067 (diff)
tests/kms_setmode: Ignore small deviations between vblank and mode
Since we only expect our vblank timings to be accurate to within a scanline, ignore any deviation between the measured interval and the expected interval derived from the modeline if it is less than a single scanline. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: "Ram Moon, AnandX" <anandx.ram.moon@intel.com> Tested-by: "Ram Moon, AnandX" <anandx.ram.moon@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_setmode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index a01010a1..878e149a 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -525,10 +525,12 @@ static void check_timings(int crtc_idx, const drmModeModeInfo *kmode)
* See:
* https://en.wikipedia.org/wiki/Standard_deviation#Rules_for_normally_distributed_data
*/
- igt_assert_f(fabs(mean - expected) < 1.718 * stddev,
- "vblank interval differs from modeline! expected %.1fus, measured %1.fus +- %.3fus, difference %.1fus (%.1f sigma)\n",
+ igt_assert_f(fabs(mean - expected) < max(line_time(kmode), 1.718 * stddev),
+ "vblank interval differs from modeline! expected %.1fus, measured %1.fus +- %.3fus, difference %.1fus (%.1f sigma, %.1f scanlines)\n",
expected, mean, stddev,
- fabs(mean - expected), fabs(mean - expected) / stddev);
+ fabs(mean - expected),
+ fabs(mean - expected) / stddev,
+ fabs(mean - expected) / line_time(kmode));
}
static void test_crtc_config(const struct test_config *tconf,