mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
drm/amdgpu: move program_aspm to amdgpu_nbio
The program_aspm helper is duplicated across multiple files with identical logic. Move it to amdgpu_nbio.c as amdgpu_nbio_program_aspm and update all users accordingly. Signed-off-by: Gabriel Almeida <gabrielsousa230@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
2eb0681ea7
commit
86931542d0
|
|
@ -84,3 +84,13 @@ int amdgpu_nbio_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *
|
|||
amdgpu_ras_block_late_fini(adev, ras_block);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
void amdgpu_nbio_program_aspm(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,4 +121,6 @@ u64 amdgpu_nbio_get_pcie_replay_count(struct amdgpu_device *adev);
|
|||
|
||||
bool amdgpu_nbio_is_replay_cnt_supported(struct amdgpu_device *adev);
|
||||
|
||||
void amdgpu_nbio_program_aspm(struct amdgpu_device *adev);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -511,16 +511,6 @@ static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void nv_program_aspm(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
|
||||
}
|
||||
|
||||
const struct amdgpu_ip_block_version nv_common_ip_block = {
|
||||
.type = AMD_IP_BLOCK_TYPE_COMMON,
|
||||
.major = 1,
|
||||
|
|
@ -984,7 +974,7 @@ static int nv_common_hw_init(struct amdgpu_ip_block *ip_block)
|
|||
adev->nbio.funcs->apply_l1_link_width_reconfig_wa(adev);
|
||||
|
||||
/* enable aspm */
|
||||
nv_program_aspm(adev);
|
||||
amdgpu_nbio_program_aspm(adev);
|
||||
/* setup nbio registers */
|
||||
adev->nbio.funcs->init_registers(adev);
|
||||
/* remap HDP registers to a hole in mmio space,
|
||||
|
|
|
|||
|
|
@ -695,15 +695,6 @@ static int soc15_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void soc15_program_aspm(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
}
|
||||
|
||||
const struct amdgpu_ip_block_version vega10_common_ip_block =
|
||||
{
|
||||
.type = AMD_IP_BLOCK_TYPE_COMMON,
|
||||
|
|
@ -1284,7 +1275,7 @@ static int soc15_common_hw_init(struct amdgpu_ip_block *ip_block)
|
|||
struct amdgpu_device *adev = ip_block->adev;
|
||||
|
||||
/* enable aspm */
|
||||
soc15_program_aspm(adev);
|
||||
amdgpu_nbio_program_aspm(adev);
|
||||
/* setup nbio registers */
|
||||
adev->nbio.funcs->init_registers(adev);
|
||||
/* remap HDP registers to a hole in mmio space,
|
||||
|
|
|
|||
|
|
@ -470,15 +470,6 @@ static int soc21_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void soc21_program_aspm(struct amdgpu_device *adev)
|
||||
{
|
||||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
}
|
||||
|
||||
const struct amdgpu_ip_block_version soc21_common_ip_block = {
|
||||
.type = AMD_IP_BLOCK_TYPE_COMMON,
|
||||
.major = 1,
|
||||
|
|
@ -925,7 +916,7 @@ static int soc21_common_hw_init(struct amdgpu_ip_block *ip_block)
|
|||
struct amdgpu_device *adev = ip_block->adev;
|
||||
|
||||
/* enable aspm */
|
||||
soc21_program_aspm(adev);
|
||||
amdgpu_nbio_program_aspm(adev);
|
||||
/* setup nbio registers */
|
||||
adev->nbio.funcs->init_registers(adev);
|
||||
/* remap HDP registers to a hole in mmio space,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user