[Intel-gfx] [PATCH] drm/i915: Reject huge tiled objects

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri May 8 04:37:39 PDT 2015


We do not yet support tiled objects bigger than the mappable
aperture size so reject them.

Reported-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b45f93b..6b09eff 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1670,6 +1670,11 @@ 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->tiling_mode != I915_TILING_NONE) {
+			ret = -ENOSPC;
+			goto unlock;
+		}
+
 		static const unsigned int chunk_size = 256; // 1 MiB
 		memset(&view, 0, sizeof(view));
 		view.type = I915_GGTT_VIEW_PARTIAL;
-- 
1.9.3





More information about the Intel-gfx mailing list