From e9ef6c47147b3b0279d9056be719c3100c5a834f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Wed, 4 Jun 2014 17:55:19 +0300 Subject: [PATCH] drm/i915: Add a guard page between stolen and GTT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I recall seeing a note somewhere that stated that we should put a guard page between stolen memory and the GTT. Something to do with preventing prefetches crossing into another memory type or something. Let's try it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_gem_stolen.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index 2e418f8..aa45374 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -162,6 +162,12 @@ static unsigned long i915_stolen_to_physical(struct drm_device *dev) gtt_start &= PGTBL_ADDRESS_LO_MASK; gtt_end = gtt_start + gtt_total_entries(dev_priv->gtt) * 4; + /* add a guard page between GTT and rest of stolen */ + if (gtt_start >= stolen[0].start + PAGE_SIZE) + gtt_start -= PAGE_SIZE; + if (gtt_end + PAGE_SIZE <= stolen[0].end) + gtt_end += PAGE_SIZE; + if (gtt_start >= stolen[0].start && gtt_start < stolen[0].end) stolen[0].end = gtt_start; if (gtt_end > stolen[1].start && gtt_end <= stolen[1].end) -- 1.8.5.5