Skip to content

Commit 5719d4f

Browse files
BobBeckettmatt-auld
authored andcommitted
drm/i915/ttm: fix large buffer population trucation
ttm->num_pages is uint32_t which was causing very large buffers to only populate a truncated size. This fixes gem_create@create-clear igt test on large memory systems. Fixes: 7ae0345 ("drm/i915/ttm: add tt shmem backend") Signed-off-by: Robert Beckett <bob.beckett@collabora.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211210195005.2582884-1-bob.beckett@collabora.com
1 parent bd56c63 commit 5719d4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gem/i915_gem_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int i915_ttm_tt_shmem_populate(struct ttm_device *bdev,
166166
struct intel_memory_region *mr = i915->mm.regions[INTEL_MEMORY_SYSTEM];
167167
struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
168168
const unsigned int max_segment = i915_sg_segment_size();
169-
const size_t size = ttm->num_pages << PAGE_SHIFT;
169+
const size_t size = (size_t)ttm->num_pages << PAGE_SHIFT;
170170
struct file *filp = i915_tt->filp;
171171
struct sgt_iter sgt_iter;
172172
struct sg_table *st;

0 commit comments

Comments
 (0)