drm/i915: Read actual GPU frequency from MEMSTAT_ILK on ILK
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 21 Oct 2020 13:14:40 +0000 (16:14 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 21 Oct 2020 20:19:36 +0000 (23:19 +0300)
commite82351e74dcfc76c0f4241b5dbf8ee7c0ceb22be
treeb9ef6a96ccab0795159508cdd29855aa641b38f8
parent2bf06370bcfb0dea5655e9a5ad460c7f7dca7739
drm/i915: Read actual GPU frequency from MEMSTAT_ILK on ILK

There is no GEN6_RPSTAT1 on ILK. Instead of reading that let's
try to get the same information from MEMSTAT_ILK. At least it
seems to track MEMSWCTL frequency request perfectly on my ILK.
It needs the same invert trick as the request value.

We don't want to put the invert thing into intel_gpu_freq()
and intel_freq_opcode() because that would incorrectly invert
the min/max/etc frequencies also.

One day someone might want to reverse engineer the formula for
converting these numbers to Hz, but for now we'll just report
them raw.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201021131443.25616-2-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/gt/intel_rps.c