summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests/mock_region.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2022-03-15 19:14:23 +0100
committerMatthew Auld <matthew.auld@intel.com>2022-03-16 18:50:38 +0100
commitecbf20604848eccc007030766efaed2bb5533191 (patch)
treec88003067d895d7b5fec9651e7a29666842d76ea /drivers/gpu/drm/i915/selftests/mock_region.c
parentdrm/i915: add i915_gem_object_create_region_at() (diff)
downloadlinux-ecbf20604848eccc007030766efaed2bb5533191.tar.xz
linux-ecbf20604848eccc007030766efaed2bb5533191.zip
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/selftests/mock_region.c')
-rw-r--r--drivers/gpu/drm/i915/selftests/mock_region.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/mock_region.c b/drivers/gpu/drm/i915/selftests/mock_region.c
index f16c0b7198c7..670557ce1024 100644
--- a/drivers/gpu/drm/i915/selftests/mock_region.c
+++ b/drivers/gpu/drm/i915/selftests/mock_region.c
@@ -26,6 +26,7 @@ static int mock_region_get_pages(struct drm_i915_gem_object *obj)
int err;
obj->mm.res = intel_region_ttm_resource_alloc(obj->mm.region,
+ obj->bo_offset,
obj->base.size,
obj->flags);
if (IS_ERR(obj->mm.res))
@@ -71,6 +72,8 @@ static int mock_object_init(struct intel_memory_region *mem,
drm_gem_private_object_init(&i915->drm, &obj->base, size);
i915_gem_object_init(obj, &mock_region_obj_ops, &lock_class, flags);
+ obj->bo_offset = offset;
+
obj->read_domains = I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT;
i915_gem_object_set_cache_coherency(obj, I915_CACHE_NONE);