drm/amd/powerplay: export interface to DAL to init/change display configuration.
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 19 Nov 2015 05:35:30 +0000 (13:35 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Dec 2015 21:42:41 +0000 (16:42 -0500)
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/powerplay/amd_powerplay.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

index 26d9134f7c0d2234fcecebba34fb57931666a843..a3fc43e52483ef300eff1393579633b85cf8a40c 100644 (file)
@@ -1639,6 +1639,7 @@ struct amdgpu_pm {
        const struct amdgpu_dpm_funcs *funcs;
        uint32_t                pcie_gen_mask;
        uint32_t                pcie_mlw_mask;
+       struct amd_pp_display_configuration pm_display_cfg;/* set by DAL */
 };
 
 void amdgpu_get_pcie_info(struct amdgpu_device *adev);
index 10385c0fb60d3b81b20adeacfe609c0dbd3d5b97..215757e0ad763a8ea39752f14b2f86815fd55f92 100644 (file)
@@ -603,3 +603,19 @@ int amd_powerplay_fini(void *handle)
 
        return 0;
 }
+
+/* export this function to DAL */
+
+int amd_powerplay_display_configuration_change(void *handle, const void *input)
+{
+       struct pp_hwmgr  *hwmgr;
+       const struct amd_pp_display_configuration *display_config = input;
+
+       if (handle == NULL)
+               return -EINVAL;
+
+       hwmgr = ((struct pp_instance *)handle)->hwmgr;
+
+       phm_store_dal_configuration_data(hwmgr, display_config);
+       return 0;
+}
index f2d603cff47d8c7c1035f30b83191413da2dae6d..d6d28497d7d9d0ac2eee577191d44cb47249ffee 100644 (file)
@@ -26,6 +26,7 @@
 #include "power_state.h"
 #include "pp_acpi.h"
 #include "amd_acpi.h"
+#include "amd_powerplay.h"
 
 void phm_init_dynamic_caps(struct pp_hwmgr *hwmgr)
 {
@@ -244,3 +245,18 @@ int phm_check_states_equal(struct pp_hwmgr *hwmgr,
 
        return hwmgr->hwmgr_func->check_states_equal(hwmgr, pstate1, pstate2, equal);
 }
+
+int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
+                   const struct amd_pp_display_configuration *display_config)
+{
+       if (hwmgr == NULL || hwmgr->hwmgr_func->store_cc6_data == NULL)
+               return -EINVAL;
+
+       /* to do pass other display configuration in furture */
+       return hwmgr->hwmgr_func->store_cc6_data(hwmgr,
+                                       display_config->cpu_pstate_separation_time,
+                                       display_config->cpu_cc6_disable,
+                                       display_config->cpu_pstate_disable,
+                                       display_config->nb_pstate_switch_disable);
+
+}
index 40ded6795ba4a373915620adf65cfd2b7c5a8ac4..efa23c182bd0b3ac66cb64d1a2d7fcaacfadb2e1 100644 (file)
@@ -131,6 +131,13 @@ struct amd_pp_init {
        uint32_t rev_id;
 };
 
+struct amd_pp_display_configuration {
+       bool nb_pstate_switch_disable;/* controls NB PState switch */
+       bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */
+       bool cpu_pstate_disable;
+       uint32_t cpu_pstate_separation_time;
+};
+
 enum {
        PP_GROUP_UNKNOWN = 0,
        PP_GROUP_GFX = 1,
@@ -203,4 +210,6 @@ int amd_powerplay_init(struct amd_pp_init *pp_init,
                       struct amd_powerplay *amd_pp);
 int amd_powerplay_fini(void *handle);
 
+int amd_powerplay_display_configuration_change(void *handle, const void *input);
+
 #endif /* _AMD_POWERPLAY_H_ */
index a3f7bd27a2fb61631400397eea56a9cb75b01bc0..7b721e8ea5314028b3e221d856fdf5812f8fe3aa 100644 (file)
@@ -353,5 +353,8 @@ extern int phm_check_states_equal(struct pp_hwmgr *hwmgr,
                                 const struct pp_hw_power_state *pstate2,
                                 bool *equal);
 
+extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr,
+                   const struct amd_pp_display_configuration *display_config);
+
 #endif /* _HARDWARE_MANAGER_H_ */