]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
drm/i915/pmu: Do not assume fixed hrtimer period
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 5 Jun 2018 14:02:53 +0000 (15:02 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Tue, 5 Jun 2018 15:45:01 +0000 (16:45 +0100)
commit9f473ecfe7a8520de359ed20bf95a1628e85e650
tree32c1db12cd4c82eee459e9060d1da3a3080554bc
parent57d7116c472cd32ab167f208e1dec100596ce949
drm/i915/pmu: Do not assume fixed hrtimer period

As Chris has discovered on his Ivybridge, and later automated test runs
have confirmed, on most of our platforms hrtimer faced with heavy GPU load
can occasionally become sufficiently imprecise to affect PMU sampling
calculations.

This means we cannot assume sampling frequency is what we asked for, but
we need to measure the interval ourselves.

This patch is similar to Chris' original proposal for per-engine counters,
but instead of introducing a new set to work around the problem with
frequency sampling, it swaps around the way internal frequency accounting
is done. Instead of accumulating current frequency and dividing by
sampling frequency on readout, it accumulates frequency scaled by each
period.

v2:
 * Typo in commit message, comment on period calculation and USEC_PER_SEC.
   (Chris Wilson)

Testcase: igt/perf_pmu/*busy* # snb, ivb, hsw
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180605140253.3541-1-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/i915_pmu.c
drivers/gpu/drm/i915/i915_pmu.h