drm/amdgpu: remove the unused ring parameter from update_spm_vmid()
Subsystems (2)
PATCH v3 12/13 drm/amdgpu: remove the unused ring parameter from update_spm_vmid()
Every remaining caller of adev->gfx.rlc.funcs->update_spm_vmid() passes NULL for ring, since the only callers that ever passed a real ring were removed earlier in this series. Drop the parameter, and the dead SR-IOV one-VF ring-replay code in gfx_v11_0/gfx_v12_0/gfx_v12_1 that only ran when ring was non-NULL.
Signed-off-by Sunil Khatri <[email protected]>
Suggested-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 12 ++---------- drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 11 +---------- drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 15 +++------------ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 4 ++-- 9 files changed, 15 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h +1 -1
@@ -292,7 +292,7 @@ struct amdgpu_rlc_funcs {void (*reset)(struct amdgpu_device *adev);void (*start)(struct amdgpu_device *adev);void (*update_spm_vmid)(struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid); +unsigned int vmid);bool (*is_rlcg_access_range)(struct amdgpu_device *adev,uint32_t reg); };
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -8320,7 +8320,7 @@ static void gfx_v10_0_update_spm_vmid_internal(struct amdgpu_device *adev, }static void gfx_v10_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned int vmid) +unsigned int vmid) {amdgpu_gfx_off_ctrl (adev, false);
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -10
@@ -944,7 +944,7 @@ static int gfx_v11_0_rlc_init(struct amdgpu_device *adev)/* init spm vmid with 0xf */ if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid (adev,0 ,NULL , adev->vm_manager.spm_vmid); + adev->gfx.rlc.funcs->update_spm_vmid (adev,0 , adev->vm_manager.spm_vmid);return 0 ; }
@@ -5748,7 +5748,7 @@ static int gfx_v11_0_update_gfx_clock_gating(struct amdgpu_device *adev, }static void gfx_v11_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid) +unsigned int vmid) {u32 reg, pre_data, data;
@@ -5769,14 +5769,6 @@ static void gfx_v11_0_update_spm_vmid(struct amdgpu_device *adev, int xcc_id,WREG32_SOC15 (GC ,0 , regRLC_SPM_MC_CNTL, data); }amdgpu_gfx_off_ctrl (adev, true); - -if (ring - &&amdgpu_sriov_is_pp_one_vf (adev) - && (pre_data != data) - && ((ring->funcs->type ==AMDGPU_RING_TYPE_GFX ) - || (ring->funcs->type ==AMDGPU_RING_TYPE_COMPUTE ))) { -amdgpu_ring_emit_wreg (ring, reg, data); - } }static const struct amdgpu_rlc_funcs gfx_v11_0_rlc_funcs = {
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +1 -10
@@ -773,7 +773,7 @@ static int gfx_v12_0_rlc_init(struct amdgpu_device *adev)/* init spm vmid with 0xf */ if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid (adev,0 ,NULL , adev->vm_manager.spm_vmid); + adev->gfx.rlc.funcs->update_spm_vmid (adev,0 , adev->vm_manager.spm_vmid);return 0 ; }
@@ -4075,7 +4075,6 @@ static void gfx_v12_0_update_perf_clk(struct amdgpu_device *adev,static void gfx_v12_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid) {u32 reg, data;
@@ -4093,14 +4092,6 @@ static void gfx_v12_0_update_spm_vmid(struct amdgpu_device *adev,WREG32_SOC15_NO_KIQ (GC ,0 , regRLC_SPM_MC_CNTL, data); else WREG32_SOC15(GC, 0, regRLC_SPM_MC_CNTL, data); - -if (ring - &&amdgpu_sriov_is_pp_one_vf (adev) - && ((ring->funcs->type ==AMDGPU_RING_TYPE_GFX ) - || (ring->funcs->type ==AMDGPU_RING_TYPE_COMPUTE ))) { -uint32_t reg =SOC15_REG_OFFSET (GC ,0 , regRLC_SPM_MC_CNTL); -amdgpu_ring_emit_wreg (ring, reg, data); - } }static const struct amdgpu_rlc_funcs gfx_v12_0_rlc_funcs = {
drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +3 -12
@@ -214,7 +214,7 @@ static int gfx_v12_1_init_cp_compute_microcode_bo(struct amdgpu_device *adev);static void gfx_v12_1_xcc_update_medium_grain_clock_gating (struct amdgpu_device *adev,bool enable,int xcc_id,bool force);static void gfx_v12_1_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid); +unsigned int vmid); static void gfx_v12_1_wait_reg_mem(struct amdgpu_ring *ring, int eng_sel, int mem_space, int opt, uint32_t addr0,
@@ -1861,7 +1861,7 @@ static int gfx_v12_1_xcc_rlc_resume(struct amdgpu_device *adev,int r;/* init spm vmid with 0xf */ -gfx_v12_1_update_spm_vmid (adev, xcc_id,NULL , adev->vm_manager.spm_vmid); +gfx_v12_1_update_spm_vmid (adev, xcc_id, adev->vm_manager.spm_vmid);if (adev->firmware.load_type ==AMDGPU_FW_LOAD_PSP ) {gfx_v12_1_xcc_init_csb (adev, xcc_id);
@@ -2918,8 +2918,7 @@ static void gfx_v12_1_update_perf_clk(struct amdgpu_device *adev,static void gfx_v12_1_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring, -unsigned vmid) +unsigned int vmid) {u32 reg, data;
@@ -2936,14 +2935,6 @@ static void gfx_v12_1_update_spm_vmid(struct amdgpu_device *adev,WREG32_SOC15_NO_KIQ (GC ,GET_INST (GC , xcc_id), regRLC_SPM_MC_CNTL, data); elseWREG32_SOC15 (GC ,GET_INST (GC ,xcc_id ),regRLC_SPM_MC_CNTL ,data ); - -if (ring - &&amdgpu_sriov_is_pp_one_vf (adev) - && ((ring->funcs->type ==AMDGPU_RING_TYPE_GFX ) - || (ring->funcs->type ==AMDGPU_RING_TYPE_COMPUTE ))) { -uint32_t reg =SOC15_REG_OFFSET (GC ,GET_INST (GC , xcc_id), regRLC_SPM_MC_CNTL); -amdgpu_ring_emit_wreg (ring, reg, data); - } }static const struct amdgpu_rlc_funcs gfx_v12_1_rlc_funcs = {
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2 -2
@@ -3252,7 +3252,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev)/* init spm vmid with 0xf */ if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid (adev,0 ,NULL , adev->vm_manager.spm_vmid); + adev->gfx.rlc.funcs->update_spm_vmid (adev,0 , adev->vm_manager.spm_vmid);return 0 ; }
@@ -3479,7 +3479,7 @@ static int gfx_v7_0_rlc_resume(struct amdgpu_device *adev) }static void gfx_v7_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid) +unsigned int vmid) {u32 data;
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2 -2
@@ -1274,7 +1274,7 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)/* init spm vmid with 0xf */ if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid (adev,0 ,NULL , adev->vm_manager.spm_vmid); + adev->gfx.rlc.funcs->update_spm_vmid (adev,0 , adev->vm_manager.spm_vmid);return 0 ; }
@@ -5491,7 +5491,7 @@ static void gfx_v8_0_unset_safe_mode(struct amdgpu_device *adev, int xcc_id) }static void gfx_v8_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned vmid) +unsigned int vmid) {u32 data;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1 -1
@@ -5225,7 +5225,7 @@ static void gfx_v9_0_update_spm_vmid_internal(struct amdgpu_device *adev, }static void gfx_v9_0_update_spm_vmid (struct amdgpu_device *adev,int xcc_id, -struct amdgpu_ring *ring,unsigned int vmid) +unsigned int vmid) {amdgpu_gfx_off_ctrl (adev, false);
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +2 -2
@@ -1395,7 +1395,7 @@ static int gfx_v9_4_3_rlc_init(struct amdgpu_device *adev) {/* init spm vmid with 0xf */ if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid (adev,0 ,NULL , adev->vm_manager.spm_vmid); + adev->gfx.rlc.funcs->update_spm_vmid (adev,0 , adev->vm_manager.spm_vmid);return 0 ; }
@@ -1607,7 +1607,7 @@ static int gfx_v9_4_3_rlc_resume(struct amdgpu_device *adev) }static void gfx_v9_4_3_update_spm_vmid (struct amdgpu_device *adev, -int inst,struct amdgpu_ring *ring,unsigned int vmid) +int inst,unsigned int vmid) {u32 reg, pre_data, data;
Signature · 1 line
2.34.1