From: Daniel Vetter Subject: [PATCH 2/5] drm/i915: not finding a fence is a non-recoverable condition Date: Tue, 19 Apr 2011 22:46:01 +0200 Message-ID: <1303245964-3022-3-git-send-email-daniel.vetter@ffwll.ch> References: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wy0-f177.google.com (mail-wy0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 27CED9E874 for ; Tue, 19 Apr 2011 12:51:56 -0700 (PDT) Received: by mail-wy0-f177.google.com with SMTP id 28so50785wyb.36 for ; Tue, 19 Apr 2011 12:51:56 -0700 (PDT) In-Reply-To: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org 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 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 --- 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 1ef0b91..5c900d3 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2735,7 +2735,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; if ((old = reg->obj)) { drm_gem_object_reference(&old->base); -- 1.7.4.1