Skip to contentSkip to conversation

drm/amdgpu/vcn: reset fw_shared under SRIOV

PATCH In review Bokun Zhang 2 participants 3 messages Dec 11, 2024 – Dec 12, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/vcn: reset fw_shared under SRIOV

- The previous patch only considered the case for baremetal and not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF

Change-Id If26a377a2fe8f2aa09bfa21fc54bf26e80fd564c
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -0
index eeade7366e82..ecdc027f8220 100644
@@ -957,6 +957,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)
 	for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
 		vcn_inst = GET_INST(VCN, i);
 
+		vcn_v4_0_3_fw_shared_init(adev, vcn_inst);
+
 		memset(&header, 0, sizeof(struct mmsch_v4_0_3_init_header));
 		header.version = MMSCH_VERSION;
 		header.total_size = sizeof(struct mmsch_v4_0_3_init_header) >> 2;
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Please help us review this patch.

Thanks!

________________________________
From: Bokun Zhang <[email protected]>
Sent: Wednesday, December 11, 2024 4:48 PM
To: [email protected] <[email protected]>
Cc: Zhang, Bokun <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn: reset fw_shared under SRIOV

- The previous patch only considered the case for baremetal and not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF

Change-Id If26a377a2fe8f2aa09bfa21fc54bf26e80fd564c
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -0
index eeade7366e82..ecdc027f8220 100644
@@ -957,6 +957,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)
         for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
                 vcn_inst = GET_INST(VCN, i);
 
+               vcn_v4_0_3_fw_shared_init(adev, vcn_inst);
+
                 memset(&header, 0, sizeof(struct mmsch_v4_0_3_init_header));
                 header.version = MMSCH_VERSION;
                 header.total_size = sizeof(struct mmsch_v4_0_3_init_header) >> 2;

--
2.34.1

Acked-by on v1 1/1
#2 lore raw
In reply to Bokun Zhang
Quoted 6 lines · Bokun Zhang

- The previous patch only considered the case for baremetal and not applicable for SRIOV code path. We also need to init fw_share for SRIOV VF

Fixes c4b519b70d9f ("drm/amdgpu/vcn: reset fw_shared when VCPU

buffers corrupted on vcn v4.0.3")

Quoted 21 lines

Change-Id: If26a377a2fe8f2aa09bfa21fc54bf26e80fd564c

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c +2 -1
index eeade7366e82..ecdc027f8220 100644
@@ -957,6 +957,8 @@ static int vcn_v4_0_3_start_sriov(struct amdgpu_device *adev)
        for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
                vcn_inst = GET_INST(VCN, i);
 
+               vcn_v4_0_3_fw_shared_init(adev, vcn_inst);
+
                memset(&header, 0, sizeof(struct mmsch_v4_0_3_init_header));
                header.version = MMSCH_VERSION;
                header.total_size = sizeof(struct mmsch_v4_0_3_init_header) >> 2;
--

2.34.1