[Intel-gfx] [PATCH 4/6] intel-gtt: Report stolen_size as 0 when local memory is present

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Dec 3 16:49:51 CET 2013


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

We don't have proper support for local memory elsewhere in the code,
and seeing as no-one seems to have ever seen a system which has local
memory, just report stolen_size as 0 when local memory is detected.

Add a big WARN to alert us if someone were to stumble on one of these
imaginary beasts.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/char/agp/intel-gtt.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 078968d..d7a1ed3 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -437,6 +437,13 @@ static unsigned int intel_gtt_stolen_size(void)
 		stolen_size = 0;
 	}
 
+	/*
+	 * Assumption is that systems with local
+	 * memory don't actually exist in the wild.
+	 */
+	if (WARN(local, "Unicorn sighted! Stop the presses!\n"))
+		stolen_size = 0;
+
 	return stolen_size;
 }
 
-- 
1.8.3.2




More information about the Intel-gfx mailing list