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>
This commit is contained in:
Oscar Mateo 2014-07-24 17:04:42 +01:00 committed by Daniel Vetter
parent b7c71823f1
commit cc9130be80
2 changed files with 13 additions and 0 deletions

View File

@ -2551,6 +2551,18 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,
i915_gem_free_request(request); i915_gem_free_request(request);
} }
while (!list_empty(&ring->execlist_queue)) {
struct intel_ctx_submit_request *submit_req;
submit_req = list_first_entry(&ring->execlist_queue,
struct intel_ctx_submit_request,
execlist_link);
list_del(&submit_req->execlist_link);
intel_runtime_pm_put(dev_priv);
i915_gem_context_unreference(submit_req->ctx);
kfree(submit_req);
}
/* These may not have been flush before the reset, do so now */ /* These may not have been flush before the reset, do so now */
kfree(ring->preallocated_lazy_request); kfree(ring->preallocated_lazy_request);
ring->preallocated_lazy_request = NULL; ring->preallocated_lazy_request = NULL;

View File

@ -1612,6 +1612,7 @@ static int intel_init_ring_buffer(struct drm_device *dev,
ring->dev = dev; ring->dev = dev;
INIT_LIST_HEAD(&ring->active_list); INIT_LIST_HEAD(&ring->active_list);
INIT_LIST_HEAD(&ring->request_list); INIT_LIST_HEAD(&ring->request_list);
INIT_LIST_HEAD(&ring->execlist_queue);
ringbuf->size = 32 * PAGE_SIZE; ringbuf->size = 32 * PAGE_SIZE;
ringbuf->ring = ring; ringbuf->ring = ring;
memset(ring->semaphore.sync_seqno, 0, sizeof(ring->semaphore.sync_seqno)); memset(ring->semaphore.sync_seqno, 0, sizeof(ring->semaphore.sync_seqno));