dpcd_defs.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. * Copyright 2012-15 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. * Authors: AMD
  23. *
  24. */
  25. #ifndef __DAL_DPCD_DEFS_H__
  26. #define __DAL_DPCD_DEFS_H__
  27. #include <drm/display/drm_dp_helper.h>
  28. #ifndef DP_SINK_HW_REVISION_START // can remove this once the define gets into linux drm_dp_helper.h
  29. #define DP_SINK_HW_REVISION_START 0x409
  30. #endif
  31. enum dpcd_revision {
  32. DPCD_REV_10 = 0x10,
  33. DPCD_REV_11 = 0x11,
  34. DPCD_REV_12 = 0x12,
  35. DPCD_REV_13 = 0x13,
  36. DPCD_REV_14 = 0x14
  37. };
  38. /* these are the types stored at DOWNSTREAMPORT_PRESENT */
  39. enum dpcd_downstream_port_type {
  40. DOWNSTREAM_DP = 0,
  41. DOWNSTREAM_VGA,
  42. DOWNSTREAM_DVI_HDMI_DP_PLUS_PLUS,/* DVI, HDMI, DP++ */
  43. DOWNSTREAM_NONDDC /* has no EDID (TV,CV) */
  44. };
  45. enum dpcd_link_test_patterns {
  46. LINK_TEST_PATTERN_NONE = 0,
  47. LINK_TEST_PATTERN_COLOR_RAMP,
  48. LINK_TEST_PATTERN_VERTICAL_BARS,
  49. LINK_TEST_PATTERN_COLOR_SQUARES
  50. };
  51. enum dpcd_test_color_format {
  52. TEST_COLOR_FORMAT_RGB = 0,
  53. TEST_COLOR_FORMAT_YCBCR422,
  54. TEST_COLOR_FORMAT_YCBCR444
  55. };
  56. enum dpcd_test_bit_depth {
  57. TEST_BIT_DEPTH_6 = 0,
  58. TEST_BIT_DEPTH_8,
  59. TEST_BIT_DEPTH_10,
  60. TEST_BIT_DEPTH_12,
  61. TEST_BIT_DEPTH_16
  62. };
  63. /* PHY (encoder) test patterns
  64. The order of test patterns follows DPCD register PHY_TEST_PATTERN (0x248)
  65. */
  66. enum dpcd_phy_test_patterns {
  67. PHY_TEST_PATTERN_NONE = 0,
  68. PHY_TEST_PATTERN_D10_2,
  69. PHY_TEST_PATTERN_SYMBOL_ERROR,
  70. PHY_TEST_PATTERN_PRBS7,
  71. PHY_TEST_PATTERN_80BIT_CUSTOM,/* For DP1.2 only */
  72. PHY_TEST_PATTERN_CP2520_1,
  73. PHY_TEST_PATTERN_CP2520_2,
  74. PHY_TEST_PATTERN_CP2520_3, /* same as TPS4 */
  75. PHY_TEST_PATTERN_128b_132b_TPS1 = 0x8,
  76. PHY_TEST_PATTERN_128b_132b_TPS2 = 0x10,
  77. PHY_TEST_PATTERN_PRBS9 = 0x18,
  78. PHY_TEST_PATTERN_PRBS11 = 0x20,
  79. PHY_TEST_PATTERN_PRBS15 = 0x28,
  80. PHY_TEST_PATTERN_PRBS23 = 0x30,
  81. PHY_TEST_PATTERN_PRBS31 = 0x38,
  82. PHY_TEST_PATTERN_264BIT_CUSTOM = 0x40,
  83. PHY_TEST_PATTERN_SQUARE = 0x48,
  84. PHY_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED = 0x49,
  85. PHY_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED = 0x4A,
  86. PHY_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED = 0x4B,
  87. };
  88. enum dpcd_test_dyn_range {
  89. TEST_DYN_RANGE_VESA = 0,
  90. TEST_DYN_RANGE_CEA
  91. };
  92. enum dpcd_audio_test_pattern {
  93. AUDIO_TEST_PATTERN_OPERATOR_DEFINED = 0,/* direct HW translation */
  94. AUDIO_TEST_PATTERN_SAWTOOTH
  95. };
  96. enum dpcd_audio_sampling_rate {
  97. AUDIO_SAMPLING_RATE_32KHZ = 0,/* direct HW translation */
  98. AUDIO_SAMPLING_RATE_44_1KHZ,
  99. AUDIO_SAMPLING_RATE_48KHZ,
  100. AUDIO_SAMPLING_RATE_88_2KHZ,
  101. AUDIO_SAMPLING_RATE_96KHZ,
  102. AUDIO_SAMPLING_RATE_176_4KHZ,
  103. AUDIO_SAMPLING_RATE_192KHZ
  104. };
  105. enum dpcd_audio_channels {
  106. AUDIO_CHANNELS_1 = 0,/* direct HW translation */
  107. AUDIO_CHANNELS_2,
  108. AUDIO_CHANNELS_3,
  109. AUDIO_CHANNELS_4,
  110. AUDIO_CHANNELS_5,
  111. AUDIO_CHANNELS_6,
  112. AUDIO_CHANNELS_7,
  113. AUDIO_CHANNELS_8,
  114. AUDIO_CHANNELS_COUNT
  115. };
  116. enum dpcd_audio_test_pattern_periods {
  117. DPCD_AUDIO_TEST_PATTERN_PERIOD_NOTUSED = 0,/* direct HW translation */
  118. DPCD_AUDIO_TEST_PATTERN_PERIOD_3,
  119. DPCD_AUDIO_TEST_PATTERN_PERIOD_6,
  120. DPCD_AUDIO_TEST_PATTERN_PERIOD_12,
  121. DPCD_AUDIO_TEST_PATTERN_PERIOD_24,
  122. DPCD_AUDIO_TEST_PATTERN_PERIOD_48,
  123. DPCD_AUDIO_TEST_PATTERN_PERIOD_96,
  124. DPCD_AUDIO_TEST_PATTERN_PERIOD_192,
  125. DPCD_AUDIO_TEST_PATTERN_PERIOD_384,
  126. DPCD_AUDIO_TEST_PATTERN_PERIOD_768,
  127. DPCD_AUDIO_TEST_PATTERN_PERIOD_1536
  128. };
  129. /* This enum is for programming DPCD TRAINING_PATTERN_SET */
  130. enum dpcd_training_patterns {
  131. DPCD_TRAINING_PATTERN_VIDEOIDLE = 0,/* direct HW translation! */
  132. DPCD_TRAINING_PATTERN_1,
  133. DPCD_TRAINING_PATTERN_2,
  134. DPCD_TRAINING_PATTERN_3,
  135. DPCD_TRAINING_PATTERN_4 = 7,
  136. DPCD_128b_132b_TPS1 = 1,
  137. DPCD_128b_132b_TPS2 = 2,
  138. DPCD_128b_132b_TPS2_CDS = 3,
  139. };
  140. /* This enum is for use with PsrSinkPsrStatus.bits.sinkSelfRefreshStatus
  141. It defines the possible PSR states. */
  142. enum dpcd_psr_sink_states {
  143. PSR_SINK_STATE_INACTIVE = 0,
  144. PSR_SINK_STATE_ACTIVE_CAPTURE_DISPLAY_ON_SOURCE_TIMING = 1,
  145. PSR_SINK_STATE_ACTIVE_DISPLAY_FROM_SINK_RFB = 2,
  146. PSR_SINK_STATE_ACTIVE_CAPTURE_DISPLAY_ON_SINK_TIMING = 3,
  147. PSR_SINK_STATE_ACTIVE_CAPTURE_TIMING_RESYNC = 4,
  148. PSR_SINK_STATE_SINK_INTERNAL_ERROR = 7,
  149. };
  150. #define DP_SOURCE_SEQUENCE 0x30c
  151. #define DP_SOURCE_TABLE_REVISION 0x310
  152. #define DP_SOURCE_PAYLOAD_SIZE 0x311
  153. #define DP_SOURCE_SINK_CAP 0x317
  154. #define DP_SOURCE_BACKLIGHT_LEVEL 0x320
  155. #define DP_SOURCE_BACKLIGHT_CURRENT_PEAK 0x326
  156. #define DP_SOURCE_BACKLIGHT_CONTROL 0x32E
  157. #define DP_SOURCE_BACKLIGHT_ENABLE 0x32F
  158. #define DP_SOURCE_MINIMUM_HBLANK_SUPPORTED 0x340
  159. #define DP_SINK_PR_REPLAY_STATUS 0x378
  160. #define DP_SINK_PR_PIXEL_DEVIATION_PER_LINE 0x379
  161. #define DP_SINK_PR_MAX_NUMBER_OF_DEVIATION_LINE 0x37A
  162. /* Remove once drm_dp_helper.h is updated upstream */
  163. #ifndef DP_TOTAL_LTTPR_CNT
  164. #define DP_TOTAL_LTTPR_CNT 0xF000A /* 2.1 */
  165. #endif
  166. #endif /* __DAL_DPCD_DEFS_H__ */