From patchwork Fri Jul 9 17:49:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 58418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 367D5B6F06 for ; Sat, 10 Jul 2010 03:50:07 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OXHi0-00044Y-LW; Fri, 09 Jul 2010 18:49:56 +0100 Received: from mail.tpi.com ([70.99.223.143]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OXHhy-00044L-Te for kernel-team@lists.ubuntu.com; Fri, 09 Jul 2010 18:49:55 +0100 Received: from [10.0.2.5] (unknown [10.0.2.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.tpi.com (Postfix) with ESMTP id F24F6254EB1; Fri, 9 Jul 2010 10:48:09 -0700 (PDT) Message-ID: <4C376134.9070403@canonical.com> Date: Fri, 09 Jul 2010 11:49:40 -0600 From: Tim Gardner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5 MIME-Version: 1.0 To: Kees Cook Subject: Re: [PATCH] UBUNTU: SAUCE: i915: ubreak G33 GTT size calculation References: <20100709162141.GY828@outflux.net> In-Reply-To: <20100709162141.GY828@outflux.net> Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: tim.gardner@canonical.com List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com On 07/09/2010 10:21 AM, Kees Cook wrote: > Upstream fixed https://bugzilla.kernel.org/show_bug.cgi?id=15733 > by correctly calculating the GTT size using aperture size > on non-G33 hardware. In the process, the G33 case was > also changed, which lead to the regression documented in > https://bugzilla.kernel.org/show_bug.cgi?id=16294 > > This patch reverts the G33 logic without re-breaking the non-G33 logic. > > BugLink: https://bugs.launchpad.net/bugs/597075 > > Signed-off-by: Kees Cook > --- > v2: > - drop the entire auto-detect code for G33 since it is not correct > > --- Kees - while your patch definitely fixes the regression, it might make upstream happier to fix the root cause. See attached. I'll have a test kernel for you in 30 minutes or so. rtg From f746346424cae6a62d2dca65b48007217ec802c5 Mon Sep 17 00:00:00 2001 From: Tim Gardner Date: Fri, 9 Jul 2010 11:14:41 -0600 Subject: [PATCH] UBUNTU: [Upstream] i915: Use the correct mask to detect i830 arpeture size. BugLink: https://bugs.launchpad.net/bugs/597075 According to the specification found at http://intellinuxgraphics.org/VOL_1_graphics_core.pdf, the PCI config space register I830_GMCH_CTRL is a mirror of GMCH Graphics Control. The correct macro for isolating the arperture size bits is therefore I830_GMCH_GMS_MASK along with the attendant changes to the case statement. Signed-off-by: Tim Gardner --- drivers/char/agp/intel-gtt.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9344216..a754715 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -1216,17 +1216,20 @@ static int intel_i915_get_gtt_size(void) /* G33's GTT size defined in gmch_ctrl */ pci_read_config_word(agp_bridge->dev, I830_GMCH_CTRL, &gmch_ctrl); - switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) { - case G33_PGETBL_SIZE_1M: + switch (gmch_ctrl & I830_GMCH_GMS_MASK) { + case I830_GMCH_GMS_STOLEN_512: + size = 512; + break; + case I830_GMCH_GMS_STOLEN_1024: size = 1024; break; - case G33_PGETBL_SIZE_2M: - size = 2048; + case I830_GMCH_GMS_STOLEN_8192: + size = 8*1024; break; default: dev_info(&agp_bridge->dev->dev, "unknown page table size 0x%x, assuming 512KB\n", - (gmch_ctrl & G33_PGETBL_SIZE_MASK)); + (gmch_ctrl & I830_GMCH_GMS_MASK)); size = 512; } } else { -- 1.7.0.4