From patchwork Wed Apr 24 18:56:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris J Arges X-Patchwork-Id: 239293 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id EFC132C0100 for ; Thu, 25 Apr 2013 04:56:52 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UV4s2-0005ic-2U; Wed, 24 Apr 2013 18:56:46 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UV4s0-0005iM-1Y for kernel-team@lists.ubuntu.com; Wed, 24 Apr 2013 18:56:44 +0000 Received: from cpe-66-68-155-223.austin.res.rr.com ([66.68.155.223] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UV4ry-000869-AC; Wed, 24 Apr 2013 18:56:42 +0000 From: Chris J Arges To: stable@kernel.org Subject: [PATCH] drm/i915: Use the correct size of the GTT for placing the per-process entries Date: Wed, 24 Apr 2013 13:56:42 -0500 Message-Id: <1366829802-15499-2-git-send-email-chris.j.arges@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1366829802-15499-1-git-send-email-chris.j.arges@canonical.com> References: <1366829802-15499-1-git-send-email-chris.j.arges@canonical.com> Cc: Ben Widawsky , Daniel Vetter , stable@vger.kernel.org, Chris Wilson , kernel-team@lists.ubuntu.com, Matthew Garret X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Chris Wilson The current layout is to place the per-process tables at the end of the GTT. However, this is currently using a hardcoded maximum size for the GTT and not taking in account limitations imposed by the BIOS. Use the value for the total number of entries allocated in the table as provided by the configuration registers. Reported-by: Matthew Garrett Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: Ben Widawsky Cc: Matthew Garret Signed-off-by: Daniel Vetter (cherry picked from commit 9a0f938bde74bf9e50bd75c8de9e38c1787398cd) Signed-off-by: Chris J Arges Cc: stable@vger.kernel.org --- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index eae804d..8096d577 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -72,7 +72,7 @@ int i915_gem_init_aliasing_ppgtt(struct drm_device *dev) /* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024 * entries. For aliasing ppgtt support we just steal them at the end for * now. */ - first_pd_entry_in_global_pt = 512*1024 - I915_PPGTT_PD_ENTRIES; + first_pd_entry_in_global_pt = dev_priv->mm.gtt->gtt_total_entries - I915_PPGTT_PD_ENTRIES; ppgtt = kzalloc(sizeof(*ppgtt), GFP_KERNEL); if (!ppgtt)