From patchwork Tue Aug 16 10:42:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9283271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5D7B607FD for ; Tue, 16 Aug 2016 10:43:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A66E6285CC for ; Tue, 16 Aug 2016 10:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B664285CF; Tue, 16 Aug 2016 10:43:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DD86285CC for ; Tue, 16 Aug 2016 10:43:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C29646E668; Tue, 16 Aug 2016 10:43:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E7166E665 for ; Tue, 16 Aug 2016 10:43:16 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id i5so15698429wmg.2 for ; Tue, 16 Aug 2016 03:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5g7g6B8X14OeklT1r3S+RnXh0llMDBN1Fnoj0UP5aH4=; b=nNMVkPGfHyV7Rs4uuXl2Il0XF7TZbcF1/aFByMk2ACEwK6mRlCOch71VEDbCQ7Pdxr kFZyp2jqqX5wCUMQlopuBJnfRelZDCG34bb2XoE3530eJ30kqeSeJQYzh8zWRIavvnqj OR7QYTQ4r6zHBpjxyr3ZY/8kN2lL6MAaMjG8/CEFXCGbxrVvJ+5jGswuuUCaGw43sygp qz2Pk93n/XgFPfmxvMy5bK62ypvfnHW7507YdzgwtqXZGoizt6kZy638sIYDie/mVr0F B2ZYt/wTkZtQ0YIrpCxUdR+WcuRLymssN+zYuA2flq9Mwa89Ty35iPUDMy5pVAEIOVR4 rDyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=5g7g6B8X14OeklT1r3S+RnXh0llMDBN1Fnoj0UP5aH4=; b=gk4KpwQVSBypIulNKdC19kzzpvMdTJnYKpk1xa8Njqs3hJz7I7EYmVHE+SYDQ+MeXu 9NRtW9glTID8nEZ4gqUgNOBOXE/ERk+1PVwm98p/aqYzzeuC3rXtsJ2Y6f0VvF8/ZNRm 9YbImUujvAd4Ze7rPye5Jtdhyw3CNbLeD7uhjFjalzXQFgNxVcfK2sv2tgjRFLQWaZD+ 5Y696W8YSci46kOa2PGjMgby96847kzfRiqjPeuLljPTd6EEsoJE40xfgYZYg9GDx9k3 zN5a0IgrBzKVLhh08VYaNgWJDEo/tzmltQGwdT0rRS1pEezOqm+BJjtqXFarbopWsktH uvqA== X-Gm-Message-State: AEkoouv2zqO1x8qLLttwNT9qT2lOSrT3v8Ul9Vo1Fy6lSnKI7SacwQ6AEPnJg4szXEsJtQ== X-Received: by 10.28.107.144 with SMTP id a16mr21484578wmi.75.1471344195090; Tue, 16 Aug 2016 03:43:15 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id d62sm21175546wmd.7.2016.08.16.03.43.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 03:43:14 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Aug 2016 11:42:38 +0100 Message-Id: <1471344168-28136-13-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471344168-28136-1-git-send-email-chris@chris-wilson.co.uk> References: <1471344168-28136-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 12/22] drm/i915: Allocate rings from stolen X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP If we have stolen available, make use of it for ringbuffer allocation. Previously this was restricted to !llc platforms, as writing to stolen requires a GGTT mapping - but now that we have partial mappable support, the mappable aperture isn't quite so precious so we can use it more freely and ringbuffers are a good user for the otherwise wasted stolen. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/intel_ringbuffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index a96a470dfe03..5a5412f3db46 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -1949,10 +1949,8 @@ intel_ring_create_vma(struct drm_i915_private *dev_priv, int size) struct drm_i915_gem_object *obj; struct i915_vma *vma; - obj = ERR_PTR(-ENODEV); - if (!HAS_LLC(dev_priv)) - obj = i915_gem_object_create_stolen(&dev_priv->drm, size); - if (IS_ERR(obj)) + obj = i915_gem_object_create_stolen(&dev_priv->drm, size); + if (obj == NULL) obj = i915_gem_object_create(&dev_priv->drm, size); if (IS_ERR(obj)) return ERR_CAST(obj);