[PATCH 31/31] fixup! drm/i915: Use ttms delayed destroy for all buffer objects

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Sep 22 14:49:01 UTC 2021


---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 3 ++-
 drivers/gpu/drm/ttm/ttm_bo.c               | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c
index 6b8db0ea226b..00b3e1359e0e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c
@@ -258,7 +258,8 @@ void __i915_gem_free_object(struct drm_i915_gem_object *obj)
 
 static void i915_nonttm_bo_destroy(struct ttm_buffer_object *bo)
 {
-	struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
+	struct drm_i915_gem_object *obj =
+		container_of(bo, struct drm_i915_gem_object, __do_not_access);
 
 	/* This releases all gem object bindings to the backend. */
 	__i915_gem_free_object(obj);
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 04a6738d694f..620590e5062e 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -487,6 +487,8 @@ void ttm_bo_release_unmanaged(struct ttm_device *bdev,
 	bo->bdev = bdev;
 	bo->destroy = destroy;
 	atomic_inc(&ttm_glob.bo_count);
+	INIT_LIST_HEAD(&bo->lru);
+	INIT_LIST_HEAD(&bo->ddestroy);
 
 	WARN_ON(bo->deleted);
 
-- 
2.33.0



More information about the Intel-gfx-trybot mailing list