aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2021-05-19 10:24:09 +0200
committerDaniel Vetter <[email protected]>2021-05-20 22:28:11 +0200
commit6d0a12c734c302eead11366856aecdae54a401e8 (patch)
treeebe6aee670ce026869a0d9deeaa5d75b3d1ac2a5
parentea8c9ed53f871ac90659fe519c85b8f10a51677d (diff)
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 <[email protected]> Reviewed-by: Christian König <[email protected]> Cc: Christian König <[email protected]> Cc: Christian Koenig <[email protected]> Cc: Huang Rui <[email protected]> Cc: Thomas Hellström <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index ca1b098b6a56..51a94fd63bd7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -682,7 +682,9 @@ int ttm_mem_evict_first(struct ttm_device *bdev,
}
/*
- * Add the last move fence to the BO and reserve a new shared slot.
+ * Add the last move fence to the BO and reserve a new shared slot. We only use
+ * a shared slot to avoid unecessary sync and rely on the subsequent bo move to
+ * either stall or use an exclusive fence respectively set bo->moving.
*/
static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,
struct ttm_resource_manager *man,