From patchwork Fri May 2 01:47:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 4100861 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BD5A89F1E1 for ; Fri, 2 May 2014 02:13:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECA6A2037B for ; Fri, 2 May 2014 02:13:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A15C820374 for ; Fri, 2 May 2014 02:13:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC64B6E38F; Thu, 1 May 2014 18:48:04 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id AA6606E38F for ; Thu, 1 May 2014 18:48:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 01 May 2014 18:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,969,1389772800"; d="scan'208";a="533436351" Received: from unknown (HELO ironside.intel.com) ([10.255.12.151]) by orsmga002.jf.intel.com with ESMTP; 01 May 2014 18:47:58 -0700 From: Ben Widawsky To: Intel GFX Date: Thu, 1 May 2014 18:47:54 -0700 Message-Id: <1398995274-1317-1-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.9.2 Cc: Ben Widawsky , Art Runyan , Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915/bdw: Don't allow the FBC base to be 0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.8 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 "Restriction : The offset must be greater than 4K bytes, avoiding the first 4KB of stolen memory." Since it looks like we currently allocate an overlay out of stolen before we get the compressed framebuffer, I believe this is not currently an issue which fixes anything. We simply want to make the code as future-proof, and as clear as possible, by match the spec. Cc: Art Runyan Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem_stolen.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 62ef55b..65016b0 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -107,19 +107,24 @@ static int i915_setup_compression(struct drm_device *dev, int size) { struct drm_i915_private *dev_priv = dev->dev_private; struct drm_mm_node *compressed_fb, *uninitialized_var(compressed_llb); + unsigned long start = 0; int ret; compressed_fb = kzalloc(sizeof(*compressed_fb), GFP_KERNEL); if (!compressed_fb) goto err_llb; + if (IS_BROADWELL(dev)) + start = 0x1000; + /* Try to over-allocate to reduce reallocations and fragmentation */ - ret = drm_mm_insert_node(&dev_priv->mm.stolen, compressed_fb, - size <<= 1, 4096, DRM_MM_SEARCH_DEFAULT); + ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, compressed_fb, + size <<= 1, 4096, start, dev_priv->gtt.stolen_size, + DRM_MM_SEARCH_DEFAULT); if (ret) - ret = drm_mm_insert_node(&dev_priv->mm.stolen, compressed_fb, - size >>= 1, 4096, - DRM_MM_SEARCH_DEFAULT); + ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, compressed_fb, + size >>= 1, 4096, start, dev_priv->gtt.stolen_size, + DRM_MM_SEARCH_DEFAULT); if (ret) goto err_llb;