diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-05-24 15:48:12 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-05-25 04:07:06 -0400 |
commit | bed1ea95a38bf7a54fd3229edcd3871a18ca98c0 (patch) | |
tree | 353d8a2bb972bf643a93d192e0d588e7d73ada10 /drivers/gpu/drm | |
parent | 89ba829e38bd500f438bc08af4229204c8ed7f35 (diff) |
drm/i915: Limit page allocations to lowmem (dma32) for i965
Broadwater and Crestline share a limitation that prevent it from
relocating general surface state above 4GiB. The only recourse we have
since any buffer object may be used as a relocation target is then to
limit all object allocations on 965g[m] to DMA32.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6d2180cf3da5..1d4b51c53874 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -3263,6 +3263,7 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, | |||
3263 | struct drm_i915_private *dev_priv = dev->dev_private; | 3263 | struct drm_i915_private *dev_priv = dev->dev_private; |
3264 | struct drm_i915_gem_object *obj; | 3264 | struct drm_i915_gem_object *obj; |
3265 | struct address_space *mapping; | 3265 | struct address_space *mapping; |
3266 | u32 mask; | ||
3266 | 3267 | ||
3267 | obj = kzalloc(sizeof(*obj), GFP_KERNEL); | 3268 | obj = kzalloc(sizeof(*obj), GFP_KERNEL); |
3268 | if (obj == NULL) | 3269 | if (obj == NULL) |
@@ -3273,8 +3274,15 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev, | |||
3273 | return NULL; | 3274 | return NULL; |
3274 | } | 3275 | } |
3275 | 3276 | ||
3277 | mask = GFP_HIGHUSER | __GFP_RECLAIMABLE; | ||
3278 | if (IS_CRESTLINE(dev) || IS_BROADWATER(dev)) { | ||
3279 | /* 965gm cannot relocate objects above 4GiB. */ | ||
3280 | mask &= ~__GFP_HIGHMEM; | ||
3281 | mask |= __GFP_DMA32; | ||
3282 | } | ||
3283 | |||
3276 | mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; | 3284 | mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; |
3277 | mapping_set_gfp_mask(mapping, GFP_HIGHUSER | __GFP_RECLAIMABLE); | 3285 | mapping_set_gfp_mask(mapping, mask); |
3278 | 3286 | ||
3279 | i915_gem_info_add_obj(dev_priv, size); | 3287 | i915_gem_info_add_obj(dev_priv, size); |
3280 | 3288 | ||