aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 51d4c1a0f544..4461336205ed 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2388,16 +2388,6 @@ static void i915_gem_reset_ring_status(struct drm_i915_private *dev_priv,
2388static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv, 2388static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,
2389 struct intel_ring_buffer *ring) 2389 struct intel_ring_buffer *ring)
2390{ 2390{
2391 while (!list_empty(&ring->request_list)) {
2392 struct drm_i915_gem_request *request;
2393
2394 request = list_first_entry(&ring->request_list,
2395 struct drm_i915_gem_request,
2396 list);
2397
2398 i915_gem_free_request(request);
2399 }
2400
2401 while (!list_empty(&ring->active_list)) { 2391 while (!list_empty(&ring->active_list)) {
2402 struct drm_i915_gem_object *obj; 2392 struct drm_i915_gem_object *obj;
2403 2393
@@ -2407,6 +2397,23 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,
2407 2397
2408 i915_gem_object_move_to_inactive(obj); 2398 i915_gem_object_move_to_inactive(obj);
2409 } 2399 }
2400
2401 /*
2402 * We must free the requests after all the corresponding objects have
2403 * been moved off active lists. Which is the same order as the normal
2404 * retire_requests function does. This is important if object hold
2405 * implicit references on things like e.g. ppgtt address spaces through
2406 * the request.
2407 */
2408 while (!list_empty(&ring->request_list)) {
2409 struct drm_i915_gem_request *request;
2410
2411 request = list_first_entry(&ring->request_list,
2412 struct drm_i915_gem_request,
2413 list);
2414
2415 i915_gem_free_request(request);
2416 }
2410} 2417}
2411 2418
2412void i915_gem_restore_fences(struct drm_device *dev) 2419void i915_gem_restore_fences(struct drm_device *dev)