Skip to content

Commit 2ed38ce

Browse files
committed
drm/i915: opportunistically apply ALLOC_CONTIGIOUS
It looks like this code was accidentally dropped at some point(in a slightly different form), so add it back. The gist is that if we know the allocation will be one single chunk, then we can just annotate the BO with I915_BO_ALLOC_CONTIGUOUS, even if the user doesn't bother. In the future this should allow us to avoid using vmap for such objects, in some upcoming patches. v2(Thomas): - Tweak the commit message to mention the future motivation Signed-off-by: Matthew Auld <[email protected]> Cc: Thomas Hellström <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c64fa77 commit 2ed38ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
6262

6363
size = round_up(size, default_page_size);
6464

65+
if (default_page_size == size)
66+
flags |= I915_BO_ALLOC_CONTIGUOUS;
67+
6568
GEM_BUG_ON(!size);
6669
GEM_BUG_ON(!IS_ALIGNED(size, I915_GTT_MIN_ALIGNMENT));
6770

0 commit comments

Comments
 (0)