mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
drm/amd: Move AMD_IS_APU check for ASPM into top level function
There is no need for every ASIC driver to perform the same check. Move the duplicated code into amdgpu_device_should_use_aspm(). Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
fbf1035b03
commit
1a6513de49
|
|
@ -1496,6 +1496,8 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
|
|||
default:
|
||||
return false;
|
||||
}
|
||||
if (adev->flags & AMD_IS_APU)
|
||||
return false;
|
||||
return pcie_aspm_enabled(adev->pdev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1709,10 +1709,6 @@ static void cik_program_aspm(struct amdgpu_device *adev)
|
|||
if (pci_is_root_bus(adev->pdev->bus))
|
||||
return;
|
||||
|
||||
/* XXX double check APUs */
|
||||
if (adev->flags & AMD_IS_APU)
|
||||
return;
|
||||
|
||||
orig = data = RREG32_PCIE(ixPCIE_LC_N_FTS_CNTL);
|
||||
data &= ~PCIE_LC_N_FTS_CNTL__LC_XMIT_N_FTS_MASK;
|
||||
data |= (0x24 << PCIE_LC_N_FTS_CNTL__LC_XMIT_N_FTS__SHIFT) |
|
||||
|
|
|
|||
|
|
@ -516,8 +516,7 @@ static void nv_program_aspm(struct amdgpu_device *adev)
|
|||
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk())
|
||||
return;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU) &&
|
||||
(adev->nbio.funcs->program_aspm))
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2440,8 +2440,6 @@ static void si_program_aspm(struct amdgpu_device *adev)
|
|||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (adev->flags & AMD_IS_APU)
|
||||
return;
|
||||
orig = data = RREG32_PCIE_PORT(PCIE_LC_N_FTS_CNTL);
|
||||
data &= ~LC_XMIT_N_FTS_MASK;
|
||||
data |= LC_XMIT_N_FTS(0x24) | LC_XMIT_N_FTS_OVERRIDE_EN;
|
||||
|
|
|
|||
|
|
@ -646,8 +646,7 @@ static void soc15_program_aspm(struct amdgpu_device *adev)
|
|||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU) &&
|
||||
(adev->nbio.funcs->program_aspm))
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -433,8 +433,7 @@ static void soc21_program_aspm(struct amdgpu_device *adev)
|
|||
if (!amdgpu_device_should_use_aspm(adev))
|
||||
return;
|
||||
|
||||
if (!(adev->flags & AMD_IS_APU) &&
|
||||
(adev->nbio.funcs->program_aspm))
|
||||
if (adev->nbio.funcs->program_aspm)
|
||||
adev->nbio.funcs->program_aspm(adev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1127,8 +1127,7 @@ static void vi_program_aspm(struct amdgpu_device *adev)
|
|||
if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_pcie_dynamic_switching_supported())
|
||||
return;
|
||||
|
||||
if (adev->flags & AMD_IS_APU ||
|
||||
adev->asic_type < CHIP_POLARIS10)
|
||||
if (adev->asic_type < CHIP_POLARIS10)
|
||||
return;
|
||||
|
||||
orig = data = RREG32_PCIE(ixPCIE_LC_CNTL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user