From patchwork Thu Jan 14 22:36:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 8036381 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 10AB5BEEE5 for ; Thu, 14 Jan 2016 22:37:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DAEE204B5 for ; Thu, 14 Jan 2016 22:37:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 479DD204AE for ; Thu, 14 Jan 2016 22:36:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8BFF6E10C; Thu, 14 Jan 2016 14:36:58 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 59E746E10C for ; Thu, 14 Jan 2016 14:36:57 -0800 (PST) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 51262869-1500048 for multiple; Thu, 14 Jan 2016 22:38:28 +0000 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Thu, 14 Jan 2016 22:36:53 +0000 Date: Thu, 14 Jan 2016 22:36:53 +0000 From: Chris Wilson To: ville.syrjala@linux.intel.com Message-ID: <20160114223653.GC15852@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org References: <1452777736-4909-1-git-send-email-ville.syrjala@linux.intel.com> <1452777736-4909-8-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1452777736-4909-8-git-send-email-ville.syrjala@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH 7/8] drm/i915: Make display gtt offsets u32 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 On Thu, Jan 14, 2016 at 03:22:15PM +0200, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä > > Using 'unsigned long' for ggtt offsets doesn't make much sense. Use > 'u32' instead since we've not yet seen a >4GiB ggtt. We should do: To get that early warning in. -Chris Reviewed-by: Ville Syrjälä diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 2e460b369e82..2ce16acceb75 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -3143,6 +3143,13 @@ int i915_gem_gtt_init(struct drm_device *dev) if (ret) return ret; + if (gtt->base.total >> 32) { + DRM_ERROR("The code does not expect a Global GTT with more that 32bits of address space! Found %lldM!\n", + gtt->base.total >> 20); + gtt->base.total = 1ull << 32; + gtt->mappable_end = min(gtt->mappable_end, gtt->base.total); + } + /* GMADR is the PCI mmio aperture into the global GTT. */ DRM_INFO("Memory usable by graphics device = %lluM\n", gtt->base.total >> 20);