dm_pp_interface.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright 2016 Advanced Micro Devices, Inc.
  3. *
  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:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  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.
  21. *
  22. */
  23. #ifndef _DM_PP_INTERFACE_
  24. #define _DM_PP_INTERFACE_
  25. #define PP_MAX_CLOCK_LEVELS 16
  26. enum amd_pp_display_config_type{
  27. AMD_PP_DisplayConfigType_None = 0,
  28. AMD_PP_DisplayConfigType_DP54 ,
  29. AMD_PP_DisplayConfigType_DP432 ,
  30. AMD_PP_DisplayConfigType_DP324 ,
  31. AMD_PP_DisplayConfigType_DP27,
  32. AMD_PP_DisplayConfigType_DP243,
  33. AMD_PP_DisplayConfigType_DP216,
  34. AMD_PP_DisplayConfigType_DP162,
  35. AMD_PP_DisplayConfigType_HDMI6G ,
  36. AMD_PP_DisplayConfigType_HDMI297 ,
  37. AMD_PP_DisplayConfigType_HDMI162,
  38. AMD_PP_DisplayConfigType_LVDS,
  39. AMD_PP_DisplayConfigType_DVI,
  40. AMD_PP_DisplayConfigType_WIRELESS,
  41. AMD_PP_DisplayConfigType_VGA
  42. };
  43. struct single_display_configuration
  44. {
  45. uint32_t controller_index;
  46. uint32_t controller_id;
  47. uint32_t signal_type;
  48. uint32_t display_state;
  49. /* phy id for the primary internal transmitter */
  50. uint8_t primary_transmitter_phyi_d;
  51. /* bitmap with the active lanes */
  52. uint8_t primary_transmitter_active_lanemap;
  53. /* phy id for the secondary internal transmitter (for dual-link dvi) */
  54. uint8_t secondary_transmitter_phy_id;
  55. /* bitmap with the active lanes */
  56. uint8_t secondary_transmitter_active_lanemap;
  57. /* misc phy settings for SMU. */
  58. uint32_t config_flags;
  59. uint32_t display_type;
  60. uint32_t view_resolution_cx;
  61. uint32_t view_resolution_cy;
  62. enum amd_pp_display_config_type displayconfigtype;
  63. uint32_t vertical_refresh; /* for active display */
  64. };
  65. #define MAX_NUM_DISPLAY 32
  66. struct amd_pp_display_configuration {
  67. bool nb_pstate_switch_disable;/* controls NB PState switch */
  68. bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */
  69. bool cpu_pstate_disable;
  70. uint32_t cpu_pstate_separation_time;
  71. uint32_t num_display; /* total number of display*/
  72. uint32_t num_path_including_non_display;
  73. uint32_t crossfire_display_index;
  74. uint32_t min_mem_set_clock;
  75. uint32_t min_core_set_clock;
  76. /* unit 10KHz x bit*/
  77. uint32_t min_bus_bandwidth;
  78. /* minimum required stutter sclk, in 10khz uint32_t ulMinCoreSetClk;*/
  79. uint32_t min_core_set_clock_in_sr;
  80. struct single_display_configuration displays[MAX_NUM_DISPLAY];
  81. uint32_t vrefresh; /* for active display*/
  82. uint32_t min_vblank_time; /* for active display*/
  83. bool multi_monitor_in_sync;
  84. /* Controller Index of primary display - used in MCLK SMC switching hang
  85. * SW Workaround*/
  86. uint32_t crtc_index;
  87. /* htotal*1000/pixelclk - used in MCLK SMC switching hang SW Workaround*/
  88. uint32_t line_time_in_us;
  89. bool invalid_vblank_time;
  90. uint32_t display_clk;
  91. /*
  92. * for given display configuration if multimonitormnsync == false then
  93. * Memory clock DPMS with this latency or below is allowed, DPMS with
  94. * higher latency not allowed.
  95. */
  96. uint32_t dce_tolerable_mclk_in_active_latency;
  97. uint32_t min_dcef_set_clk;
  98. uint32_t min_dcef_deep_sleep_set_clk;
  99. };
  100. struct amd_pp_simple_clock_info {
  101. uint32_t engine_max_clock;
  102. uint32_t memory_max_clock;
  103. uint32_t level;
  104. };
  105. enum PP_DAL_POWERLEVEL {
  106. PP_DAL_POWERLEVEL_INVALID = 0,
  107. PP_DAL_POWERLEVEL_ULTRALOW,
  108. PP_DAL_POWERLEVEL_LOW,
  109. PP_DAL_POWERLEVEL_NOMINAL,
  110. PP_DAL_POWERLEVEL_PERFORMANCE,
  111. PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,
  112. PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,
  113. PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,
  114. PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,
  115. PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,
  116. PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,
  117. PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,
  118. PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
  119. };
  120. struct amd_pp_clock_info {
  121. uint32_t min_engine_clock;
  122. uint32_t max_engine_clock;
  123. uint32_t min_memory_clock;
  124. uint32_t max_memory_clock;
  125. uint32_t min_bus_bandwidth;
  126. uint32_t max_bus_bandwidth;
  127. uint32_t max_engine_clock_in_sr;
  128. uint32_t min_engine_clock_in_sr;
  129. enum PP_DAL_POWERLEVEL max_clocks_state;
  130. };
  131. enum amd_pp_clock_type {
  132. amd_pp_disp_clock = 1,
  133. amd_pp_sys_clock,
  134. amd_pp_mem_clock,
  135. amd_pp_dcef_clock,
  136. amd_pp_soc_clock,
  137. amd_pp_pixel_clock,
  138. amd_pp_phy_clock,
  139. amd_pp_dcf_clock,
  140. amd_pp_dpp_clock,
  141. amd_pp_f_clock = amd_pp_dcef_clock,
  142. };
  143. #define MAX_NUM_CLOCKS 16
  144. struct amd_pp_clocks {
  145. uint32_t count;
  146. uint32_t clock[MAX_NUM_CLOCKS];
  147. uint32_t latency[MAX_NUM_CLOCKS];
  148. };
  149. struct pp_clock_with_latency {
  150. uint32_t clocks_in_khz;
  151. uint32_t latency_in_us;
  152. };
  153. struct pp_clock_levels_with_latency {
  154. uint32_t num_levels;
  155. struct pp_clock_with_latency data[PP_MAX_CLOCK_LEVELS];
  156. };
  157. struct pp_clock_with_voltage {
  158. uint32_t clocks_in_khz;
  159. uint32_t voltage_in_mv;
  160. };
  161. struct pp_clock_levels_with_voltage {
  162. uint32_t num_levels;
  163. struct pp_clock_with_voltage data[PP_MAX_CLOCK_LEVELS];
  164. };
  165. struct pp_display_clock_request {
  166. enum amd_pp_clock_type clock_type;
  167. uint32_t clock_freq_in_khz;
  168. };
  169. #define PP_MAX_WM_SETS 4
  170. enum pp_wm_set_id {
  171. DC_WM_SET_A = 0,
  172. DC_WM_SET_B,
  173. DC_WM_SET_C,
  174. DC_WM_SET_D,
  175. DC_WM_SET_INVALID = 0xffff,
  176. };
  177. struct pp_wm_set_with_dmif_clock_range_soc15 {
  178. enum pp_wm_set_id wm_set_id;
  179. uint32_t wm_min_dcefclk_in_khz;
  180. uint32_t wm_max_dcefclk_in_khz;
  181. uint32_t wm_min_memclk_in_khz;
  182. uint32_t wm_max_memclk_in_khz;
  183. };
  184. struct pp_wm_set_with_mcif_clock_range_soc15 {
  185. enum pp_wm_set_id wm_set_id;
  186. uint32_t wm_min_socclk_in_khz;
  187. uint32_t wm_max_socclk_in_khz;
  188. uint32_t wm_min_memclk_in_khz;
  189. uint32_t wm_max_memclk_in_khz;
  190. };
  191. struct pp_wm_sets_with_clock_ranges_soc15 {
  192. uint32_t num_wm_sets_dmif;
  193. uint32_t num_wm_sets_mcif;
  194. struct pp_wm_set_with_dmif_clock_range_soc15
  195. wm_sets_dmif[PP_MAX_WM_SETS];
  196. struct pp_wm_set_with_mcif_clock_range_soc15
  197. wm_sets_mcif[PP_MAX_WM_SETS];
  198. };
  199. #endif /* _DM_PP_INTERFACE_ */