Re: [PATCH] drm/amdgpu/vcn: Need to unpause dpg before stop dpg

2023-06-22 Thread Leo Liu

Reviewed-by: Leo Liu 

On 2023-06-20 21:29, Emily Deng wrote:

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

Signed-off-by: Emily Deng 
---
  drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++
  1 file changed, 2 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..259795098173 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -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, );

/* 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);


RE: [PATCH] drm/amdgpu/vcn: Need to unpause dpg before stop dpg

2023-06-21 Thread Deng, Emily
[AMD Official Use Only - General]

Ping.

Best wishes
Emily Deng



>-Original Message-
>From: Emily Deng 
>Sent: Wednesday, June 21, 2023 9:30 AM
>To: amd-gfx@lists.freedesktop.org
>Cc: Deng, Emily 
>Subject: [PATCH] drm/amdgpu/vcn: Need to unpause dpg before stop dpg
>
>Need to unpause dpg first, or it will hit follow error during stop dpg:
>"[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value
>0x0001 != 0xn"
>
>Signed-off-by: Emily Deng 
>---
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++
> 1 file changed, 2 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..259795098173 100644
>--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>@@ -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, );
>   /* 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



[PATCH] drm/amdgpu/vcn: Need to unpause dpg before stop dpg

2023-06-20 Thread Emily Deng
Need to unpause dpg first, or it will hit follow error during stop dpg:
"[drm] Register(1) [regUVD_POWER_STATUS] failed to reach value 0x0001 != 
0xn"

Signed-off-by: Emily Deng 
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 2 ++
 1 file changed, 2 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..259795098173 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -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, );
/* 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