From: Chris Wilson Subject: Re: [PATCH 2/2] x86: add early quirk for reserving Intel graphics stolen memory v3 Date: Thu, 25 Jul 2013 09:34:05 +0100 Message-ID: <20130725083405.GA5134@cantiga.alporthouse.com> References: <1374710683-2614-1-git-send-email-jbarnes@virtuousgeek.org> <1374710683-2614-2-git-send-email-jbarnes@virtuousgeek.org> <20130725074149.GD5939@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (s16502780.onlinehome-server.info [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 06D30E5FBD for ; Thu, 25 Jul 2013 01:34:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130725074149.GD5939@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Jul 25, 2013 at 09:41:49AM +0200, Daniel Vetter wrote: > On Wed, Jul 24, 2013 at 05:04:43PM -0700, Jesse Barnes wrote: > Two bikesheds: > - Can't we give the thing a better name like "Intel Graphics Stolen"? Using a custom type and name seems simple enough and naturally leads it to ending up in iomem_resource. > - Can't we store the iomem region somewhere so that intel-gtt.ko and > i915.ko can get at it and we could drop the duplicated stolen detection > code? The choice is then walking the resource list looking for our named region or reading a couple of registers. Certainly walking the iomem makes everything much clearer. -Chris diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h index bbae024..5e12db4 100644 --- a/arch/x86/include/uapi/asm/e820.h +++ b/arch/x86/include/uapi/asm/e820.h @@ -38,6 +38,7 @@ #define E820_NVS 4 #define E820_UNUSABLE 5 +#define E820_STOLEN_IGFX 6 /* * reserved RAM used by kernel itself diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index d32abea..d8f0e4f 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c @@ -149,6 +149,10 @@ static void __init e820_print_type(u32 type) case E820_UNUSABLE: printk(KERN_CONT "unusable"); break; + + case E820_STOLEN_IGFX: + printk(KERN_CONT "Intel Graphics Stolen"); + break; default: printk(KERN_CONT "type %u", type); break; diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index bff8a6f..27b6d17 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -350,18 +350,10 @@ static void __init intel_graphics_stolen(int num, int slot, int func) size = stolen_size(num, slot, func); start = intel_stolen_base(num, slot, func); if (size && start) - goto found; - else - break; + e820_add_region(start, size, E820_STOLEN_IGFX); + return; } } - - /* No match or invalid data, don't bother reserving */ - return; -found: - /* Mark this space as reserved */ - e820_add_region(start, size, E820_RESERVED); - return; } #define QFLAG_APPLY_ONCE 0x1 -- Chris Wilson, Intel Open Source Technology Centre