Commit f704ff7c authored by Christian König's avatar Christian König

drm/ttm: individualize resv objects before calling release_notify

This allows release_notify to add and remove fences from deleted objects.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarxinhui pan <xinhui.pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/352750/
parent 519c2de0
...@@ -572,14 +572,6 @@ static void ttm_bo_release(struct kref *kref) ...@@ -572,14 +572,6 @@ static void ttm_bo_release(struct kref *kref)
int ret; int ret;
if (!bo->deleted) { if (!bo->deleted) {
if (bo->bdev->driver->release_notify)
bo->bdev->driver->release_notify(bo);
drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node);
ttm_mem_io_lock(man, false);
ttm_mem_io_free_vm(bo);
ttm_mem_io_unlock(man);
ret = ttm_bo_individualize_resv(bo); ret = ttm_bo_individualize_resv(bo);
if (ret) { if (ret) {
/* Last resort, if we fail to allocate memory for the /* Last resort, if we fail to allocate memory for the
...@@ -588,6 +580,14 @@ static void ttm_bo_release(struct kref *kref) ...@@ -588,6 +580,14 @@ static void ttm_bo_release(struct kref *kref)
dma_resv_wait_timeout_rcu(bo->base.resv, true, false, dma_resv_wait_timeout_rcu(bo->base.resv, true, false,
30 * HZ); 30 * HZ);
} }
if (bo->bdev->driver->release_notify)
bo->bdev->driver->release_notify(bo);
drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node);
ttm_mem_io_lock(man, false);
ttm_mem_io_free_vm(bo);
ttm_mem_io_unlock(man);
} }
if (!dma_resv_test_signaled_rcu(bo->base.resv, true)) { if (!dma_resv_test_signaled_rcu(bo->base.resv, true)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment