drm/amd/powerplay: add and export hwmgr interface to eventmgr to check hw states.
authorRex Zhu <Rex.Zhu@amd.com>
Wed, 4 Nov 2015 03:07:34 +0000 (11:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Dec 2015 21:42:28 +0000 (16:42 -0500)
Interface between hwmgr and eventmgr.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c
drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h

index 9d910f3284d0de241659e3665121478f4bbc78a1..f2d603cff47d8c7c1035f30b83191413da2dae6d 100644 (file)
@@ -223,3 +223,24 @@ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRa
 
        return phm_dispatch_table(hwmgr, &(hwmgr->start_thermal_controller), temperature_range, NULL);
 }
+
+
+bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)
+{
+       if (hwmgr == NULL || hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration == NULL)
+               return -EINVAL;
+
+       return hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration(hwmgr);
+}
+
+
+int phm_check_states_equal(struct pp_hwmgr *hwmgr,
+                                const struct pp_hw_power_state *pstate1,
+                                const struct pp_hw_power_state *pstate2,
+                                bool *equal)
+{
+       if (hwmgr == NULL || hwmgr->hwmgr_func->check_states_equal == NULL)
+               return -EINVAL;
+
+       return hwmgr->hwmgr_func->check_states_equal(hwmgr, pstate1, pstate2, equal);
+}
index a868110d477c90833238360af7e2abdf719269ac..a3f7bd27a2fb61631400397eea56a9cb75b01bc0 100644 (file)
@@ -322,6 +322,7 @@ struct phm_clocks {
        uint32_t num_of_entries;
        uint32_t clock[MAX_NUM_CLOCKS];
 };
+
 extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr);
 extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate);
 extern int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate);
@@ -345,5 +346,12 @@ extern int phm_notify_smc_display_config_after_ps_adjustment(struct pp_hwmgr *hw
 extern int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info);
 extern int phm_start_thermal_controller(struct pp_hwmgr *hwmgr, struct PP_TemperatureRange *temperature_range);
 extern int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr);
+extern bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr);
+
+extern int phm_check_states_equal(struct pp_hwmgr *hwmgr,
+                                const struct pp_hw_power_state *pstate1,
+                                const struct pp_hw_power_state *pstate2,
+                                bool *equal);
+
 #endif /* _HARDWARE_MANAGER_H_ */
 
index aedb1e4991008f2ccf457d346384c162bfd12d87..5b5c94dc3510a1a0f373404f7bab57a10dfd87a2 100644 (file)
@@ -307,6 +307,11 @@ struct pp_hwmgr_func {
        int (*uninitialize_thermal_controller)(struct pp_hwmgr *hwmgr);
        int (*register_internal_thermal_interrupt)(struct pp_hwmgr *hwmgr,
                                        const void *thermal_interrupt_info);
+       bool (*check_smc_update_required_for_display_configuration)(struct pp_hwmgr *hwmgr);
+       int (*check_states_equal)(struct pp_hwmgr *hwmgr,
+                                       const struct pp_hw_power_state *pstate1,
+                                       const struct pp_hw_power_state *pstate2,
+                                       bool *equal);
 };
 
 struct pp_table_func {