[Intel-gfx] [PATCH 4/8] intel-gtt: Assume last 128KB of stolen contains the GTT entries on gen2

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Thu Nov 28 16:15:06 CET 2013


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

At least on my MGM the last 128KB of, what I assume is the stolen memory
region, contains the GTT entries. Let's assume that holds for all gen2
platforms.

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

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 99ff699..35788a2 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -430,6 +430,10 @@ static unsigned int intel_gtt_stolen_size(bool *has_local_memory)
 		}
 	}
 
+	/* Assume GTT entries occupy the last 128KB of stolen/local memory. */
+	if (stolen_size > 0 && INTEL_GTT_GEN == 2)
+		stolen_size -= KB(128);
+
 	if (stolen_size > 0) {
 		dev_info(&intel_private.bridge_dev->dev, "detected %dK %s memory\n",
 		       stolen_size / KB(1), *has_local_memory ? "local" : "stolen");
-- 
1.8.3.2




More information about the Intel-gfx mailing list