From patchwork Tue Jan 15 21:26:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1981441 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 70EDDDF264 for ; Tue, 15 Jan 2013 21:26:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DDDCE6112 for ; Tue, 15 Jan 2013 13:26:19 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 77404E621C for ; Tue, 15 Jan 2013 13:25:12 -0800 (PST) Received: by shiva.chad-versace.us (Postfix, from userid 1005) id 297CB88527; Tue, 15 Jan 2013 21:27:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lundgren.amr.corp.intel.com (jfdmzpr03-ext.jf.intel.com [134.134.139.72]) by shiva.chad-versace.us (Postfix) with ESMTPSA id 7960C8811F; Tue, 15 Jan 2013 21:27:41 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Tue, 15 Jan 2013 13:26:10 -0800 Message-Id: <1358285181-2128-3-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1358285181-2128-1-git-send-email-ben@bwidawsk.net> References: <1358285181-2128-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 02/13] drm/i915: Mappable_end can't ever be > end 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: , 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 Both DRI1 and DRI2 can never specify a mappable size which goes past the GTT size. Don't pretend otherwise. Signed-off-by: Ben Widawsky Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem_gtt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 63da446..6c068b0 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -536,6 +536,8 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, struct drm_i915_gem_object *obj; unsigned long hole_start, hole_end; + BUG_ON(mappable_end > end); + /* Subtract the guard page ... */ drm_mm_init(&dev_priv->mm.gtt_space, start, end - start - PAGE_SIZE); if (!HAS_LLC(dev)) @@ -557,7 +559,7 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, dev_priv->mm.gtt_start = start; dev_priv->mm.gtt_mappable_end = mappable_end; dev_priv->mm.gtt_total = end - start; - dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; + dev_priv->mm.mappable_gtt_total = mappable_end - start; /* Clear any non-preallocated blocks */ drm_mm_for_each_hole(entry, &dev_priv->mm.gtt_space,