提交 4bd9f516 编写于 作者: A Alex Deucher

drm/radeon/dpm: add pcie gen helper function

Add a helper function to determine the preferred
pcie gen based on the card, system, and circumstance.
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 2abba66e
...@@ -997,3 +997,26 @@ void r600_free_extended_power_table(struct radeon_device *rdev) ...@@ -997,3 +997,26 @@ void r600_free_extended_power_table(struct radeon_device *rdev)
if (rdev->pm.dpm.dyn_state.ppm_table) if (rdev->pm.dpm.dyn_state.ppm_table)
kfree(rdev->pm.dpm.dyn_state.ppm_table); kfree(rdev->pm.dpm.dyn_state.ppm_table);
} }
enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev,
u32 sys_mask,
enum radeon_pcie_gen asic_gen,
enum radeon_pcie_gen default_gen)
{
switch (asic_gen) {
case RADEON_PCIE_GEN1:
return RADEON_PCIE_GEN1;
case RADEON_PCIE_GEN2:
return RADEON_PCIE_GEN2;
case RADEON_PCIE_GEN3:
return RADEON_PCIE_GEN3;
default:
if ((sys_mask & DRM_PCIE_SPEED_80) && (default_gen == RADEON_PCIE_GEN3))
return RADEON_PCIE_GEN3;
else if ((sys_mask & DRM_PCIE_SPEED_50) && (default_gen == RADEON_PCIE_GEN2))
return RADEON_PCIE_GEN2;
else
return RADEON_PCIE_GEN1;
}
return RADEON_PCIE_GEN1;
}
...@@ -218,4 +218,9 @@ bool r600_is_internal_thermal_sensor(enum radeon_int_thermal_type sensor); ...@@ -218,4 +218,9 @@ bool r600_is_internal_thermal_sensor(enum radeon_int_thermal_type sensor);
int r600_parse_extended_power_table(struct radeon_device *rdev); int r600_parse_extended_power_table(struct radeon_device *rdev);
void r600_free_extended_power_table(struct radeon_device *rdev); void r600_free_extended_power_table(struct radeon_device *rdev);
enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev,
u32 sys_mask,
enum radeon_pcie_gen asic_gen,
enum radeon_pcie_gen default_gen);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册