From patchwork Thu May 12 21:17:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 781052 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 p4CLM21k017628 for ; Thu, 12 May 2011 21:22:23 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F7EF9F307 for ; Thu, 12 May 2011 14:22:02 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (server109-228-6-236.live-servers.net [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id AD06C9F300 for ; Thu, 12 May 2011 14:17:42 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.66.37; Received: from arrandale.alporthouse.com (unverified [78.156.66.37]) by fireflyinternet.com (Firefly Internet SMTP) with ESMTP id 34469147-1500050 for multiple; Thu, 12 May 2011 22:19:13 +0100 From: Chris Wilson To: keithp@keithp.com Date: Thu, 12 May 2011 22:17:18 +0100 Message-Id: <1305235044-9159-11-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1305235044-9159-1-git-send-email-chris@chris-wilson.co.uk> References: <1305235044-9159-1-git-send-email-chris@chris-wilson.co.uk> X-Originating-IP: 78.156.66.37 Cc: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 10/16] drm/i915: Retire requests before disabling pagefaults 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]); Thu, 12 May 2011 21:22:23 +0000 (UTC) As we cannot wait upon an object to be released by the GPU once we have disabled pagefaults, process any pending retirements first in the hope that we move any potential relocations off the active list. References: https://bugs.freedesktop.org/show_bug.cgi?id=35733 Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 20a4cc5..3c639ba 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -446,6 +446,12 @@ i915_gem_execbuffer_relocate(struct drm_device *dev, struct drm_i915_gem_object *obj; int ret = 0; + /* Try to move as many of the relocation targets off the active list + * to avoid unnecessary fallbacks to the slow path, as we cannot wait + * for the retirement with pagefaults disabled. + */ + i915_gem_retire_requests(dev); + /* This is the fast path and we cannot handle a pagefault whilst * holding the struct mutex lest the user pass in the relocations * contained within a mmaped bo. For in such a case we, the page