2 * Copyright 2012-15 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DM_SERVICES_TYPES_H__
27 #define __DM_SERVICES_TYPES_H__
32 struct pp_smu_funcs_rv;
34 struct dm_pp_clock_range {
39 enum dm_pp_clocks_state {
40 DM_PP_CLOCKS_STATE_INVALID,
41 DM_PP_CLOCKS_STATE_ULTRA_LOW,
42 DM_PP_CLOCKS_STATE_LOW,
43 DM_PP_CLOCKS_STATE_NOMINAL,
44 DM_PP_CLOCKS_STATE_PERFORMANCE,
46 /* Starting from DCE11, Max 8 levels of DPM state supported. */
47 DM_PP_CLOCKS_DPM_STATE_LEVEL_INVALID = DM_PP_CLOCKS_STATE_INVALID,
48 DM_PP_CLOCKS_DPM_STATE_LEVEL_0,
49 DM_PP_CLOCKS_DPM_STATE_LEVEL_1,
50 DM_PP_CLOCKS_DPM_STATE_LEVEL_2,
51 /* to be backward compatible */
52 DM_PP_CLOCKS_DPM_STATE_LEVEL_3,
53 DM_PP_CLOCKS_DPM_STATE_LEVEL_4,
54 DM_PP_CLOCKS_DPM_STATE_LEVEL_5,
55 DM_PP_CLOCKS_DPM_STATE_LEVEL_6,
56 DM_PP_CLOCKS_DPM_STATE_LEVEL_7,
58 DM_PP_CLOCKS_MAX_STATES
61 struct dm_pp_gpu_clock_range {
62 enum dm_pp_clocks_state clock_state;
63 struct dm_pp_clock_range sclk;
64 struct dm_pp_clock_range mclk;
65 struct dm_pp_clock_range eclk;
66 struct dm_pp_clock_range dclk;
69 enum dm_pp_clock_type {
70 DM_PP_CLOCK_TYPE_DISPLAY_CLK = 1,
71 DM_PP_CLOCK_TYPE_ENGINE_CLK, /* System clock */
72 DM_PP_CLOCK_TYPE_MEMORY_CLK,
73 DM_PP_CLOCK_TYPE_DCFCLK,
74 DM_PP_CLOCK_TYPE_DCEFCLK,
75 DM_PP_CLOCK_TYPE_SOCCLK,
76 DM_PP_CLOCK_TYPE_PIXELCLK,
77 DM_PP_CLOCK_TYPE_DISPLAYPHYCLK,
78 DM_PP_CLOCK_TYPE_DPPCLK,
79 DM_PP_CLOCK_TYPE_FCLK,
82 #define DC_DECODE_PP_CLOCK_TYPE(clk_type) \
83 (clk_type) == DM_PP_CLOCK_TYPE_DISPLAY_CLK ? "Display" : \
84 (clk_type) == DM_PP_CLOCK_TYPE_ENGINE_CLK ? "Engine" : \
85 (clk_type) == DM_PP_CLOCK_TYPE_MEMORY_CLK ? "Memory" : "Invalid"
87 #define DM_PP_MAX_CLOCK_LEVELS 8
89 struct dm_pp_clock_levels {
91 uint32_t clocks_in_khz[DM_PP_MAX_CLOCK_LEVELS];
94 struct dm_pp_clock_with_latency {
95 uint32_t clocks_in_khz;
96 uint32_t latency_in_us;
99 struct dm_pp_clock_levels_with_latency {
101 struct dm_pp_clock_with_latency data[DM_PP_MAX_CLOCK_LEVELS];
104 struct dm_pp_clock_with_voltage {
105 uint32_t clocks_in_khz;
106 uint32_t voltage_in_mv;
109 struct dm_pp_clock_levels_with_voltage {
111 struct dm_pp_clock_with_voltage data[DM_PP_MAX_CLOCK_LEVELS];
114 struct dm_pp_single_disp_config {
115 enum signal_type signal;
117 uint8_t ddi_channel_mapping;
122 uint32_t sym_clock; /* HDMI only */
123 struct dc_link_settings link_settings; /* DP only */
126 #define MAX_WM_SETS 4
128 enum dm_pp_wm_set_id {
133 WM_SET_INVALID = 0xffff,
136 struct dm_pp_clock_range_for_wm_set {
137 enum dm_pp_wm_set_id wm_set_id;
138 uint32_t wm_min_eng_clk_in_khz;
139 uint32_t wm_max_eng_clk_in_khz;
140 uint32_t wm_min_mem_clk_in_khz;
141 uint32_t wm_max_mem_clk_in_khz;
144 struct dm_pp_wm_sets_with_clock_ranges {
145 uint32_t num_wm_sets;
146 struct dm_pp_clock_range_for_wm_set wm_clk_ranges[MAX_WM_SETS];
149 struct dm_pp_clock_range_for_dmif_wm_set_soc15 {
150 enum dm_pp_wm_set_id wm_set_id;
151 uint32_t wm_min_dcfclk_clk_in_khz;
152 uint32_t wm_max_dcfclk_clk_in_khz;
153 uint32_t wm_min_mem_clk_in_khz;
154 uint32_t wm_max_mem_clk_in_khz;
157 struct dm_pp_clock_range_for_mcif_wm_set_soc15 {
158 enum dm_pp_wm_set_id wm_set_id;
159 uint32_t wm_min_socclk_clk_in_khz;
160 uint32_t wm_max_socclk_clk_in_khz;
161 uint32_t wm_min_mem_clk_in_khz;
162 uint32_t wm_max_mem_clk_in_khz;
165 struct dm_pp_wm_sets_with_clock_ranges_soc15 {
166 uint32_t num_wm_dmif_sets;
167 uint32_t num_wm_mcif_sets;
168 struct dm_pp_clock_range_for_dmif_wm_set_soc15
169 wm_dmif_clocks_ranges[MAX_WM_SETS];
170 struct dm_pp_clock_range_for_mcif_wm_set_soc15
171 wm_mcif_clocks_ranges[MAX_WM_SETS];
174 #define MAX_DISPLAY_CONFIGS 6
176 struct dm_pp_display_configuration {
177 bool nb_pstate_switch_disable;/* controls NB PState switch */
178 bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */
179 bool cpu_pstate_disable;
180 uint32_t cpu_pstate_separation_time;
182 uint32_t min_memory_clock_khz;
183 uint32_t min_engine_clock_khz;
184 uint32_t min_engine_clock_deep_sleep_khz;
186 uint32_t avail_mclk_switch_time_us;
187 uint32_t avail_mclk_switch_time_in_disp_active_us;
188 uint32_t min_dcfclock_khz;
189 uint32_t min_dcfc_deep_sleep_clock_khz;
191 uint32_t disp_clk_khz;
193 bool all_displays_in_sync;
195 uint8_t display_count;
196 struct dm_pp_single_disp_config disp_configs[MAX_DISPLAY_CONFIGS];
198 /*Controller Index of primary display - used in MCLK SMC switching hang
201 /*htotal*1000/pixelclk - used in MCLK SMC switching hang SW Workaround*/
202 uint32_t line_time_in_us;
205 struct dm_bl_data_point {
206 /* Brightness level in percentage */
208 /* Brightness level as effective value in range 0-255,
209 * corresponding to above percentage
214 /* Total size of the structure should not exceed 256 bytes */
215 struct dm_acpi_atif_backlight_caps {
218 uint16_t size; /* Bytes 0-1 (2 bytes) */
219 uint16_t flags; /* Byted 2-3 (2 bytes) */
220 uint8_t errorCode; /* Byte 4 */
221 uint8_t acLevelPercentage; /* Byte 5 */
222 uint8_t dcLevelPercentage; /* Byte 6 */
223 uint8_t minInputSignal; /* Byte 7 */
224 uint8_t maxInputSignal; /* Byte 8 */
225 uint8_t numOfDataPoints; /* Byte 9 */
226 struct dm_bl_data_point dataPoints[99]; /* Bytes 10-207 (198 bytes)*/
229 enum dm_acpi_display_type {
230 AcpiDisplayType_LCD1 = 0,
231 AcpiDisplayType_CRT1 = 1,
232 AcpiDisplayType_DFP1 = 3,
233 AcpiDisplayType_CRT2 = 4,
234 AcpiDisplayType_LCD2 = 5,
235 AcpiDisplayType_DFP2 = 7,
236 AcpiDisplayType_DFP3 = 9,
237 AcpiDisplayType_DFP4 = 10,
238 AcpiDisplayType_DFP5 = 11,
239 AcpiDisplayType_DFP6 = 12
242 struct dm_pp_power_level_change_request {
243 enum dm_pp_clocks_state power_level;
246 struct dm_pp_clock_for_voltage_req {
247 enum dm_pp_clock_type clk_type;
248 uint32_t clocks_in_khz;
251 struct dm_pp_static_clock_info {
252 uint32_t max_sclk_khz;
253 uint32_t max_mclk_khz;
255 /* max possible display block clocks state */
256 enum dm_pp_clocks_state max_clocks_state;
259 struct dtn_min_clk_info {
260 uint32_t disp_clk_khz;
261 uint32_t min_engine_clock_khz;
262 uint32_t min_memory_clock_khz;