Commit 66ddc693 authored by Matthew Auld's avatar Matthew Auld

drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS

We only need this when allocating device local-memory, where this
influences the drm_buddy. Currently there is some funny behaviour where
an "in limbo" system memory object is lacking the relevant placement
flags etc. before we first allocate the ttm_tt, leading to ttm
performing a move when not needed, since the current placement is seen
as not compatible.
Suggested-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Fixes: 2ed38cec ("drm/i915: opportunistically apply ALLOC_CONTIGIOUS")
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@linux.intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Acked-by: default avatarNirmoy Das <nirmoy.das@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220324172143.377104-1-matthew.auld@intel.com
parent d8b93201
...@@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct intel_memory_region *mr, ...@@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct intel_memory_region *mr,
memset(place, 0, sizeof(*place)); memset(place, 0, sizeof(*place));
place->mem_type = intel_region_to_ttm_type(mr); place->mem_type = intel_region_to_ttm_type(mr);
if (mr->type == INTEL_MEMORY_SYSTEM)
return;
if (flags & I915_BO_ALLOC_CONTIGUOUS) if (flags & I915_BO_ALLOC_CONTIGUOUS)
place->flags |= TTM_PL_FLAG_CONTIGUOUS; place->flags |= TTM_PL_FLAG_CONTIGUOUS;
if (offset != I915_BO_INVALID_OFFSET) { if (offset != I915_BO_INVALID_OFFSET) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment