summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2022-02-28 15:36:07 +0300
committerMatthew Auld <matthew.auld@intel.com>2022-03-01 11:50:48 +0300
commitfb87550d2517878ebcd112f080865a2dc38e9bae (patch)
tree9cad550282717fb2a7d383fb6761021a5f85f366 /drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
parent6e0c5bf0cc1369df0057bccb3fc1af3b38d07e32 (diff)
downloadlinux-fb87550d2517878ebcd112f080865a2dc38e9bae.tar.xz
drm/i915/selftests: exercise mmap migration
Exercise each of the migration scenarios, verifying that the final placement and buffer contents match our expectations. v2(Thomas): Replace for_i915_gem_ww() block with simpler object_lock() v3: - For testing purposes allow forcing the io_size such that we can exercise the allocation + migration path on devices that don't have the small BAR limit. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220228123607.580432-4-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.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
index 92d49a3c378c..129f668f21ff 100644
--- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
+++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
@@ -362,3 +362,13 @@ u64 i915_ttm_buddy_man_visible_size(struct ttm_resource_manager *man)
return bman->visible_size;
}
+
+#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
+void i915_ttm_buddy_man_force_visible_size(struct ttm_resource_manager *man,
+ u64 size)
+{
+ struct i915_ttm_buddy_manager *bman = to_buddy_manager(man);
+
+ bman->visible_size = size;
+}
+#endif