]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/amd/powerplay: mark phm_master_table_* structs as const
authorNils Wallménius <nils.wallmenius@gmail.com>
Sun, 10 Apr 2016 14:30:03 +0000 (16:30 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 5 May 2016 00:20:17 +0000 (20:20 -0400)
Also adjust phm_construct_table to take a const pointer

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c
drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_thermal.c
drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_thermal.c
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h

index ff08ce41bde92f82596894ee178a545916d288df..436fc16dabb660e0970068ecc4eb0be3c2ed44f6 100644 (file)
@@ -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*/
        { phm_cf_want_uvd_power_gating, cz_tf_uvd_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[] = {
        { 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,
        PHM_MasterTableFlag_None,
        cz_enable_clock_power_gatings_list
index bbbc0571320eed5b908c3e5d2509ff87f57790f3..35e1b36a548894ade3fafd7406486038c50c115d 100644 (file)
@@ -28,7 +28,7 @@
 #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 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 int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate);
 extern int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate);
index 5682490337e3dda03f8e7b2d10774b2e67ea3bdc..648394fff69a4cb212bc9d700e55c86cc5a8a360 100644 (file)
@@ -915,7 +915,7 @@ static int cz_tf_update_low_mem_pstate(struct pp_hwmgr *hwmgr,
        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_set_deep_sleep_sclk_threshold},
        {NULL, cz_tf_set_watermark_threshold},
@@ -925,13 +925,13 @@ static struct phm_master_table_item cz_set_power_state_list[] = {
        {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,
        PHM_MasterTableFlag_None,
        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_upload_pptable_to_smu},
        {NULL, cz_tf_init_sclk_limit},
@@ -943,7 +943,7 @@ static struct phm_master_table_item cz_setup_asic_list[] = {
        {NULL, NULL}
 };
 
-static struct phm_master_table_header cz_setup_asic_master = {
+static const struct phm_master_table_header cz_setup_asic_master = {
        0,
        PHM_MasterTableFlag_None,
        cz_setup_asic_list
@@ -984,14 +984,14 @@ static int cz_tf_reset_cc6_data(struct pp_hwmgr *hwmgr,
        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_clear_nb_dpm_flag},
        {NULL, cz_tf_reset_cc6_data},
        {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,
        PHM_MasterTableFlag_None,
        cz_power_down_asic_list
@@ -1095,19 +1095,19 @@ static int cz_tf_check_for_dpm_enabled(struct pp_hwmgr *hwmgr,
        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, NULL},
 };
 
 
-static struct phm_master_table_header cz_disable_dpm_master = {
+static const struct phm_master_table_header cz_disable_dpm_master = {
        0,
        PHM_MasterTableFlag_None,
        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_program_voting_clients },
        { NULL, cz_tf_start_dpm},
@@ -1117,7 +1117,7 @@ static struct phm_master_table_item cz_enable_dpm_list[] = {
        {NULL, NULL},
 };
 
-static struct phm_master_table_header cz_enable_dpm_master = {
+static const struct phm_master_table_header cz_enable_dpm_master = {
        0,
        PHM_MasterTableFlag_None,
        cz_enable_dpm_list
index e76a7de9aa327b681db48f4fc8793feb62c254d3..e2b448f4933428d483ecb279218bc953bc2c97c4 100644 (file)
@@ -615,7 +615,7 @@ static int tf_fiji_thermal_disable_alert(struct pp_hwmgr *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[] = {
        {NULL, tf_fiji_thermal_initialize},
        {NULL, tf_fiji_thermal_set_temperature_range},
@@ -630,14 +630,14 @@ fiji_thermal_start_thermal_controller_master_list[] = {
        {NULL, NULL}
 };
 
-static struct phm_master_table_header
+static const struct phm_master_table_header
 fiji_thermal_start_thermal_controller_master = {
        0,
        PHM_MasterTableFlag_None,
        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[] = {
        {NULL, tf_fiji_thermal_disable_alert},
        {NULL, tf_fiji_thermal_set_temperature_range},
@@ -645,7 +645,7 @@ fiji_thermal_set_temperature_range_master_list[] = {
        {NULL, NULL}
 };
 
-struct phm_master_table_header
+static const struct phm_master_table_header
 fiji_thermal_set_temperature_range_master = {
        0,
        PHM_MasterTableFlag_None,
index 72cfecc4f9f729426e602ce6a09db56f10eb8527..7a705cee0cc23624b7bc131601460cd317e817c6 100644 (file)
@@ -84,7 +84,7 @@ int phm_dispatch_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)
 {
        uint32_t function_count = 0;
index a188174747c9f1465a04a9a5c62af5dfa135b348..23f8463d2f53cf5116b2ffc4e8e0f4f026993de3 100644 (file)
@@ -525,7 +525,7 @@ static int tf_tonga_thermal_disable_alert(struct pp_hwmgr *hwmgr, void *input, v
        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_set_temperature_range },
        { NULL, tf_tonga_thermal_enable_alert },
@@ -538,20 +538,20 @@ static struct phm_master_table_item tonga_thermal_start_thermal_controller_maste
        { 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,
        PHM_MasterTableFlag_None,
        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_set_temperature_range},
        { NULL, tf_tonga_thermal_enable_alert},
        { 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,
        PHM_MasterTableFlag_None,
        tonga_thermal_set_temperature_range_master_list
index 928f5a740cba77b92ab28ff1e0428d4dea6fb6f5..e1ca36c7945686dbecafb0c2f0887c0ca7e1d88c 100644 (file)
@@ -141,7 +141,7 @@ enum phm_master_table_flag {
 struct phm_master_table_header {
        uint32_t storage_size;
        uint32_t flags;
-       struct phm_master_table_item *master_list;
+       const struct phm_master_table_item *master_list;
 };
 
 struct phm_runtime_table_header {
@@ -199,7 +199,7 @@ extern int phm_dispatch_table(struct pp_hwmgr *hwmgr,
                              void *input, void *output);
 
 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);
 
 extern int phm_destroy_table(struct pp_hwmgr *hwmgr,