mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
drm/ttm: test private resv obj on release/destroy
Test the fences in the private dma_resv object instead of the pointer to a potentially shared dma_resv object. This only matters for imported BOs with an SG table since those don't get their dma_resv pointer replaced on release. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: James Zhu <James.Zhu@amd.com> Reviewed-by: James Zhu <James.Zhu@amd.com> Tested-by: James Zhu <James.Zhu@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250129152849.15777-1-christian.koenig@amd.com
This commit is contained in:
parent
2eeed61db4
commit
fa0af721bd
|
|
@ -235,7 +235,7 @@ static void ttm_bo_delayed_delete(struct work_struct *work)
|
||||||
|
|
||||||
bo = container_of(work, typeof(*bo), delayed_delete);
|
bo = container_of(work, typeof(*bo), delayed_delete);
|
||||||
|
|
||||||
dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP, false,
|
dma_resv_wait_timeout(&bo->base._resv, DMA_RESV_USAGE_BOOKKEEP, false,
|
||||||
MAX_SCHEDULE_TIMEOUT);
|
MAX_SCHEDULE_TIMEOUT);
|
||||||
dma_resv_lock(bo->base.resv, NULL);
|
dma_resv_lock(bo->base.resv, NULL);
|
||||||
ttm_bo_cleanup_memtype_use(bo);
|
ttm_bo_cleanup_memtype_use(bo);
|
||||||
|
|
@ -270,7 +270,7 @@ static void ttm_bo_release(struct kref *kref)
|
||||||
drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node);
|
drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node);
|
||||||
ttm_mem_io_free(bdev, bo->resource);
|
ttm_mem_io_free(bdev, bo->resource);
|
||||||
|
|
||||||
if (!dma_resv_test_signaled(bo->base.resv,
|
if (!dma_resv_test_signaled(&bo->base._resv,
|
||||||
DMA_RESV_USAGE_BOOKKEEP) ||
|
DMA_RESV_USAGE_BOOKKEEP) ||
|
||||||
(want_init_on_free() && (bo->ttm != NULL)) ||
|
(want_init_on_free() && (bo->ttm != NULL)) ||
|
||||||
bo->type == ttm_bo_type_sg ||
|
bo->type == ttm_bo_type_sg ||
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user