Skip to content

Commit

Permalink
drm/i915: don't trash the gtt when running out of fences
Browse files Browse the repository at this point in the history
With the fence accounting fixed up in the previous commit not finding
enough fences is a fatal error and userspace bug. Trashing the entire
gtt is not gonna turn up that missing fence, so don't to this by
returning another error thatn ENOSPC.

This has the added benefit that it's easier to distinguish fence
accounting errors from gtt space accounting issues.

TTM serves as precendence for the EDEADLK error code - it returns it
when the reservation code needs resources already blocked by the
current reservation.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Jan 29, 2012
1 parent 1690e1e commit 39965b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,7 @@ i915_gem_object_get_fence(struct drm_i915_gem_object *obj,

reg = i915_find_fence_reg(dev, pipelined);
if (reg == NULL)
return -ENOSPC;
return -EDEADLK;

ret = i915_gem_object_flush_fence(obj, pipelined);
if (ret)
Expand Down

0 comments on commit 39965b3

Please sign in to comment.