diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-21 05:54:32 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-24 13:26:25 -0500 |
commit | bee4a186c16bed0d7e91425ca9356c2e8c015f8d (patch) | |
tree | 66d01e18c48fb0dfd9970c169d0f5baa0adaa0fe /drivers/gpu | |
parent | 934f992c763ae1e5eefcce8af769c16444085df7 (diff) |
drm/i915,agp/intel: Do not clear stolen entries
We can only utilize the stolen portion of the GTT if we are in sole
charge of the hardware. This is only true if using GEM and KMS,
otherwise VESA continues to access stolen memory.
Reported-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Jiri Olsa <jolsa@redhat.com>
Tested-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 4 |
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5969f46ac2d6..a0149c619cdd 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -543,8 +543,11 @@ typedef struct drm_i915_private { | |||
543 | /** List of all objects in gtt_space. Used to restore gtt | 543 | /** List of all objects in gtt_space. Used to restore gtt |
544 | * mappings on resume */ | 544 | * mappings on resume */ |
545 | struct list_head gtt_list; | 545 | struct list_head gtt_list; |
546 | /** End of mappable part of GTT */ | 546 | |
547 | /** Usable portion of the GTT for GEM */ | ||
548 | unsigned long gtt_start; | ||
547 | unsigned long gtt_mappable_end; | 549 | unsigned long gtt_mappable_end; |
550 | unsigned long gtt_end; | ||
548 | 551 | ||
549 | struct io_mapping *gtt_mapping; | 552 | struct io_mapping *gtt_mapping; |
550 | int gtt_mtrr; | 553 | int gtt_mtrr; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 812b97b47469..cf4f74c7c6fb 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -140,12 +140,16 @@ void i915_gem_do_init(struct drm_device *dev, | |||
140 | { | 140 | { |
141 | drm_i915_private_t *dev_priv = dev->dev_private; | 141 | drm_i915_private_t *dev_priv = dev->dev_private; |
142 | 142 | ||
143 | drm_mm_init(&dev_priv->mm.gtt_space, start, | 143 | drm_mm_init(&dev_priv->mm.gtt_space, start, end - start); |
144 | end - start); | ||
145 | 144 | ||
145 | dev_priv->mm.gtt_start = start; | ||
146 | dev_priv->mm.gtt_mappable_end = mappable_end; | ||
147 | dev_priv->mm.gtt_end = end; | ||
146 | dev_priv->mm.gtt_total = end - start; | 148 | dev_priv->mm.gtt_total = end - start; |
147 | dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; | 149 | dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; |
148 | dev_priv->mm.gtt_mappable_end = mappable_end; | 150 | |
151 | /* Take over this portion of the GTT */ | ||
152 | intel_gtt_clear_range(start / PAGE_SIZE, (end-start) / PAGE_SIZE); | ||
149 | } | 153 | } |
150 | 154 | ||
151 | int | 155 | int |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 70433ae50ac8..b0abdc64aa9f 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -34,6 +34,10 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) | |||
34 | struct drm_i915_private *dev_priv = dev->dev_private; | 34 | struct drm_i915_private *dev_priv = dev->dev_private; |
35 | struct drm_i915_gem_object *obj; | 35 | struct drm_i915_gem_object *obj; |
36 | 36 | ||
37 | /* First fill our portion of the GTT with scratch pages */ | ||
38 | intel_gtt_clear_range(dev_priv->mm.gtt_start / PAGE_SIZE, | ||
39 | (dev_priv->mm.gtt_end - dev_priv->mm.gtt_start) / PAGE_SIZE); | ||
40 | |||
37 | list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { | 41 | list_for_each_entry(obj, &dev_priv->mm.gtt_list, gtt_list) { |
38 | i915_gem_clflush_object(obj); | 42 | i915_gem_clflush_object(obj); |
39 | 43 | ||