From patchwork Tue Apr 19 20:46:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 718831 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3JJqjEO007055 for ; Tue, 19 Apr 2011 19:53:05 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 383409EF33 for ; Tue, 19 Apr 2011 12:52:45 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=bGzmRdCAidDS36jZu8Qshlklp+0gHz2sZjM8tSfLGJ4=; b=TjAhDDaf531UwrvIY42VKulgWivlRTV/UnJtU7oz0enHgauvJPYRRiLu+h2YMs2xZa JUrl2v2M4HTG3dRnmPq1pZjB/wgCtn2LrdBYV5HiXtYAkHNnRPu5Ojb0T/kAd7Y8Zx9G p2cSm0Ppgq9bYaOxbRdQXP/X2YVzpI8oki/xs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Hy2gSFGQDpgOouiq0yN9zgkGhaWeqRSf6l57EIplKuNQDVLK5iKQoqW4MpGSA/j12l nA/6MNXmH6zPQZTwgty7s9AOVu6g6UnncRnVK/QgeqBwh3/dDeepdkgU/U6PUtAt0RoZ U3lftAsTO7xtz2jL7mUXnrqe8XX6CWzDEzu5A= Received: by 10.217.7.7 with SMTP id z7mr1681122wes.0.1303242716482; Tue, 19 Apr 2011 12:51:56 -0700 (PDT) Received: from localhost.localdomain (cable-static-216-94.intergga.ch [87.102.216.94]) by mx.google.com with ESMTPS id u9sm138493wbg.34.2011.04.19.12.51.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 19 Apr 2011 12:51:55 -0700 (PDT) From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 19 Apr 2011 22:46:01 +0200 Message-Id: <1303245964-3022-3-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> References: <1303245964-3022-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 2/5] drm/i915: not finding a fence is a non-recoverable condition X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Apr 2011 19:53:05 +0000 (UTC) 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);