Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Mappable_end can't ever be > end

Both DRI1 and DRI2 can never specify a mappable size which goes past the
GTT size. Don't pretend otherwise.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Ben Widawsky and committed by
Daniel Vetter
35451cb6 c1fc6521

+3 -1
+3 -1
drivers/gpu/drm/i915/i915_gem_gtt.c
··· 536 536 struct drm_i915_gem_object *obj; 537 537 unsigned long hole_start, hole_end; 538 538 539 + BUG_ON(mappable_end > end); 540 + 539 541 /* Subtract the guard page ... */ 540 542 drm_mm_init(&dev_priv->mm.gtt_space, start, end - start - PAGE_SIZE); 541 543 if (!HAS_LLC(dev)) ··· 559 557 dev_priv->mm.gtt_start = start; 560 558 dev_priv->mm.gtt_mappable_end = mappable_end; 561 559 dev_priv->mm.gtt_total = end - start; 562 - dev_priv->mm.mappable_gtt_total = min(end, mappable_end) - start; 560 + dev_priv->mm.mappable_gtt_total = mappable_end - start; 563 561 564 562 /* Clear any non-preallocated blocks */ 565 563 drm_mm_for_each_hole(entry, &dev_priv->mm.gtt_space,