drm/i915: Flush the RPS bottom-half when the GPU idles
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Jul 2016 07:08:36 +0000 (08:08 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 4 Jul 2016 07:18:23 +0000 (08:18 +0100)
commitc33d247d0e31df48ada35d71d1dc7830a4bb4314
treeb22499081cad34cb21eb27ffa990a833ebf22db4
parentdf4ba5099f80dac5f822c22937c37860ddd8e434
drm/i915: Flush the RPS bottom-half when the GPU idles

Make sure that the RPS bottom-half is flushed before we set the idle
frequency when we decide the GPU is idle. This should prevent any races
with the bottom-half and setting the idle frequency, and ensures that
the bottom-half is bounded by the GPU's rpm reference taken for when it
is active (i.e. between gen6_rps_busy() and gen6_rps_idle()).

v2: Avoid recursively using the i915->wq - RPS does not touch the
struct_mutex so has no place being on the ordered i915->wq.
v3: Enable/disable interrupts for RPS busy/idle in order to prevent
further HW access from RPS outside of the wakeref.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
References: https://bugs.freedesktop.org/show_bug.cgi?id=89728
Reviewed-by: MichaƂ Winiarski <michal.winiarski@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1467616119-4093-6-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_pm.c