drm/i915/pmu: Wire up engine busy stats to PMU
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 21 Nov 2017 18:18:49 +0000 (18:18 +0000)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 22 Nov 2017 11:25:03 +0000 (11:25 +0000)
commitb3add01ee217db8e0da8a6596f03c487ed33b06e
tree8af64bf9351880561851738b501eb0abf6cd58d2
parent30e17b7847f54732a91e5804144d445e9f29493b
drm/i915/pmu: Wire up engine busy stats to PMU

We can use engine busy stats instead of the sampling timer for
better accuracy.

By doing this we replace the stohastic sampling with busyness
metric derived directly from engine activity. This is context
switch interrupt driven, so as accurate as we can get from
software tracking.

As a secondary benefit, we can also not run the sampling timer
in cases only busyness metric is enabled.

v2: Rebase.
v3:
 * Rebase, comments.
 * Leave engine busyness controls out of workers.
v4: Checkpatch cleanup.
v5: Added comment to pmu_needs_timer change.
v6:
 * Rebase.
 * Fix style of some comments. (Chris Wilson)
v7: Rebase and commit message update. (Chris Wilson)
v8: Add delayed stats disabling to improve accuracy in face of
    CPU hotplug events.
v9: Rebase.
v10: Rebase - i915_modparams.enable_execlists removal.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171121181852.16128-6-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/intel_ringbuffer.h