Skip to content

Commit 1ddf62e

Browse files
committed
drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot
Motivated because I got confused and Christian confirmed why this works. I think this is non-obvious enough that it merits a slightly longer comment. Acked-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Cc: Christian König <ckoenig.leichtzumerken@gmail.com> Cc: Christian Koenig <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210519082409.672016-1-daniel.vetter@ffwll.ch
1 parent 7e1f8fc commit 1ddf62e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,9 @@ int ttm_mem_evict_first(struct ttm_device *bdev,
682682
}
683683

684684
/*
685-
* Add the last move fence to the BO and reserve a new shared slot.
685+
* Add the last move fence to the BO and reserve a new shared slot. We only use
686+
* a shared slot to avoid unecessary sync and rely on the subsequent bo move to
687+
* either stall or use an exclusive fence respectively set bo->moving.
686688
*/
687689
static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
688690
struct ttm_resource_manager *man,

0 commit comments

Comments
 (0)