drm/ttm: Add release_notify callback to ttm_bo_driver
This notifies the driver that a BO is about to be released. Releasing a BO also invokes the move_notify callback from ttm_bo_cleanup_memtype_use, but that happens too late for anything that would add fences to the BO and require a delayed delete. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:

committed by
Alex Deucher

parent
d9ec5cfd5a
commit
274840e544
@@ -671,6 +671,9 @@ static void ttm_bo_release(struct kref *kref)
|
||||
struct ttm_bo_device *bdev = bo->bdev;
|
||||
struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type];
|
||||
|
||||
if (bo->bdev->driver->release_notify)
|
||||
bo->bdev->driver->release_notify(bo);
|
||||
|
||||
drm_vma_offset_remove(&bdev->vma_manager, &bo->vma_node);
|
||||
ttm_mem_io_lock(man, false);
|
||||
ttm_mem_io_free_vm(bo);
|
||||
|
Reference in New Issue
Block a user