* [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot
@ 2021-05-19 8:24 Daniel Vetter
2021-05-19 10:43 ` Christian König
2021-05-19 10:56 ` Huang Rui
0 siblings, 2 replies; 4+ messages in thread
From: Daniel Vetter @ 2021-05-19 8:24 UTC (permalink / raw)
To: DRI Development
Cc: Thomas Hellström, Daniel Vetter, Huang Rui,
Christian König, Daniel Vetter, Christian Koenig
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.
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>
---
drivers/gpu/drm/ttm/ttm_bo.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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,
--
2.31.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot
2021-05-19 8:24 [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot Daniel Vetter
@ 2021-05-19 10:43 ` Christian König
2021-05-20 20:28 ` Daniel Vetter
2021-05-19 10:56 ` Huang Rui
1 sibling, 1 reply; 4+ messages in thread
From: Christian König @ 2021-05-19 10:43 UTC (permalink / raw)
To: Daniel Vetter, DRI Development
Cc: Daniel Vetter, Christian König, Huang Rui, Thomas Hellström
Am 19.05.21 um 10:24 schrieb Daniel Vetter:
> 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.
>
> 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>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot
2021-05-19 8:24 [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot Daniel Vetter
2021-05-19 10:43 ` Christian König
@ 2021-05-19 10:56 ` Huang Rui
1 sibling, 0 replies; 4+ messages in thread
From: Huang Rui @ 2021-05-19 10:56 UTC (permalink / raw)
To: Daniel Vetter
Cc: Daniel Vetter, Christian König, Koenig, Christian,
DRI Development, Thomas Hellström
On Wed, May 19, 2021 at 04:24:09PM +0800, Daniel Vetter wrote:
> 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.
>
> 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>
Acked-by: Huang Rui <ray.huang@amd.com>
> ---
> drivers/gpu/drm/ttm/ttm_bo.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> 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,
> --
> 2.31.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot
2021-05-19 10:43 ` Christian König
@ 2021-05-20 20:28 ` Daniel Vetter
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2021-05-20 20:28 UTC (permalink / raw)
To: Christian König
Cc: Thomas Hellström, Daniel Vetter, DRI Development, Huang Rui,
Christian König, Daniel Vetter
On Wed, May 19, 2021 at 12:43:49PM +0200, Christian König wrote:
> Am 19.05.21 um 10:24 schrieb Daniel Vetter:
> > 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.
> >
> > 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>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
Applied to drm-misc-next, thanks for reviewing.
-Daniel
>
> > ---
> > drivers/gpu/drm/ttm/ttm_bo.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > 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,
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-05-20 20:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 8:24 [PATCH] drm/ttm: Explain why ttm_bo_add_move_fence uses a shared slot Daniel Vetter
2021-05-19 10:43 ` Christian König
2021-05-20 20:28 ` Daniel Vetter
2021-05-19 10:56 ` Huang Rui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.