amd/powerplay: Fix get dal power level
authorVitaly Prosyak <vitaly.prosyak@amd.com>
Thu, 3 Dec 2015 15:27:57 +0000 (10:27 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Dec 2015 21:42:53 +0000 (16:42 -0500)
Simplify data struct for get dal power level

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h

index 0b9876daa8dcba6a8ece0b6bc2a0df6a3966078b..db0370bd60e358d07f4cf1b486faea890cc6e066 100644 (file)
@@ -620,7 +620,8 @@ int amd_powerplay_display_configuration_change(void *handle, const void *input)
        return 0;
 }
 
-int amd_powerplay_get_display_power_level(void *handle,  void *output)
+int amd_powerplay_get_display_power_level(void *handle,
+               struct amd_pp_dal_clock_info *output)
 {
        struct pp_hwmgr  *hwmgr;
 
@@ -629,6 +630,5 @@ int amd_powerplay_get_display_power_level(void *handle,  void *output)
 
        hwmgr = ((struct pp_instance *)handle)->hwmgr;
 
-       return phm_get_dal_power_level(hwmgr,
-                       (struct pp_dal_clock_info *)output);
+       return phm_get_dal_power_level(hwmgr, output);
 }
index a745acf9c1816a19938af1165cd5217eabd8fe5a..bd30b56b170679d3b9115e218227e9635a355924 100644 (file)
@@ -1597,7 +1597,7 @@ static void cz_hw_print_display_cfg(
 }
 
  static int cz_get_dal_power_level(struct pp_hwmgr *hwmgr,
-               struct pp_dal_clock_info*info)
+               struct amd_pp_dal_clock_info*info)
 {
        uint32_t i;
        const struct phm_clock_voltage_dependency_table * table =
index d24a41964fbe507f646b35d83962481452de9bea..881feb87fc8bae2148ab14451005f0a15a6945c4 100644 (file)
@@ -262,12 +262,13 @@ int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
 }
 
 int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-               struct pp_dal_clock_info*info)
+               struct amd_pp_dal_clock_info*info)
 {
-       if (hwmgr == NULL || hwmgr->hwmgr_func->get_dal_power_level == NULL)
+       if (info == NULL || hwmgr == NULL ||
+                       hwmgr->hwmgr_func->get_dal_power_level == NULL)
                return -EINVAL;
 
-       return hwmgr->hwmgr_func->get_dal_power_level(hwmgr,info);
+       return hwmgr->hwmgr_func->get_dal_power_level(hwmgr, info);
 }
 
 int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr)
index 2ec8c22d43480d5cfe7a0286faa3e63e52dbc588..3d0058c401bdba91e23dfcbe926aa48274316e4d 100644 (file)
@@ -218,7 +218,8 @@ int amd_powerplay_fini(void *handle);
 
 int amd_powerplay_display_configuration_change(void *handle, const void *input);
 
-int amd_powerplay_get_display_power_level(void *handle,  void *output);
+int amd_powerplay_get_display_power_level(void *handle,
+               struct amd_pp_dal_clock_info *output);
 
 
 #endif /* _AMD_POWERPLAY_H_ */
index a3b93cd3f739cd7107e805c3f284a2dea96323bf..a503306c3d0e183c0d04b70e1344e8cb3d824694 100644 (file)
@@ -340,11 +340,6 @@ enum PP_DAL_POWERLEVEL {
        PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
 };
 
-struct pp_dal_clock_info {
-       uint32_t                engine_max_clock;/*dal validation clock on AC*/
-       uint32_t                memory_max_clock;/*dal validation clock on AC*/
-       enum PP_DAL_POWERLEVEL  level;  /*number of levels for the given clocks*/
-};
 
 extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr);
 extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate);
@@ -380,7 +375,7 @@ extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
                const struct amd_pp_display_configuration *display_config);
 
 extern int phm_get_dal_power_level(struct pp_hwmgr *hwmgr,
-               struct pp_dal_clock_info*info);
+               struct amd_pp_dal_clock_info*info);
 
 extern int phm_set_cpu_power_state(struct pp_hwmgr *hwmgr);
 
index c9fcc0c32f94aad71c542be16fba7fcc3b0c021a..0c5896999c6f5788e50c0e3ec5c5f8cf20a026c6 100644 (file)
@@ -325,7 +325,7 @@ struct pp_hwmgr_func {
                                bool cc6_disable, bool pstate_disable,
                                bool pstate_switch_disable);
        int (*get_dal_power_level)(struct pp_hwmgr *hwmgr,
-                       struct pp_dal_clock_info*info);
+                       struct amd_pp_dal_clock_info*info);
 };
 
 struct pp_table_func {