]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Add mem sync flag for IB allocated by SA
authorJinzhou Su <Jinzhou.Su@amd.com>
Tue, 20 Apr 2021 08:17:14 +0000 (16:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:35 +0000 (10:29 +0200)
[ Upstream commit 5c88e3b86a88f14efa0a3ddd28641c6ff49fb9c4 ]

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

Signed-off-by: Jinzhou Su <Jinzhou.Su@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c

index 024d0a563a652be59bc054b9572e55af2e7c76c1..f41764cee6906d21e53c5d08deb9f45369a0e45c 100644 (file)
@@ -77,6 +77,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);