diff options
author | Ben Widawsky <benjamin.widawsky@intel.com> | 2014-12-23 12:16:04 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-06 03:07:59 -0500 |
commit | b9b5dce5e767a07604b5debb169472f15b4b57a7 (patch) | |
tree | b08f4700216395ff24b50d9761f2dfb9f7e7b04d | |
parent | 7838a63a53f69c4cdfd450b60f0d58ed6641076e (diff) |
drm/i915: Add some extra guards in evict_vm
v2: Use WARN_ONs (Daniel)
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_evict.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_evict.c b/drivers/gpu/drm/i915/i915_gem_evict.c index d104c9120c4d..e3a49d94da3a 100644 --- a/drivers/gpu/drm/i915/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/i915_gem_evict.c | |||
@@ -214,6 +214,7 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle) | |||
214 | struct i915_vma *vma, *next; | 214 | struct i915_vma *vma, *next; |
215 | int ret; | 215 | int ret; |
216 | 216 | ||
217 | WARN_ON(!mutex_is_locked(&vm->dev->struct_mutex)); | ||
217 | trace_i915_gem_evict_vm(vm); | 218 | trace_i915_gem_evict_vm(vm); |
218 | 219 | ||
219 | if (do_idle) { | 220 | if (do_idle) { |
@@ -222,6 +223,8 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle) | |||
222 | return ret; | 223 | return ret; |
223 | 224 | ||
224 | i915_gem_retire_requests(vm->dev); | 225 | i915_gem_retire_requests(vm->dev); |
226 | |||
227 | WARN_ON(!list_empty(&vm->active_list)); | ||
225 | } | 228 | } |
226 | 229 | ||
227 | list_for_each_entry_safe(vma, next, &vm->inactive_list, mm_list) | 230 | list_for_each_entry_safe(vma, next, &vm->inactive_list, mm_list) |