drm/i915/selftest: Fix engine timestamp and ktime disparity
authorAnshuman Gupta <anshuman.gupta@intel.com>
Thu, 23 Feb 2023 10:05:02 +0000 (15:35 +0530)
committerAnshuman Gupta <anshuman.gupta@intel.com>
Fri, 3 Mar 2023 14:06:33 +0000 (19:36 +0530)
commit29b41cf707b5ecc55cab12bfa04fbd9811f4fd04
treeeae917be5969dbdea2578f739e0414ff800ae569
parent506006055769b10d1b2b4e22f636f3b45e0e9fc7
drm/i915/selftest: Fix engine timestamp and ktime disparity

While reading the engine timestamps there can be uncontrollable
concurrent mmio access via other i915 child drivers and by GuC,
which is not truly atomic context as expected by this selftest,
which may cause mmio latency to read the engine timestamps,
Account such latency to calculate time to read engine timestamp
such that selftest can validate the timestamp and ktime pair.

Cc: Chris Wilson <chris.p.wilson@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Reviewed-by: Badal Nilawar <badal.nilawar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230223100503.3323627-2-anshuman.gupta@intel.com
drivers/gpu/drm/i915/gt/selftest_gt_pm.c
drivers/gpu/drm/i915/gt/selftest_rps.c