Skip to content

Commit

Permalink
drm/i915: Only do gtt cleanup in vma_unbind for the global vma
Browse files Browse the repository at this point in the history
Otherwise we end up tearing down fences when e.g. the client quits
way too early. Might or might not fix a fence pin_count BUG Ville has
reported.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed May 14, 2014
1 parent aff10b3 commit 8b1bc9b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2761,12 +2761,14 @@ int i915_vma_unbind(struct i915_vma *vma)
* cause memory corruption through use-after-free.
*/

i915_gem_object_finish_gtt(obj);
if (i915_is_ggtt(vma->vm)) {
i915_gem_object_finish_gtt(obj);

/* release the fence reg _after_ flushing */
ret = i915_gem_object_put_fence(obj);
if (ret)
return ret;
/* release the fence reg _after_ flushing */
ret = i915_gem_object_put_fence(obj);
if (ret)
return ret;
}

trace_i915_vma_unbind(vma);

Expand Down

0 comments on commit 8b1bc9b

Please sign in to comment.