[PATCH 15/22] compat

Matthew Auld matthew.auld at intel.com
Tue Jan 18 19:35:08 UTC 2022


Dirty hack, but otherwise TTM doesn't understand non-mappable ->
mappable migration, since it thinks the current resource is already
compatible and just doesn't do any move. We can repurpose res->start to
work around this it seems.
---
 drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
index 626108fb9725..d31a41be1007 100644
--- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
+++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
@@ -107,6 +107,11 @@ static int i915_ttm_buddy_man_alloc(struct ttm_resource_manager *man,
 		mutex_unlock(&bman->lock);
 	}
 
+	if (place->lpfn)
+		bman_res->base.start = 0;
+	else
+		bman_res->base.start = SZ_256M;
+
 	*res = &bman_res->base;
 	return 0;
 
-- 
2.31.1



More information about the Intel-gfx-trybot mailing list