All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Catch attempting to use the aliasing_gtt's drm_mm
@ 2017-01-15 13:47 Chris Wilson
  2017-01-15 14:24 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-01-16 12:10 ` [PATCH] " Joonas Lahtinen
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-01-15 13:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

The aliasing_gtt is just that, an alias of the global GTT. We do not
populate it directly, instead we always use the global GTT. Catch any
attempt to incorrectly allocate ranges from the aliasing_gtt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 26a4460e16c3..9bc1788fac5b 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3134,6 +3134,7 @@ int i915_gem_gtt_reserve(struct i915_address_space *vm,
 	GEM_BUG_ON(!IS_ALIGNED(size, I915_GTT_PAGE_SIZE));
 	GEM_BUG_ON(!IS_ALIGNED(offset, I915_GTT_MIN_ALIGNMENT));
 	GEM_BUG_ON(range_overflows(offset, size, vm->total));
+	GEM_BUG_ON(vm == &vm->i915->mm.aliasing_ppgtt->base);
 
 	node->size = size;
 	node->start = offset;
@@ -3229,6 +3230,7 @@ int i915_gem_gtt_insert(struct i915_address_space *vm,
 	GEM_BUG_ON(start >= end);
 	GEM_BUG_ON(start > 0  && !IS_ALIGNED(start, I915_GTT_PAGE_SIZE));
 	GEM_BUG_ON(end < U64_MAX && !IS_ALIGNED(end, I915_GTT_PAGE_SIZE));
+	GEM_BUG_ON(vm == &vm->i915->mm.aliasing_ppgtt->base);
 
 	if (unlikely(range_overflows(start, size, end)))
 		return -ENOSPC;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-16 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-15 13:47 [PATCH] drm/i915: Catch attempting to use the aliasing_gtt's drm_mm Chris Wilson
2017-01-15 14:24 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-01-16 12:10 ` [PATCH] " Joonas Lahtinen
2017-01-16 12:30   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.