AMD-GFX Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] drm/amdgpu: Add mem sync flag for IB allocated by SA
@ 2021-04-20  8:27 Jinzhou Su
  2021-04-20  8:34 ` Christian König
  0 siblings, 1 reply; 3+ messages in thread
From: Jinzhou Su @ 2021-04-20  8:27 UTC (permalink / raw)
  To: amd-gfx; +Cc: Jinzhou Su, ray.huang, christian.koenig

The buffer of SA bo will be used by many cases. So better
to flush the cache of indirect buffer allocated by SA before
commit the IB.

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
index 148a3b481b12..a2fe2dac32c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
@@ -76,6 +76,8 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 		}
 
 		ib->ptr = amdgpu_sa_bo_cpu_addr(ib->sa_bo);
+		/* flush the cache before commit the IB */
+		ib->flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
 
 		if (!vm)
 			ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo);
-- 
2.27.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: Add mem sync flag for IB allocated by SA
  2021-04-20  8:27 [PATCH] drm/amdgpu: Add mem sync flag for IB allocated by SA Jinzhou Su
@ 2021-04-20  8:34 ` Christian König
  2021-04-20  8:49   ` Huang Rui
  0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2021-04-20  8:34 UTC (permalink / raw)
  To: Jinzhou Su, amd-gfx; +Cc: ray.huang, christian.koenig

Am 20.04.21 um 10:27 schrieb Jinzhou Su:
> The buffer of SA bo will be used by many cases. So better
> to flush the cache of indirect buffer allocated by SA before
> commit the IB.
>
> Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> index 148a3b481b12..a2fe2dac32c1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> @@ -76,6 +76,8 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm,
>   		}
>   
>   		ib->ptr = amdgpu_sa_bo_cpu_addr(ib->sa_bo);
> +		/* flush the cache before commit the IB */

Either drop the comment or change it a bit.

E.g. like "/* Invalidate the cache to make the GPU see the newest SA 
content */

With that done the patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>

Regards,
Christian.

> +		ib->flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
>   
>   		if (!vm)
>   			ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo);

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: Add mem sync flag for IB allocated by SA
  2021-04-20  8:34 ` Christian König
@ 2021-04-20  8:49   ` Huang Rui
  0 siblings, 0 replies; 3+ messages in thread
From: Huang Rui @ 2021-04-20  8:49 UTC (permalink / raw)
  To: Christian König; +Cc: Su, Jinzhou (Joe), Koenig, Christian, amd-gfx

On Tue, Apr 20, 2021 at 04:34:18PM +0800, Christian König wrote:
> Am 20.04.21 um 10:27 schrieb Jinzhou Su:
> > The buffer of SA bo will be used by many cases. So better
> > to flush the cache of indirect buffer allocated by SA before
> > commit the IB.
> >
> > Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> > index 148a3b481b12..a2fe2dac32c1 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
> > @@ -76,6 +76,8 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm,
> >   		}
> >   
> >   		ib->ptr = amdgpu_sa_bo_cpu_addr(ib->sa_bo);
> > +		/* flush the cache before commit the IB */
> 
> Either drop the comment or change it a bit.
> 
> E.g. like "/* Invalidate the cache to make the GPU see the newest SA 
> content */
> 
> With that done the patch is Reviewed-by: Christian König 
> <christian.koenig@amd.com>

Yes, with this fix, patch looks good for me as well.

Reviewed-by: Huang Rui <ray.huang@amd.com>

> 
> Regards,
> Christian.
> 
> > +		ib->flags = AMDGPU_IB_FLAG_EMIT_MEM_SYNC;
> >   
> >   		if (!vm)
> >   			ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo);
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  8:27 [PATCH] drm/amdgpu: Add mem sync flag for IB allocated by SA Jinzhou Su
2021-04-20  8:34 ` Christian König
2021-04-20  8:49   ` Huang Rui

AMD-GFX Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/amd-gfx/0 amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ https://lore.kernel.org/amd-gfx \
		amd-gfx@lists.freedesktop.org
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.amd-gfx


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git