drm/i915: Only do gtt cleanup in vma_unbind for the global vma
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>
This commit is contained in:
@@ -2761,12 +2761,14 @@ int i915_vma_unbind(struct i915_vma *vma)
|
|||||||
* cause memory corruption through use-after-free.
|
* cause memory corruption through use-after-free.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (i915_is_ggtt(vma->vm)) {
|
||||||
i915_gem_object_finish_gtt(obj);
|
i915_gem_object_finish_gtt(obj);
|
||||||
|
|
||||||
/* release the fence reg _after_ flushing */
|
/* release the fence reg _after_ flushing */
|
||||||
ret = i915_gem_object_put_fence(obj);
|
ret = i915_gem_object_put_fence(obj);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
trace_i915_vma_unbind(vma);
|
trace_i915_vma_unbind(vma);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user