From patchwork Fri Feb 14 13:06:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3652591 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA44DBF13A for ; Fri, 14 Feb 2014 13:06:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06D96201BF for ; Fri, 14 Feb 2014 13:06:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 20E6E20222 for ; Fri, 14 Feb 2014 13:06:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51229FB538; Fri, 14 Feb 2014 05:06:35 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id BCCAFFB539 for ; Fri, 14 Feb 2014 05:06:30 -0800 (PST) Received: by mail-ea0-f177.google.com with SMTP id m10so3123286eaj.22 for ; Fri, 14 Feb 2014 05:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=9PRn1ciXo9WDFBHHjJZMMLKqxmeJakOfEAnImbnFVpE=; b=fzjFOSbkM9xUdNlD2VVX6ubciXLP3MMT8XnxxGIG/NS5L0jShqTJoDn6dYH48GeRzN zhDoJk60kRuHcVYAgpRGpa6whN8mUPOW6W1WGK29dqTFciB4Uy4CewjsrlU5Nw6m1/tI CJjUxkQRUGpXCCQiRNe+ZcMJxXzuLDXk9y/PA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=9PRn1ciXo9WDFBHHjJZMMLKqxmeJakOfEAnImbnFVpE=; b=k408gVJiV+xboHfZ2eVoz70DSLzsnSLHbvGbOr7ZhKtEyYJLehhZ5Kt31YV6LMC9Gp pHbRvJ7Yfq8jXfwPh4J4sE/YS4ZzeCz/6jJlaUgxkjVaUbEOLumfOru03Z/LRwjhDlCp YerzndXvc3LmQj4zJoydsYGnLXYDSBnjxtbeQudCk2+Ny8BDy8SF93fKm1ejseC3k4xz oKWSyM0c80oVXa3UJXrt2xDk3qy2eoV6eZChVhPcXnJMH195v20tYFTzEcgRPA6e3fS/ gWnWjUGHEwPVdOBN+G+NtFvafxtnTE2KmI4KaxSHr1NgnhGJbLEMUw7C6bKY7lN68rh1 ngBA== X-Gm-Message-State: ALoCoQloc9jvPBA5VcW50/6A/3M3+Zk/IfM/Mb21EkZjX/qKsOZbCH7XE5R04oQ1SQyQ+fsrHGsf X-Received: by 10.14.212.71 with SMTP id x47mr317950eeo.98.1392383190045; Fri, 14 Feb 2014 05:06:30 -0800 (PST) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id j41sm19611083eeg.10.2014.02.14.05.06.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Feb 2014 05:06:29 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 14 Feb 2014 14:06:07 +0100 Message-Id: <1392383167-19948-3-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1392383167-19948-1-git-send-email-daniel.vetter@ffwll.ch> References: <20140128124028.GX9454@intel.com> <1392383167-19948-1-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Only do gtt cleanup in vma_unbind for the global vma X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Otherwise we end up tearing down fences when e.g. the client quits way too early. Might or might not fix a fence pin_count BUG Ville has reported. Cc: Ville Syrjälä Signed-off-by: Daniel Vetter Tested-by: Ville Syrjälä Reviewed-by: Chris Wilson Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_gem.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 675ad96a43e1..fa00b26a9cf7 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2731,12 +2731,14 @@ int i915_vma_unbind(struct i915_vma *vma) * cause memory corruption through use-after-free. */ - i915_gem_object_finish_gtt(obj); + if (i915_is_ggtt(vma->vm)) { + i915_gem_object_finish_gtt(obj); - /* release the fence reg _after_ flushing */ - ret = i915_gem_object_put_fence(obj); - if (ret) - return ret; + /* release the fence reg _after_ flushing */ + ret = i915_gem_object_put_fence(obj); + if (ret) + return ret; + } trace_i915_vma_unbind(vma);