Commit e90b6227 authored by Nils Wallménius's avatar Nils Wallménius Committed by Alex Deucher

drm/amd/powerplay: mark phm_master_table_* structs as const

Also adjust phm_construct_table to take a const pointer
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarNils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d3a84aa0
...@@ -237,7 +237,7 @@ int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) ...@@ -237,7 +237,7 @@ int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)
} }
static struct phm_master_table_item cz_enable_clock_power_gatings_list[] = { static const struct phm_master_table_item cz_enable_clock_power_gatings_list[] = {
/*we don't need an exit table here, because there is only D3 cold on Kv*/ /*we don't need an exit table here, because there is only D3 cold on Kv*/
{ phm_cf_want_uvd_power_gating, cz_tf_uvd_power_gating_initialize }, { phm_cf_want_uvd_power_gating, cz_tf_uvd_power_gating_initialize },
{ phm_cf_want_vce_power_gating, cz_tf_vce_power_gating_initialize }, { phm_cf_want_vce_power_gating, cz_tf_vce_power_gating_initialize },
...@@ -245,7 +245,7 @@ static struct phm_master_table_item cz_enable_clock_power_gatings_list[] = { ...@@ -245,7 +245,7 @@ static struct phm_master_table_item cz_enable_clock_power_gatings_list[] = {
{ NULL, NULL } { NULL, NULL }
}; };
struct phm_master_table_header cz_phm_enable_clock_power_gatings_master = { const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_enable_clock_power_gatings_list cz_enable_clock_power_gatings_list
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "pp_asicblocks.h" #include "pp_asicblocks.h"
extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating); extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating);
extern struct phm_master_table_header cz_phm_enable_clock_power_gatings_master; extern const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master;
extern struct phm_master_table_header cz_phm_disable_clock_power_gatings_master; extern struct phm_master_table_header cz_phm_disable_clock_power_gatings_master;
extern int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate); extern int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
extern int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate); extern int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
......
...@@ -915,7 +915,7 @@ static int cz_tf_update_low_mem_pstate(struct pp_hwmgr *hwmgr, ...@@ -915,7 +915,7 @@ static int cz_tf_update_low_mem_pstate(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
static struct phm_master_table_item cz_set_power_state_list[] = { static const struct phm_master_table_item cz_set_power_state_list[] = {
{NULL, cz_tf_update_sclk_limit}, {NULL, cz_tf_update_sclk_limit},
{NULL, cz_tf_set_deep_sleep_sclk_threshold}, {NULL, cz_tf_set_deep_sleep_sclk_threshold},
{NULL, cz_tf_set_watermark_threshold}, {NULL, cz_tf_set_watermark_threshold},
...@@ -925,13 +925,13 @@ static struct phm_master_table_item cz_set_power_state_list[] = { ...@@ -925,13 +925,13 @@ static struct phm_master_table_item cz_set_power_state_list[] = {
{NULL, NULL} {NULL, NULL}
}; };
static struct phm_master_table_header cz_set_power_state_master = { static const struct phm_master_table_header cz_set_power_state_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_set_power_state_list cz_set_power_state_list
}; };
static struct phm_master_table_item cz_setup_asic_list[] = { static const struct phm_master_table_item cz_setup_asic_list[] = {
{NULL, cz_tf_reset_active_process_mask}, {NULL, cz_tf_reset_active_process_mask},
{NULL, cz_tf_upload_pptable_to_smu}, {NULL, cz_tf_upload_pptable_to_smu},
{NULL, cz_tf_init_sclk_limit}, {NULL, cz_tf_init_sclk_limit},
...@@ -943,7 +943,7 @@ static struct phm_master_table_item cz_setup_asic_list[] = { ...@@ -943,7 +943,7 @@ static struct phm_master_table_item cz_setup_asic_list[] = {
{NULL, NULL} {NULL, NULL}
}; };
static struct phm_master_table_header cz_setup_asic_master = { static const struct phm_master_table_header cz_setup_asic_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_setup_asic_list cz_setup_asic_list
...@@ -984,14 +984,14 @@ static int cz_tf_reset_cc6_data(struct pp_hwmgr *hwmgr, ...@@ -984,14 +984,14 @@ static int cz_tf_reset_cc6_data(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
static struct phm_master_table_item cz_power_down_asic_list[] = { static const struct phm_master_table_item cz_power_down_asic_list[] = {
{NULL, cz_tf_power_up_display_clock_sys_pll}, {NULL, cz_tf_power_up_display_clock_sys_pll},
{NULL, cz_tf_clear_nb_dpm_flag}, {NULL, cz_tf_clear_nb_dpm_flag},
{NULL, cz_tf_reset_cc6_data}, {NULL, cz_tf_reset_cc6_data},
{NULL, NULL} {NULL, NULL}
}; };
static struct phm_master_table_header cz_power_down_asic_master = { static const struct phm_master_table_header cz_power_down_asic_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_power_down_asic_list cz_power_down_asic_list
...@@ -1095,19 +1095,19 @@ static int cz_tf_check_for_dpm_enabled(struct pp_hwmgr *hwmgr, ...@@ -1095,19 +1095,19 @@ static int cz_tf_check_for_dpm_enabled(struct pp_hwmgr *hwmgr,
return 0; return 0;
} }
static struct phm_master_table_item cz_disable_dpm_list[] = { static const struct phm_master_table_item cz_disable_dpm_list[] = {
{ NULL, cz_tf_check_for_dpm_enabled}, { NULL, cz_tf_check_for_dpm_enabled},
{NULL, NULL}, {NULL, NULL},
}; };
static struct phm_master_table_header cz_disable_dpm_master = { static const struct phm_master_table_header cz_disable_dpm_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_disable_dpm_list cz_disable_dpm_list
}; };
static struct phm_master_table_item cz_enable_dpm_list[] = { static const struct phm_master_table_item cz_enable_dpm_list[] = {
{ NULL, cz_tf_check_for_dpm_disabled }, { NULL, cz_tf_check_for_dpm_disabled },
{ NULL, cz_tf_program_voting_clients }, { NULL, cz_tf_program_voting_clients },
{ NULL, cz_tf_start_dpm}, { NULL, cz_tf_start_dpm},
...@@ -1117,7 +1117,7 @@ static struct phm_master_table_item cz_enable_dpm_list[] = { ...@@ -1117,7 +1117,7 @@ static struct phm_master_table_item cz_enable_dpm_list[] = {
{NULL, NULL}, {NULL, NULL},
}; };
static struct phm_master_table_header cz_enable_dpm_master = { static const struct phm_master_table_header cz_enable_dpm_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
cz_enable_dpm_list cz_enable_dpm_list
......
...@@ -615,7 +615,7 @@ static int tf_fiji_thermal_disable_alert(struct pp_hwmgr *hwmgr, ...@@ -615,7 +615,7 @@ static int tf_fiji_thermal_disable_alert(struct pp_hwmgr *hwmgr,
return fiji_thermal_disable_alert(hwmgr); return fiji_thermal_disable_alert(hwmgr);
} }
static struct phm_master_table_item static const struct phm_master_table_item
fiji_thermal_start_thermal_controller_master_list[] = { fiji_thermal_start_thermal_controller_master_list[] = {
{NULL, tf_fiji_thermal_initialize}, {NULL, tf_fiji_thermal_initialize},
{NULL, tf_fiji_thermal_set_temperature_range}, {NULL, tf_fiji_thermal_set_temperature_range},
...@@ -630,14 +630,14 @@ fiji_thermal_start_thermal_controller_master_list[] = { ...@@ -630,14 +630,14 @@ fiji_thermal_start_thermal_controller_master_list[] = {
{NULL, NULL} {NULL, NULL}
}; };
static struct phm_master_table_header static const struct phm_master_table_header
fiji_thermal_start_thermal_controller_master = { fiji_thermal_start_thermal_controller_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
fiji_thermal_start_thermal_controller_master_list fiji_thermal_start_thermal_controller_master_list
}; };
static struct phm_master_table_item static const struct phm_master_table_item
fiji_thermal_set_temperature_range_master_list[] = { fiji_thermal_set_temperature_range_master_list[] = {
{NULL, tf_fiji_thermal_disable_alert}, {NULL, tf_fiji_thermal_disable_alert},
{NULL, tf_fiji_thermal_set_temperature_range}, {NULL, tf_fiji_thermal_set_temperature_range},
...@@ -645,7 +645,7 @@ fiji_thermal_set_temperature_range_master_list[] = { ...@@ -645,7 +645,7 @@ fiji_thermal_set_temperature_range_master_list[] = {
{NULL, NULL} {NULL, NULL}
}; };
struct phm_master_table_header static const struct phm_master_table_header
fiji_thermal_set_temperature_range_master = { fiji_thermal_set_temperature_range_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
......
...@@ -84,7 +84,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr, ...@@ -84,7 +84,7 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
} }
int phm_construct_table(struct pp_hwmgr *hwmgr, int phm_construct_table(struct pp_hwmgr *hwmgr,
struct phm_master_table_header *master_table, const struct phm_master_table_header *master_table,
struct phm_runtime_table_header *rt_table) struct phm_runtime_table_header *rt_table)
{ {
uint32_t function_count = 0; uint32_t function_count = 0;
......
...@@ -525,7 +525,7 @@ static int tf_tonga_thermal_disable_alert(struct pp_hwmgr *hwmgr, void *input, v ...@@ -525,7 +525,7 @@ static int tf_tonga_thermal_disable_alert(struct pp_hwmgr *hwmgr, void *input, v
return tonga_thermal_disable_alert(hwmgr); return tonga_thermal_disable_alert(hwmgr);
} }
static struct phm_master_table_item tonga_thermal_start_thermal_controller_master_list[] = { static const struct phm_master_table_item tonga_thermal_start_thermal_controller_master_list[] = {
{ NULL, tf_tonga_thermal_initialize }, { NULL, tf_tonga_thermal_initialize },
{ NULL, tf_tonga_thermal_set_temperature_range }, { NULL, tf_tonga_thermal_set_temperature_range },
{ NULL, tf_tonga_thermal_enable_alert }, { NULL, tf_tonga_thermal_enable_alert },
...@@ -538,20 +538,20 @@ static struct phm_master_table_item tonga_thermal_start_thermal_controller_maste ...@@ -538,20 +538,20 @@ static struct phm_master_table_item tonga_thermal_start_thermal_controller_maste
{ NULL, NULL } { NULL, NULL }
}; };
static struct phm_master_table_header tonga_thermal_start_thermal_controller_master = { static const struct phm_master_table_header tonga_thermal_start_thermal_controller_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
tonga_thermal_start_thermal_controller_master_list tonga_thermal_start_thermal_controller_master_list
}; };
static struct phm_master_table_item tonga_thermal_set_temperature_range_master_list[] = { static const struct phm_master_table_item tonga_thermal_set_temperature_range_master_list[] = {
{ NULL, tf_tonga_thermal_disable_alert}, { NULL, tf_tonga_thermal_disable_alert},
{ NULL, tf_tonga_thermal_set_temperature_range}, { NULL, tf_tonga_thermal_set_temperature_range},
{ NULL, tf_tonga_thermal_enable_alert}, { NULL, tf_tonga_thermal_enable_alert},
{ NULL, NULL } { NULL, NULL }
}; };
struct phm_master_table_header tonga_thermal_set_temperature_range_master = { static const struct phm_master_table_header tonga_thermal_set_temperature_range_master = {
0, 0,
PHM_MasterTableFlag_None, PHM_MasterTableFlag_None,
tonga_thermal_set_temperature_range_master_list tonga_thermal_set_temperature_range_master_list
......
...@@ -141,7 +141,7 @@ enum phm_master_table_flag { ...@@ -141,7 +141,7 @@ enum phm_master_table_flag {
struct phm_master_table_header { struct phm_master_table_header {
uint32_t storage_size; uint32_t storage_size;
uint32_t flags; uint32_t flags;
struct phm_master_table_item *master_list; const struct phm_master_table_item *master_list;
}; };
struct phm_runtime_table_header { struct phm_runtime_table_header {
...@@ -199,7 +199,7 @@ extern int phm_dispatch_table(struct pp_hwmgr *hwmgr, ...@@ -199,7 +199,7 @@ extern int phm_dispatch_table(struct pp_hwmgr *hwmgr,
void *input, void *output); void *input, void *output);
extern int phm_construct_table(struct pp_hwmgr *hwmgr, extern int phm_construct_table(struct pp_hwmgr *hwmgr,
struct phm_master_table_header *master_table, const struct phm_master_table_header *master_table,
struct phm_runtime_table_header *rt_table); struct phm_runtime_table_header *rt_table);
extern int phm_destroy_table(struct pp_hwmgr *hwmgr, extern int phm_destroy_table(struct pp_hwmgr *hwmgr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment