[PATCH 1/3] x86: Use a custom name for the Intel Graphics Stolen reservation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



By giving the stolen a region a unique type and name, we then insert it
into the iomem_resource as a known resource. This clear identifies it to
the user when printing the e820 map (and later the iomem resources), and
exposes it to the driver for later use.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 arch/x86/include/uapi/asm/e820.h |  2 ++
 arch/x86/kernel/e820.c           |  4 ++++
 arch/x86/kernel/early-quirks.c   | 12 ++----------
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/uapi/asm/e820.h b/arch/x86/include/uapi/asm/e820.h
index bbae024..72384ce 100644
--- a/arch/x86/include/uapi/asm/e820.h
+++ b/arch/x86/include/uapi/asm/e820.h
@@ -38,6 +38,8 @@
 #define E820_NVS	4
 #define E820_UNUSABLE	5
 
+#define E820_STOLEN_IGFX 6
+#define E820_STOLEN_IGFX_STRING "Intel Graphics Stolen"
 
 /*
  * reserved RAM used by kernel itself
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index d32abea..ce4b448 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 E820_STOLEN_IGFX_STRING);
+		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
-- 
1.8.3.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux