[PATCH 9/9] drm/i915: use stolen_usable_size for the range sanity check

Matthew Auld matthew.auld at intel.com
Tue Dec 5 14:45:02 UTC 2017

In i915_pages_create_for_stolen it probably makes more sense to check if
the range overflows the stolen_usable_size, since stolen_size will
also include the reserved portion which we can't touch.

Signed-off-by: Matthew Auld <matthew.auld at intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
 drivers/gpu/drm/i915/i915_gem_stolen.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index cdb5cc55d9ca..e1d0cdef01e0 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -435,7 +435,8 @@ i915_pages_create_for_stolen(struct drm_device *dev,
 	struct sg_table *st;
 	struct scatterlist *sg;
-	GEM_BUG_ON(range_overflows(offset, size, dev_priv->ggtt.stolen_size));
+	GEM_BUG_ON(range_overflows(offset, size,
+				   dev_priv->ggtt.stolen_usable_size));
 	/* We hide that we have no struct page backing our stolen object
 	 * by wrapping the contiguous physical allocation with a fake

More information about the Intel-gfx-trybot mailing list