diff options
author | Oscar Mateo <oscar.mateo@intel.com> | 2014-07-24 12:04:42 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-20 11:17:48 -0400 |
commit | cc9130be805d955f0e06642e57741dd9df1fbc86 (patch) | |
tree | 2dda86458c8bf1c1e84eaf4af82ff7e9f5e5582e | |
parent | b7c71823f11158340b9d61325d3c44124650dc4e (diff) |
drm/i915/bdw: Make sure gpu reset still works with Execlists
If we reset a ring after a hang, we have to make sure that we clear
out all queued Execlists requests.
v2: The ring is, at this point, already being correctly re-programmed
for Execlists, and the hangcheck counters cleared.
v3: Daniel suggests to drop the "if (execlists)" because the Execlists
queue should be empty in legacy mode (which is true, if we do the
INIT_LIST_HEAD).
v4: Do the pending intel_runtime_pm_put
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 32fa1e9eb844..aa4103bdd352 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2551,6 +2551,18 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv, | |||
2551 | i915_gem_free_request(request); | 2551 | i915_gem_free_request(request); |
2552 | } | 2552 | } |
2553 | 2553 | ||
2554 | while (!list_empty(&ring->execlist_queue)) { | ||
2555 | struct intel_ctx_submit_request *submit_req; | ||
2556 | |||
2557 | submit_req = list_first_entry(&ring->execlist_queue, | ||
2558 | struct intel_ctx_submit_request, | ||
2559 | execlist_link); | ||
2560 | list_del(&submit_req->execlist_link); | ||
2561 | intel_runtime_pm_put(dev_priv); | ||
2562 | i915_gem_context_unreference(submit_req->ctx); | ||
2563 | kfree(submit_req); | ||
2564 | } | ||
2565 | |||
2554 | /* These may not have been flush before the reset, do so now */ | 2566 | /* These may not have been flush before the reset, do so now */ |
2555 | kfree(ring->preallocated_lazy_request); | 2567 | kfree(ring->preallocated_lazy_request); |
2556 | ring->preallocated_lazy_request = NULL; | 2568 | ring->preallocated_lazy_request = NULL; |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 13543f8528c2..4fb1ec95ec08 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -1612,6 +1612,7 @@ static int intel_init_ring_buffer(struct drm_device *dev, | |||
1612 | ring->dev = dev; | 1612 | ring->dev = dev; |
1613 | INIT_LIST_HEAD(&ring->active_list); | 1613 | INIT_LIST_HEAD(&ring->active_list); |
1614 | INIT_LIST_HEAD(&ring->request_list); | 1614 | INIT_LIST_HEAD(&ring->request_list); |
1615 | INIT_LIST_HEAD(&ring->execlist_queue); | ||
1615 | ringbuf->size = 32 * PAGE_SIZE; | 1616 | ringbuf->size = 32 * PAGE_SIZE; |
1616 | ringbuf->ring = ring; | 1617 | ringbuf->ring = ring; |
1617 | memset(ring->semaphore.sync_seqno, 0, sizeof(ring->semaphore.sync_seqno)); | 1618 | memset(ring->semaphore.sync_seqno, 0, sizeof(ring->semaphore.sync_seqno)); |