summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_request.c
diff options
context:
space:
mode:
authorChris Wilson2018-01-24 12:36:07 +0100
committerChris Wilson2018-01-24 16:28:05 +0100
commit6f56103d7e95f96568a460493ff6c0ced45f538b (patch)
tree5c9a75b671b256df69711adabf460101c046aeed /drivers/gpu/drm/i915/i915_gem_request.c
parentdrm/i915/execlists: Inhibit context save/restore for the fake preempt context (diff)
downloadkernel-qcow2-linux-6f56103d7e95f96568a460493ff6c0ced45f538b.tar.gz
kernel-qcow2-linux-6f56103d7e95f96568a460493ff6c0ced45f538b.tar.xz
kernel-qcow2-linux-6f56103d7e95f96568a460493ff6c0ced45f538b.zip
drm/i915: Track the number of times we have woken the GPU up
By counting the number of times we have woken up, we have a very simple means of defining an epoch, which will come in handy if we want to perform deferred tasks at the end of an epoch (i.e. while we are going to sleep) without imposing on the next activity cycle. v2: No reason to specify precise number of bits here. v3: Take Tvrtko's advice and reserve 0 as an invalid epoch. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180124113608.14909-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index a0f451b4a4e8..06ec27a68f5c 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -274,6 +274,8 @@ static void mark_busy(struct drm_i915_private *i915)
intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
i915->gt.awake = true;
+ if (unlikely(++i915->gt.epoch == 0)) /* keep 0 as invalid */
+ i915->gt.epoch = 1;
intel_enable_gt_powersave(i915);
i915_update_gfx_val(i915);