dm_pp_interface.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. #include "dm_services_types.h"
  26. #define PP_MAX_CLOCK_LEVELS 16
  27. enum amd_pp_display_config_type{
  28. AMD_PP_DisplayConfigType_None = 0,
  29. AMD_PP_DisplayConfigType_DP54 ,
  30. AMD_PP_DisplayConfigType_DP432 ,
  31. AMD_PP_DisplayConfigType_DP324 ,
  32. AMD_PP_DisplayConfigType_DP27,
  33. AMD_PP_DisplayConfigType_DP243,
  34. AMD_PP_DisplayConfigType_DP216,
  35. AMD_PP_DisplayConfigType_DP162,
  36. AMD_PP_DisplayConfigType_HDMI6G ,
  37. AMD_PP_DisplayConfigType_HDMI297 ,
  38. AMD_PP_DisplayConfigType_HDMI162,
  39. AMD_PP_DisplayConfigType_LVDS,
  40. AMD_PP_DisplayConfigType_DVI,
  41. AMD_PP_DisplayConfigType_WIRELESS,
  42. AMD_PP_DisplayConfigType_VGA
  43. };
  44. struct single_display_configuration
  45. {
  46. uint32_t controller_index;
  47. uint32_t controller_id;
  48. uint32_t signal_type;
  49. uint32_t display_state;
  50. /* phy id for the primary internal transmitter */
  51. uint8_t primary_transmitter_phyi_d;
  52. /* bitmap with the active lanes */
  53. uint8_t primary_transmitter_active_lanemap;
  54. /* phy id for the secondary internal transmitter (for dual-link dvi) */
  55. uint8_t secondary_transmitter_phy_id;
  56. /* bitmap with the active lanes */
  57. uint8_t secondary_transmitter_active_lanemap;
  58. /* misc phy settings for SMU. */
  59. uint32_t config_flags;
  60. uint32_t display_type;
  61. uint32_t view_resolution_cx;
  62. uint32_t view_resolution_cy;
  63. enum amd_pp_display_config_type displayconfigtype;
  64. uint32_t vertical_refresh; /* for active display */
  65. };
  66. #define MAX_NUM_DISPLAY 32
  67. struct amd_pp_display_configuration {
  68. bool nb_pstate_switch_disable;/* controls NB PState switch */
  69. bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */
  70. bool cpu_pstate_disable;
  71. uint32_t cpu_pstate_separation_time;
  72. uint32_t num_display; /* total number of display*/
  73. uint32_t num_path_including_non_display;
  74. uint32_t crossfire_display_index;
  75. uint32_t min_mem_set_clock;
  76. uint32_t min_core_set_clock;
  77. /* unit 10KHz x bit*/
  78. uint32_t min_bus_bandwidth;
  79. /* minimum required stutter sclk, in 10khz uint32_t ulMinCoreSetClk;*/
  80. uint32_t min_core_set_clock_in_sr;
  81. struct single_display_configuration displays[MAX_NUM_DISPLAY];
  82. uint32_t vrefresh; /* for active display*/
  83. uint32_t min_vblank_time; /* for active display*/
  84. bool multi_monitor_in_sync;
  85. /* Controller Index of primary display - used in MCLK SMC switching hang
  86. * SW Workaround*/
  87. uint32_t crtc_index;
  88. /* htotal*1000/pixelclk - used in MCLK SMC switching hang SW Workaround*/
  89. uint32_t line_time_in_us;
  90. bool invalid_vblank_time;
  91. uint32_t display_clk;
  92. /*
  93. * for given display configuration if multimonitormnsync == false then
  94. * Memory clock DPMS with this latency or below is allowed, DPMS with
  95. * higher latency not allowed.
  96. */
  97. uint32_t dce_tolerable_mclk_in_active_latency;
  98. uint32_t min_dcef_set_clk;
  99. uint32_t min_dcef_deep_sleep_set_clk;
  100. };
  101. struct amd_pp_simple_clock_info {
  102. uint32_t engine_max_clock;
  103. uint32_t memory_max_clock;
  104. uint32_t level;
  105. };
  106. enum PP_DAL_POWERLEVEL {
  107. PP_DAL_POWERLEVEL_INVALID = 0,
  108. PP_DAL_POWERLEVEL_ULTRALOW,
  109. PP_DAL_POWERLEVEL_LOW,
  110. PP_DAL_POWERLEVEL_NOMINAL,
  111. PP_DAL_POWERLEVEL_PERFORMANCE,
  112. PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,
  113. PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,
  114. PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,
  115. PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,
  116. PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,
  117. PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,
  118. PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,
  119. PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,
  120. };
  121. struct amd_pp_clock_info {
  122. uint32_t min_engine_clock;
  123. uint32_t max_engine_clock;
  124. uint32_t min_memory_clock;
  125. uint32_t max_memory_clock;
  126. uint32_t min_bus_bandwidth;
  127. uint32_t max_bus_bandwidth;
  128. uint32_t max_engine_clock_in_sr;
  129. uint32_t min_engine_clock_in_sr;
  130. enum PP_DAL_POWERLEVEL max_clocks_state;
  131. };
  132. enum amd_pp_clock_type {
  133. amd_pp_disp_clock = 1,
  134. amd_pp_sys_clock,
  135. amd_pp_mem_clock,
  136. amd_pp_dcef_clock,
  137. amd_pp_soc_clock,
  138. amd_pp_pixel_clock,
  139. amd_pp_phy_clock,
  140. amd_pp_dcf_clock,
  141. amd_pp_dpp_clock,
  142. amd_pp_f_clock = amd_pp_dcef_clock,
  143. };
  144. #define MAX_NUM_CLOCKS 16
  145. struct amd_pp_clocks {
  146. uint32_t count;
  147. uint32_t clock[MAX_NUM_CLOCKS];
  148. uint32_t latency[MAX_NUM_CLOCKS];
  149. };
  150. struct pp_clock_with_latency {
  151. uint32_t clocks_in_khz;
  152. uint32_t latency_in_us;
  153. };
  154. struct pp_clock_levels_with_latency {
  155. uint32_t num_levels;
  156. struct pp_clock_with_latency data[PP_MAX_CLOCK_LEVELS];
  157. };
  158. struct pp_clock_with_voltage {
  159. uint32_t clocks_in_khz;
  160. uint32_t voltage_in_mv;
  161. };
  162. struct pp_clock_levels_with_voltage {
  163. uint32_t num_levels;
  164. struct pp_clock_with_voltage data[PP_MAX_CLOCK_LEVELS];
  165. };
  166. struct pp_display_clock_request {
  167. enum amd_pp_clock_type clock_type;
  168. uint32_t clock_freq_in_khz;
  169. };
  170. #endif /* _DM_PP_INTERFACE_ */