drm/amdgpu: Add mem sync flag for IB allocated by SA
Subsystems (2)
PATCH 1/1 drm/amdgpu: Add mem sync flag for IB allocated by SA
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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -0
@@ -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);
Signature · 6 lines
2.27.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 20.04.21 um 10:27 schrieb Jinzhou Su:
Quoted 14 lines
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, · line 79
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0@@ -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 <[email protected]>
Regards,
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, · line 83
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0+ 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Huang Rui
Reviewed-byQuoted 22 lines · Christian König
Am 20.04.21 um 10:27 schrieb Jinzhou Su:
Quoted 14 lines
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +0
-0drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, · line 79
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0@@ -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.
Quoted 5 lines
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 <[email protected]>
Yes, with this fix, patch looks good for me as well.
Quoted 9 lines
Regards,
Christian.drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, · line 83
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +1
-0+ 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx