aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2015-05-08 14:37:39 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-05-08 17:25:29 +0200
commite7ded2d74673c2cdabd1f80da8c8a1b7b531e84a (patch)
tree06bba71130f39fd598a57c5358cc070b6a633be1 /drivers/gpu/drm/i915/i915_gem.c
parentRevert "drm/i915: Hack to tie both common lanes together on chv" (diff)
downloadlinux-dev-e7ded2d74673c2cdabd1f80da8c8a1b7b531e84a.tar.xz
linux-dev-e7ded2d74673c2cdabd1f80da8c8a1b7b531e84a.zip
drm/i915: Reject huge tiled objects
We do not yet support tiled objects bigger than the mappable aperture size so reject them. Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> [danvet: Rework the check a bit to avoid warnings.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b45f93bb030e..f128ed8d6f65 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1669,8 +1669,10 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
}
/* Use a partial view if the object is bigger than the aperture. */
- if (obj->base.size >= dev_priv->gtt.mappable_end) {
+ if (obj->base.size >= dev_priv->gtt.mappable_end &&
+ obj->tiling_mode == I915_TILING_NONE) {
static const unsigned int chunk_size = 256; // 1 MiB
+
memset(&view, 0, sizeof(view));
view.type = I915_GGTT_VIEW_PARTIAL;
view.params.partial.offset = rounddown(page_offset, chunk_size);