]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm/i915: Keep the forcewake timer alive for 1ms past the most recent use
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 26 May 2017 13:22:09 +0000 (14:22 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 26 May 2017 14:58:21 +0000 (15:58 +0100)
commitc9e0c6da53231f685d7dbd3d420483e1ede212e2
treeaf1a28c3fbab35e62418c7a05929fe436cc9679a
parentac58d2ab0ad9c8b7e41404048a3ba4375db012d3
drm/i915: Keep the forcewake timer alive for 1ms past the most recent use

Currently the timer is armed for 1ms after the first use and is killed
immediately, dropping the forcewake as early as possible. However, for
very frequent operations the forcewake dance has a large impact on
latency and keeping the timer alive until we are idle is preferred. To
achieve this, if we call intel_uncore_forcewake_get whilst the timer is
alive (repeated use), then set a flag to restart the timer on expiry
rather than drop the forcewake usage count. The timer is racy, the
consequence of the race is to expire the timer earlier than is now
desired but does not impact on correct behaviour. The offset the race
slightly, we set the active flag again on intel_uncore_forcewake_put.

The effect should be to reduce the jitter of reacquiring the fw every
1ms on a busy system. However, the cost is to keep the timer alive for
an extra 1ms on a nearly idle system. We chose to incur the jitter
previously to keep the timer off for as much as possible.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170526132209.14640-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/intel_uncore.c
drivers/gpu/drm/i915/intel_uncore.h