[Intel-gfx] [PATCH 2/2] drm/i915: Limit the scattergather coalescing to 32bits

Chris Wilson chris at chris-wilson.co.uk
Fri Oct 14 15:18:11 UTC 2016


The scattergather list uses a 32bit size counter, we should avoid
exceeding it.

Fixes: 871dfbd67d4e ("drm/i915: Allow compaction upto SWIOTLB max segment size")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 0d1dc04302ec..858569419134 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2238,7 +2238,7 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj)
 
 	max_segment = swiotlb_max_size();
 	if (!max_segment)
-		max_segment = obj->base.size;
+		max_segment = rounddown(UINT_MAX, PAGE_SIZE);
 
 	st = kmalloc(sizeof(*st), GFP_KERNEL);
 	if (st == NULL)
-- 
2.9.3



More information about the Intel-gfx mailing list