diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-17 16:59:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-18 11:44:20 +0100 |
commit | 4c9655436522eaf4ba35572851150ccb71f3866e (patch) | |
tree | 093957c23972628674a5da9a9876ff89d9bf8993 /drivers/gpu/drm/i915/i915_gem.c | |
parent | drm/i915/psr: Fix compiler warnings for hsw_psr_disable() (diff) | |
download | linux-4c9655436522eaf4ba35572851150ccb71f3866e.tar.xz linux-4c9655436522eaf4ba35572851150ccb71f3866e.zip |
drm/i915: Move engine reset preparation to i915_gem_reset_prepare()
Now that we have prepare/finish routines for the GEM reset, move the
disabling of the engine->irq_tasklet into them to reduce repetition. The
device irq enable/disable is split out to ensure it is run first and
last always (even if the GPU reset fails).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484668747-9120-1-git-send-email-mika.kuoppala@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 83cd2eff37af..249a6673b433 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2610,6 +2610,18 @@ i915_gem_find_active_request(struct intel_engine_cs *engine) return NULL; } +void i915_gem_reset_prepare(struct drm_i915_private *dev_priv) +{ + struct intel_engine_cs *engine; + enum intel_engine_id id; + + /* Ensure irq handler finishes, and not run again. */ + for_each_engine(engine, dev_priv, id) + tasklet_kill(&engine->irq_tasklet); + + i915_gem_revoke_fences(dev_priv); +} + static void reset_request(struct drm_i915_gem_request *request) { void *vaddr = request->ring->vaddr; @@ -2629,11 +2641,6 @@ static void reset_request(struct drm_i915_gem_request *request) dma_fence_set_error(&request->fence, -EIO); } -void i915_gem_reset_prepare(struct drm_i915_private *dev_priv) -{ - i915_gem_revoke_fences(dev_priv); -} - static void i915_gem_reset_engine(struct intel_engine_cs *engine) { struct drm_i915_gem_request *request; |