summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2022-03-15 21:14:23 +0300
committerMatthew Auld <matthew.auld@intel.com>2022-03-16 20:50:38 +0300
commitecbf20604848eccc007030766efaed2bb5533191 (patch)
treec88003067d895d7b5fec9651e7a29666842d76ea /drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
parent9b78b5dade2d26e2b77f1ac27044946e4e8e7247 (diff)
downloadlinux-ecbf20604848eccc007030766efaed2bb5533191.tar.xz
drm/i915/ttm: wire up the object offset
For the ttm backend we can use existing placements fpfn and lpfn to force the allocator to place the object at the requested offset, potentially evicting stuff if the spot is currently occupied. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220315181425.576828-5-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_ttm_buddy_manager.c')
-rw-r--r--drivers/gpu/drm/i915/i915_ttm_buddy_manager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
index 129f668f21ff..8e4e3f72c1ef 100644
--- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
+++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
@@ -71,7 +71,8 @@ static int i915_ttm_buddy_man_alloc(struct ttm_resource_manager *man,
GEM_BUG_ON(min_page_size < mm->chunk_size);
- if (place->flags & TTM_PL_FLAG_CONTIGUOUS) {
+ if (place->fpfn + bman_res->base.num_pages != place->lpfn &&
+ place->flags & TTM_PL_FLAG_CONTIGUOUS) {
unsigned long pages;
size = roundup_pow_of_two(size);