diff mbox

[11/16] drm/i915: not finding a fence is a non-recoverable condition

Message ID 1305235044-9159-12-git-send-email-chris@chris-wilson.co.uk
State New, archived
Headers show

Commit Message

Chris Wilson May 12, 2011, 9:17 p.m. UTC
From: Daniel Vetter <daniel.vetter@ffwll.ch>

This happens in two cases:
- userspace got its fence accounting wrong or
- the kernel got its fence accounting wrong.

In both cases there's absolutely no point in calling evict_everything,
that will not magically bring back the missing fence. So return a

Comments

Keith Packard May 13, 2011, 1:10 a.m. UTC | #1
On Thu, 12 May 2011 22:17:19 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:

> -		return -ENOSPC;
> +		return -EDEADLK;

Would be nice to have the kernel print out a debugging message at this
point -- the only way to hit this is from a bug in user or kernel code.
Daniel Vetter May 15, 2011, 8:38 p.m. UTC | #2
On Thu, May 12, 2011 at 06:10:08PM -0700, Keith Packard wrote:
> On Thu, 12 May 2011 22:17:19 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> 
> > -		return -ENOSPC;
> > +		return -EDEADLK;
> 
> Would be nice to have the kernel print out a debugging message at this
> point -- the only way to hit this is from a bug in user or kernel code.

We've had that once and dropped it. The reason was that there should be no
user-triggerable kernel message (which might pointlessly fill the logs).
With the different return value I think it's good enough to catch.
-Daniel
diff mbox

Patch

different (hopefully somewhat sensible) error code.

This has the added benefit that out-of-gtt can be distinguish from
broken fence accounting by simply looking at the ioctl return code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 67ddda0..dd0cfac 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2663,7 +2663,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)