diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2015-11-19 00:35:30 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-12-21 16:42:41 -0500 |
commit | 7fb72a1fc01cc1a8de533abc80b9eaf0120e8529 (patch) | |
tree | 8913782e245b72e5562f5229b70f54d77e15768c | |
parent | aceae1bfd91d73965a165b72f55678e5f6337448 (diff) |
drm/amd/powerplay: export interface to DAL to init/change display configuration.
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | 3 |
5 files changed, 45 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 26d9134f7c0d..a3fc43e52483 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -1639,6 +1639,7 @@ struct amdgpu_pm { | |||
1639 | const struct amdgpu_dpm_funcs *funcs; | 1639 | const struct amdgpu_dpm_funcs *funcs; |
1640 | uint32_t pcie_gen_mask; | 1640 | uint32_t pcie_gen_mask; |
1641 | uint32_t pcie_mlw_mask; | 1641 | uint32_t pcie_mlw_mask; |
1642 | struct amd_pp_display_configuration pm_display_cfg;/* set by DAL */ | ||
1642 | }; | 1643 | }; |
1643 | 1644 | ||
1644 | void amdgpu_get_pcie_info(struct amdgpu_device *adev); | 1645 | void amdgpu_get_pcie_info(struct amdgpu_device *adev); |
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 10385c0fb60d..215757e0ad76 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c | |||
@@ -603,3 +603,19 @@ int amd_powerplay_fini(void *handle) | |||
603 | 603 | ||
604 | return 0; | 604 | return 0; |
605 | } | 605 | } |
606 | |||
607 | /* export this function to DAL */ | ||
608 | |||
609 | int amd_powerplay_display_configuration_change(void *handle, const void *input) | ||
610 | { | ||
611 | struct pp_hwmgr *hwmgr; | ||
612 | const struct amd_pp_display_configuration *display_config = input; | ||
613 | |||
614 | if (handle == NULL) | ||
615 | return -EINVAL; | ||
616 | |||
617 | hwmgr = ((struct pp_instance *)handle)->hwmgr; | ||
618 | |||
619 | phm_store_dal_configuration_data(hwmgr, display_config); | ||
620 | return 0; | ||
621 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c index f2d603cff47d..d6d28497d7d9 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "power_state.h" | 26 | #include "power_state.h" |
27 | #include "pp_acpi.h" | 27 | #include "pp_acpi.h" |
28 | #include "amd_acpi.h" | 28 | #include "amd_acpi.h" |
29 | #include "amd_powerplay.h" | ||
29 | 30 | ||
30 | void phm_init_dynamic_caps(struct pp_hwmgr *hwmgr) | 31 | void phm_init_dynamic_caps(struct pp_hwmgr *hwmgr) |
31 | { | 32 | { |
@@ -244,3 +245,18 @@ int phm_check_states_equal(struct pp_hwmgr *hwmgr, | |||
244 | 245 | ||
245 | return hwmgr->hwmgr_func->check_states_equal(hwmgr, pstate1, pstate2, equal); | 246 | return hwmgr->hwmgr_func->check_states_equal(hwmgr, pstate1, pstate2, equal); |
246 | } | 247 | } |
248 | |||
249 | int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, | ||
250 | const struct amd_pp_display_configuration *display_config) | ||
251 | { | ||
252 | if (hwmgr == NULL || hwmgr->hwmgr_func->store_cc6_data == NULL) | ||
253 | return -EINVAL; | ||
254 | |||
255 | /* to do pass other display configuration in furture */ | ||
256 | return hwmgr->hwmgr_func->store_cc6_data(hwmgr, | ||
257 | display_config->cpu_pstate_separation_time, | ||
258 | display_config->cpu_cc6_disable, | ||
259 | display_config->cpu_pstate_disable, | ||
260 | display_config->nb_pstate_switch_disable); | ||
261 | |||
262 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h index 40ded6795ba4..efa23c182bd0 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | |||
@@ -131,6 +131,13 @@ struct amd_pp_init { | |||
131 | uint32_t rev_id; | 131 | uint32_t rev_id; |
132 | }; | 132 | }; |
133 | 133 | ||
134 | struct amd_pp_display_configuration { | ||
135 | bool nb_pstate_switch_disable;/* controls NB PState switch */ | ||
136 | bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */ | ||
137 | bool cpu_pstate_disable; | ||
138 | uint32_t cpu_pstate_separation_time; | ||
139 | }; | ||
140 | |||
134 | enum { | 141 | enum { |
135 | PP_GROUP_UNKNOWN = 0, | 142 | PP_GROUP_UNKNOWN = 0, |
136 | PP_GROUP_GFX = 1, | 143 | PP_GROUP_GFX = 1, |
@@ -203,4 +210,6 @@ int amd_powerplay_init(struct amd_pp_init *pp_init, | |||
203 | struct amd_powerplay *amd_pp); | 210 | struct amd_powerplay *amd_pp); |
204 | int amd_powerplay_fini(void *handle); | 211 | int amd_powerplay_fini(void *handle); |
205 | 212 | ||
213 | int amd_powerplay_display_configuration_change(void *handle, const void *input); | ||
214 | |||
206 | #endif /* _AMD_POWERPLAY_H_ */ | 215 | #endif /* _AMD_POWERPLAY_H_ */ |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h index a3f7bd27a2fb..7b721e8ea531 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | |||
@@ -353,5 +353,8 @@ extern int phm_check_states_equal(struct pp_hwmgr *hwmgr, | |||
353 | const struct pp_hw_power_state *pstate2, | 353 | const struct pp_hw_power_state *pstate2, |
354 | bool *equal); | 354 | bool *equal); |
355 | 355 | ||
356 | extern int phm_store_dal_configuration_data(struct pp_hwmgr *hwmgr, | ||
357 | const struct amd_pp_display_configuration *display_config); | ||
358 | |||
356 | #endif /* _HARDWARE_MANAGER_H_ */ | 359 | #endif /* _HARDWARE_MANAGER_H_ */ |
357 | 360 | ||