Skip to contentSkip to conversation

drm/amdgpu/vcn: Need to pause dpg before stop dpg

PATCH In review Emily Deng 2 participants 3 messages Jun 19, 2023 – Jun 21, 2023

Subsystems (2)
lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu/vcn: Need to pause dpg before stop dpg

Need to pause dpg first, or it will hit follow error during stop dpg:
"[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000000n"

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +2 -0
index b48bb5212488..259795098173 100644
@@ -1424,8 +1424,10 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
  */
 static void vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)
 {
+	struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__UNPAUSE};
 	uint32_t tmp;
 
+	vcn_v4_0_pause_dpg_mode(adev, inst_idx, &state);
 	/* Wait for power status to be 1 */
 	SOC15_WAIT_ON_RREG(VCN, inst_idx, regUVD_POWER_STATUS, 1,
 		UVD_POWER_STATUS__UVD_POWER_STATUS_MASK);
Signature · 1 line
2.36.1
#1 lore raw

[AMD Official Use Only - General]

Hi Emily,

Do you want to pause or un-pause dpg mode based on and change and commit message?

With bare metal, before calling the stop, the state of dpg should be un-paused within the call the of amdgpu_vcn_idle_work_handler, is it not the case for SRIOV?

Regards,
Leo

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Emily Deng
Sent: Monday, June 19, 2023 6:24 AM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn: Need to pause dpg before stop dpg

Need to pause dpg first, or it will hit follow error during stop dpg:
"[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000000n"

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +2 -1
index b48bb5212488..259795098173 100644
@@ -1424,8 +1424,10 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
  */
 static void vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx)  {
+       struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__UNPAUSE};
        uint32_t tmp;
 
+       vcn_v4_0_pause_dpg_mode(adev, inst_idx, &state);
        /* Wait for power status to be 1 */
        SOC15_WAIT_ON_RREG(VCN, inst_idx, regUVD_POWER_STATUS, 1,
                UVD_POWER_STATUS__UVD_POWER_STATUS_MASK);
--

2.36.1

#2 lore raw

[AMD Official Use Only - General]

Hi Leo,
Sorry, need to correct the commit message, it is unpasue, during unloading driver, I haven't seen any place call un-pause dpg for vcn4.0 for hw fini. And it will report "[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value

Quoted 1 line

0x00000001 != 0x00000000n ", and with adding calling un-pause dpg, then issue disappears.

Best wishes
Emily Deng

Quoted 60 lines

-----Original Message-----
From: Liu, Leo <[email protected]>
Sent: Monday, June 19, 2023 9:27 PM
To: Deng, Emily <[email protected]>; [email protected]
Cc: Deng, Emily <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/vcn: Need to pause dpg before stop dpg

[AMD Official Use Only - General]

Hi Emily,

Do you want to pause or un-pause dpg mode based on and change and commit message?

With bare metal, before calling the stop, the state of dpg should be un-paused within the call the of amdgpu_vcn_idle_work_handler, is it not the case for SRIOV?

Regards,
Leo

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Emily Deng
Sent: Monday, June 19, 2023 6:24 AM
To: [email protected]
Cc: Deng, Emily <[email protected]>
Subject: [PATCH] drm/amdgpu/vcn: Need to pause dpg before stop dpg

Need to pause dpg first, or it will hit follow error during stop dpg:
"[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000000n"

---
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++

1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +0 -0
index b48bb5212488..259795098173 100644
@@ -1424,8 +1424,10 @@ static int vcn_v4_0_start_sriov(struct
 amdgpu_device *adev)
 */

static void vcn_v4_0_stop_dpg_mode(struct amdgpu_device *adev, int inst_idx) {
+ struct dpg_pause_state state = {.fw_based =

VCN_DPG_STATE__UNPAUSE};
       uint32_t tmp;
+       vcn_v4_0_pause_dpg_mode(adev, inst_idx, &state);
       /* Wait for power status to be 1 */
       SOC15_WAIT_ON_RREG(VCN, inst_idx, regUVD_POWER_STATUS, 1,
               UVD_POWER_STATUS__UVD_POWER_STATUS_MASK);

--
2.36.1