diff options
author | Lijo Lazar <lijo.lazar@amd.com> | 2023-09-11 13:48:11 +0530 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-09-20 12:23:28 -0400 |
commit | 4e8303cf2c4dd27374a16a8881ec1a1cd5baf86f (patch) | |
tree | 1b95c903467e89eec1b8dacdc9f776a838bb3423 /drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c | |
parent | addd7aef251cca374cef743824cc5ae230370bd0 (diff) |
drm/amdgpu: Use function for IP version check
Use an inline function for version check. Gives more flexibility to
handle any format changes.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c index 6f20f9889a78..ab06c2b4b20b 100644 --- a/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/hdp_v6_0.c @@ -51,7 +51,7 @@ static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev, AMD_CG_SUPPORT_HDP_SD))) return; - if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0)) + if (amdgpu_ip_version(adev, HDP_HWIP, 0) == IP_VERSION(6, 1, 0)) hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1); else hdp_clk_cntl = RREG32_SOC15(HDP, 0, regHDP_CLK_CNTL); @@ -61,7 +61,7 @@ static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev, * forced on IPH & RC clock */ hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL, RC_MEM_CLK_SOFT_OVERRIDE, 1); - if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0)) + if (amdgpu_ip_version(adev, HDP_HWIP, 0) == IP_VERSION(6, 1, 0)) WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1, hdp_clk_cntl); else WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl); @@ -126,7 +126,7 @@ static void hdp_v6_0_update_clock_gating(struct amdgpu_device *adev, /* disable IPH & RC clock override after clock/power mode changing */ hdp_clk_cntl = REG_SET_FIELD(hdp_clk_cntl, HDP_CLK_CNTL, RC_MEM_CLK_SOFT_OVERRIDE, 0); - if (adev->ip_versions[HDP_HWIP][0] == IP_VERSION(6, 1, 0)) + if (amdgpu_ip_version(adev, HDP_HWIP, 0) == IP_VERSION(6, 1, 0)) WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL_V6_1, hdp_clk_cntl); else WREG32_SOC15(HDP, 0, regHDP_CLK_CNTL, hdp_clk_cntl); |