OSDN Git Service

drm/i915/selftests: Rearrange ktime_get to reduce latency against CS
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Jan 2021 20:40:22 +0000 (20:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Jan 2021 21:35:54 +0000 (21:35 +0000)
commit0399d0e33a649a77c81a8bd2b2c5831608a489b6
tree68c48b6f07c3f7c7c873508ea3ca7e542aca9530
parentc318a203eade42cae639b2bc50c95d1f7d132db4
drm/i915/selftests: Rearrange ktime_get to reduce latency against CS

In our tests where we measure the elapsed time on both the CPU and CS
using a udelay, our CS results match the udelay much more accurately
than the ktime (even when using ktime_get_fast_ns). With preemption
disabled, we can go one step lower than ktime and use local_clock.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2919
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210108204026.20682-3-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/selftest_engine_pm.c