mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 16:25:42 -04:00
drm/amd/pm: Add common throttler translation func
Defines smu_cmn_get_indep_throttler_status which performs ASIC independent translation given a corresponding lookup table. Signed-off-by: Graham Sider <Graham.Sider@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
1049de4305
commit
c23083cd37
@@ -398,6 +398,19 @@ int smu_cmn_get_enabled_32_bits_mask(struct smu_context *smu,
|
||||
|
||||
}
|
||||
|
||||
uint64_t smu_cmn_get_indep_throttler_status(
|
||||
const unsigned long dep_status,
|
||||
const uint8_t *throttler_map)
|
||||
{
|
||||
uint64_t indep_status = 0;
|
||||
uint8_t dep_bit = 0;
|
||||
|
||||
for_each_set_bit(dep_bit, &dep_status, 32)
|
||||
indep_status |= 1ULL << throttler_map[dep_bit];
|
||||
|
||||
return indep_status;
|
||||
}
|
||||
|
||||
int smu_cmn_feature_update_enable_state(struct smu_context *smu,
|
||||
uint64_t feature_mask,
|
||||
bool enabled)
|
||||
|
||||
@@ -60,6 +60,10 @@ int smu_cmn_get_enabled_32_bits_mask(struct smu_context *smu,
|
||||
uint32_t *feature_mask,
|
||||
uint32_t num);
|
||||
|
||||
uint64_t smu_cmn_get_indep_throttler_status(
|
||||
const unsigned long dep_status,
|
||||
const uint8_t *throttler_map);
|
||||
|
||||
int smu_cmn_feature_update_enable_state(struct smu_context *smu,
|
||||
uint64_t feature_mask,
|
||||
bool enabled);
|
||||
|
||||
Reference in New Issue
Block a user