drm/amdgpu/vcn: using separate VCN1_AON_SOC offset
authorRuijing Dong <ruijing.dong@amd.com>
Fri, 2 May 2025 15:19:26 +0000 (11:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 7 May 2025 21:42:19 +0000 (17:42 -0400)
VCN1_AON_SOC_ADDRESS_3_0 offset varies on different
VCN generations, the issue in vcn4.0.5 is caused by
a different VCN1_AON_SOC_ADDRESS_3_0 offset.

This patch does the following:

    1. use the same offset for other VCN generations.
    2. use the vcn4.0.5 special offset
    3. update vcn_4_0 and vcn_5_0

Acked-by: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c

index cdcdae7..83adf81 100644 (file)
@@ -66,7 +66,6 @@
 #define VCN_ENC_CMD_REG_WAIT           0x0000000c
 
 #define VCN_AON_SOC_ADDRESS_2_0        0x1f800
-#define VCN1_AON_SOC_ADDRESS_3_0       0x48000
 #define VCN_VID_IP_ADDRESS_2_0         0x0
 #define VCN_AON_IP_ADDRESS_2_0         0x30000
 
index 8e7a36f..b8d835c 100644 (file)
@@ -39,6 +39,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                                        0x1fa00
 #define VCN1_VID_SOC_ADDRESS_3_0                               0x48200
+#define VCN1_AON_SOC_ADDRESS_3_0                               0x48000
 
 #define mmUVD_CONTEXT_ID_INTERNAL_OFFSET                       0x1fd
 #define mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET                   0x503
index d716510..3eec1b8 100644 (file)
@@ -39,6 +39,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                                        0x1fa00
 #define VCN1_VID_SOC_ADDRESS_3_0                               0x48200
+#define VCN1_AON_SOC_ADDRESS_3_0                               0x48000
 
 #define mmUVD_CONTEXT_ID_INTERNAL_OFFSET                       0x27
 #define mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET                   0x0f
index 22ae193..0b19f0a 100644 (file)
@@ -40,6 +40,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                                        0x1fa00
 #define VCN1_VID_SOC_ADDRESS_3_0                               0x48200
+#define VCN1_AON_SOC_ADDRESS_3_0                               0x48000
 
 #define mmUVD_CONTEXT_ID_INTERNAL_OFFSET                       0x27
 #define mmUVD_GPCOM_VCPU_CMD_INTERNAL_OFFSET                   0x0f
index c6f6392..1f777c1 100644 (file)
@@ -46,6 +46,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                                                        0x1fb00
 #define VCN1_VID_SOC_ADDRESS_3_0                                               0x48300
+#define VCN1_AON_SOC_ADDRESS_3_0                                               0x48000
 
 #define VCN_HARVEST_MMSCH                                                              0
 
@@ -614,7 +615,8 @@ static void vcn_v4_0_mc_resume_dpg_mode(struct amdgpu_vcn_inst *vinst,
 
        /* VCN global tiling registers */
        WREG32_SOC15_DPG_MODE(inst_idx, SOC15_DPG_MODE_OFFSET(
-               VCN, 0, regUVD_GFX10_ADDR_CONFIG), adev->gfx.config.gb_addr_config, 0, indirect);
+                       VCN, inst_idx, regUVD_GFX10_ADDR_CONFIG),
+                       adev->gfx.config.gb_addr_config, 0, indirect);
 }
 
 /**
index 139c83b..712e1fb 100644 (file)
@@ -45,6 +45,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                0x1fb00
 #define VCN1_VID_SOC_ADDRESS_3_0       0x48300
+#define VCN1_AON_SOC_ADDRESS_3_0       0x48000
 
 static const struct amdgpu_hwip_reg_entry vcn_reg_list_4_0_3[] = {
        SOC15_REG_ENTRY_STR(VCN, 0, regUVD_POWER_STATUS),
index a8cfc63..5584697 100644 (file)
@@ -46,6 +46,7 @@
 
 #define VCN_VID_SOC_ADDRESS_2_0                                                0x1fb00
 #define VCN1_VID_SOC_ADDRESS_3_0                                       (0x48300 + 0x38000)
+#define VCN1_AON_SOC_ADDRESS_3_0                                       (0x48000 + 0x38000)
 
 #define VCN_HARVEST_MMSCH                                                      0
 
index d99d05f..b90da3d 100644 (file)
@@ -533,7 +533,8 @@ static void vcn_v5_0_0_mc_resume_dpg_mode(struct amdgpu_vcn_inst *vinst,
 
        /* VCN global tiling registers */
        WREG32_SOC24_DPG_MODE(inst_idx, SOC24_DPG_MODE_OFFSET(
-               VCN, 0, regUVD_GFX10_ADDR_CONFIG), adev->gfx.config.gb_addr_config, 0, indirect);
+               VCN, inst_idx, regUVD_GFX10_ADDR_CONFIG),
+               adev->gfx.config.gb_addr_config, 0, indirect);
 
        return;
 }