AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Clear VCN cache when hw_init
@ 2023-06-20 13:29 Horace Chen
  2023-06-21  9:25 ` Deng, Emily
  2023-06-30 11:38 ` Christian König
  0 siblings, 2 replies; 7+ messages in thread
From: Horace Chen @ 2023-06-20 13:29 UTC (permalink / raw)
  To: amd-gfx
  Cc: Andrey Grodzovsky, Jack Xiao, Feifei Xu, horace.chen,
	Haijun Chang, Deucher Alexander, Evan Quan, Christian König,
	Monk Liu, Hawking Zhang

[Why]
VCN will use some framebuffer space as its cache. It needs to
be reset when reset happens, such as FLR. Otherwise some error
may be kept after the reset.

Signed-off-by: Horace Chen <horace.chen@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index b48bb5212488..2db73a964031 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -1292,6 +1292,7 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
 			cache_size);
 
 		cache_addr = adev->vcn.inst[i].gpu_addr + offset;
+		memset(adev->vcn.inst[i].cpu_addr + offset, 0, AMDGPU_VCN_STACK_SIZE);
 		MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(VCN, i,
 			regUVD_LMI_VCPU_CACHE1_64BIT_BAR_LOW),
 			lower_32_bits(cache_addr));
@@ -1307,6 +1308,8 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
 
 		cache_addr = adev->vcn.inst[i].gpu_addr + offset +
 			AMDGPU_VCN_STACK_SIZE;
+		memset(adev->vcn.inst[i].cpu_addr + offset + AMDGPU_VCN_STACK_SIZE, 0,
+			AMDGPU_VCN_STACK_SIZE);
 		MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(VCN, i,
 			regUVD_LMI_VCPU_CACHE2_64BIT_BAR_LOW),
 			lower_32_bits(cache_addr));
-- 
2.34.1


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

end of thread, other threads:[~2023-07-06 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-20 13:29 [PATCH] drm/amdgpu: Clear VCN cache when hw_init Horace Chen
2023-06-21  9:25 ` Deng, Emily
2023-06-30 11:38 ` Christian König
2023-07-05 19:57   ` Leo Liu
2023-07-06  7:24     ` Christian König
2023-07-06  8:56       ` Chen, Horace
2023-07-06 13:56         ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox