drm/i915/selftests: Confirm CS_TIMESTAMP / CTX_TIMESTAMP share a clock
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Dec 2020 12:23:58 +0000 (12:23 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Dec 2020 21:10:40 +0000 (21:10 +0000)
commit8391c9b28cbfcf371ce8ebfcf2d62e08a2ea7619
tree970bc0607d466659f78018d6ee1f0f0cb0025a66
parent57f62622c3fba5200d8906446825d14b62ba0c07
drm/i915/selftests: Confirm CS_TIMESTAMP / CTX_TIMESTAMP share a clock

We assume that both timestamps are driven off the same clock [reported
to userspace as I915_PARAM_CS_TIMESTAMP_FREQUENCY]. Verify that this is
so by reading the timestamp registers around a busywait (on an otherwise
idle engine so there should be no preemptions).

v2: Icelake (not ehl, nor tgl) seems to be using a fixed 80ns interval
for, and only for, CTX_TIMESTAMP -- or it may be GPU frequency and the
test is always running at maximum frequency?. As far as I can tell, this
isolated change in behaviour is undocumented.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201223122359.22562-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/selftest_engine_pm.c