ProjectConfig.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. /**
  2. * @file ProjectConfig.h
  3. * @brief Header file of Project.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. *
  10. *
  11. @ endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 1.0.0
  15. * @date 2022-08-26
  16. */
  17. #ifndef __DEVICE_HIVIEW_HT7315_PRODUCT_QHD_PROJECT_H__
  18. #define __DEVICE_HIVIEW_HT7315_PRODUCT_QHD_PROJECT_H__
  19. #define HV_CONFIG_ON 1
  20. #define HV_CONFIG_OFF 0
  21. /*************************************************
  22. Platform definiton
  23. *************************************************/
  24. #define HV_PROJECT_CONFIG_MANUFACT_OUI 0x24DD1B
  25. #define HV_PROJECT_CONFIG_DEV_STRING0 0x00
  26. #define HV_PROJECT_CONFIG_DEV_STRING1 0x00000000
  27. #define HV_PROJECT_CONFIG_DEV_STRING2 0x00
  28. #define HV_PROJECT_CONFIG_HW_MAJOR_REV 0x00
  29. #define HV_PROJECT_CONFIG_HW_MINOR_REV 0x00
  30. #define HV_PROJECT_CONFIG_FW_MAJOR_REV 0x00
  31. #define HV_PROJECT_CONFIG_FW_MINOR_REV 0x00
  32. #define HV_PROJECT_CONFIG_GUID0 0x00000000
  33. #define HV_PROJECT_CONFIG_GUID1 0x00000000
  34. #define HV_PROJECT_CONFIG_GUID2 0x00000000
  35. #define HV_PROJECT_CONFIG_GUID3 0x00000000
  36. /*特殊分辨率panel 自定义分辨率,给OSD/OD等宏使用*/
  37. #ifdef CONFIG_USER_PANEL_RESOLUTION_TYPE_CUSTOMIZE
  38. #define HV_PROJECT_CONFIG_PANEL_H_ACTIVE_CUSTOMIZE 3440
  39. #define HV_PROJECT_CONFIG_PANEL_V_ACTIVE_CUSTOMIZE 1440
  40. #endif
  41. /*************************************************
  42. Product function definiton
  43. *************************************************/
  44. #define HV_PROJECT_CONFIG_DARK_STABILIZER HV_CONFIG_ON
  45. #define HV_PROJECT_CONFIG_MPRT HV_CONFIG_ON
  46. #define HV_PROJECT_CONFIG_FREESYNC HV_CONFIG_ON
  47. #define HV_PROJECT_CONFIG_ADAPTIVESYNC HV_CONFIG_ON
  48. #define HV_PROJECT_CONFIG_GSYNC HV_CONFIG_ON
  49. #define HV_PROJECT_CONFIG_LDR HV_CONFIG_ON
  50. #define HV_PROJECT_CONFIG_DCR HV_CONFIG_ON
  51. #define HV_PROJECT_CONFIG_EYESHIELD HV_CONFIG_ON
  52. #define HV_PROJECT_CONFIG_CROSSHAIR HV_CONFIG_ON
  53. #define HV_PROJECT_CONFIG_REFRESH_RATE HV_CONFIG_ON
  54. #define HV_PROJECT_CONFIG_HDR HV_CONFIG_ON
  55. #define HV_PROJECT_CONFIG_CUSTOM_KEY HV_CONFIG_ON
  56. #define HV_PROJECT_CONFIG_LIGHT_EFFECT HV_CONFIG_ON
  57. #define HV_PROJECT_CONFIG_VARIABLEBACKLIGHT HV_CONFIG_ON
  58. #define HV_PROJECT_CONFIG_CM HV_CONFIG_ON
  59. #define HV_PROJECT_CONFIG_AUDIO_SETTING HV_CONFIG_ON
  60. #define HV_PROJECT_CONFIG_MAIN_MONTAGE HV_CONFIG_OFF
  61. #define HV_PROJECT_CONFIG_MAIN_FLIP HV_CONFIG_ON
  62. #ifdef CONFIG_USER_DOUBLE_CHANNEL_ON
  63. #define HV_PROJECT_CONFIG_MAGNIFY HV_CONFIG_ON
  64. #define HV_PROJECT_CONFIG_PXP HV_CONFIG_ON
  65. #else
  66. #define HV_PROJECT_CONFIG_MAGNIFY HV_CONFIG_OFF
  67. #define HV_PROJECT_CONFIG_PXP HV_CONFIG_OFF
  68. #endif
  69. /*************************************************
  70. INPUTPORT Option
  71. *************************************************/
  72. #define HV_PROJECT_CONFIG_HDCP_KEY_ONROM HV_CONFIG_OFF /* 1: HDCP Key saved in ROM */
  73. #define HV_PROJECT_CONFIG_HDCP_KEY_CLEAR_TEXT HV_CONFIG_OFF /* 0: cipher Text(����); 1: clear Text(����) */
  74. #define HV_PROJECT_CONFIG_EDID_EXTER_EEPROM HV_CONFIG_OFF /* 1: USE Extern EEPROM to save EDID */
  75. #define HV_PROJECT_CONFIG_EDID_UP_FCTWEEK HV_CONFIG_ON /* 1: Update the Factory Week */
  76. #define HV_PROJECT_CONFIG_EDID_UP_FCTYEAR HV_CONFIG_ON /* 1: EDID Update the Factory Year */
  77. #define HV_PROJECT_CONFIG_EDID_UP_SN_VENDOR HV_CONFIG_OFF /* 1: EDID Update the Factory SN on Vendor Info */
  78. #define HV_PROJECT_CONFIG_EDID_UP_DESC_SN HV_CONFIG_ON /* 1: EDID Update the Factory SN on Desc Info */
  79. #define HV_PROJECT_CONFIG_ESEGMENT HV_CONFIG_ON /* 1: Support E-Segment */
  80. #define HV_PROJECT_CONFIG_ESEGMENT_PM51 HV_CONFIG_OFF /* 1: Support E-Segment on 51 */
  81. #define HV_PROJECT_CONFIG_FRL HV_CONFIG_ON /* 1: Support HDMI FRL */
  82. #define HV_PROJECT_CONFIG_CTS HV_CONFIG_OFF /* 1: CTS specific handle */
  83. #define HV_PROJECT_CONFIG_DEFAULT_EDID HV_CONFIG_ON /* 1: Default EDID exist*/
  84. #define HV_PROJECT_CONFIG_VCP_CMD_FREESYNC HV_CONFIG_ON /* 1: Use AMD VCP Code to update freesync state */
  85. /*************************************************
  86. PQ Option
  87. *************************************************/
  88. // #define HDR_PARAM_DYNAMIC_UP
  89. #ifdef HDR_PARAM_DYNAMIC_UP
  90. // 如下宏定义的色坐标值 = EDID色坐标值,范围 0.000 ~ 0.999
  91. #define HDR_RED_X ((FLOAT32)0.111)
  92. #define HDR_RED_Y ((FLOAT32)0.222)
  93. #define HDR_GREEN_X ((FLOAT32)0.333)
  94. #define HDR_GREEN_Y ((FLOAT32)0.444)
  95. #define HDR_BLUE_X ((FLOAT32)0.555)
  96. #define HDR_BLUE_Y ((FLOAT32)0.666)
  97. #define HDR_WHITE_X ((FLOAT32)0.777)
  98. #define HDR_WHITE_Y ((FLOAT32)0.888)
  99. // 注意,只有原始EDID存在HDR Static Metadata,如下HDR_LUMINANCE的宏才会生效
  100. // 如下宏定义的亮度值单位为cd/m^2,max范围为 50 ~ 12525.722,min范围为 0 ~ 125.257
  101. #define HDR_LUMINANCE_MAX_EN (1) // 0:禁用,1:启用
  102. #define HDR_LUMINANCE_MAX ((FLOAT32)436.203)
  103. #define HDR_LUMINANCE_AVG_EN (1) // 0:禁用,1:启用,该值如果为1,HDR_LUMINANCE_MAX_EN必须为1
  104. #define HDR_LUMINANCE_AVG ((FLOAT32)147.683)
  105. #define HDR_LUMINANCE_MIN_EN (1) // 0:禁用,1:启用,该值如果为1,HDR_LUMINANCE_AVG_EN必须为1
  106. #define HDR_LUMINANCE_MIN ((FLOAT32)0.007)
  107. #endif
  108. /*************************************************
  109. DEMURA Option
  110. *************************************************/
  111. #ifdef CONFIG_USER_DISPCTRL_DEMURA_ON
  112. #define DEMURA_COLOR_MODE (0) /*0-mono mode, 1-color mode*/
  113. #define DEMURA_BLK_X_BIT (3) /*block x size bits*/
  114. #define DEMURA_BLK_Y_BIT (3) /*block y size bits*/
  115. #define DEMURA_LAYER_NUM (3) /*layer number*/
  116. #define DEMURA_BLACK_LIMIT (0) /*lower level*/
  117. #define DEMURA_LAYER0_LEVEL (256) /*layer0 level*/
  118. #define DEMURA_LAYER1_LEVEL (512) /*layer1 level*/
  119. #define DEMURA_LAYER2_LEVEL (716) /*layer2 level*/
  120. #define DEMURA_LAYER3_LEVEL (716) /*layer3 level*/
  121. #define DEMURA_LAYER4_LEVEL (716) /*layer4 level*/
  122. #define DEMURA_LAYER5_LEVEL (716) /*layer5 level*/
  123. #define DEMURA_LAYER6_LEVEL (716) /*layer6 level*/
  124. #define DEMURA_LAYER7_LEVEL (716) /*layer7 level*/
  125. #define DEMURA_LAYER8_LEVEL (716) /*layer8 level*/
  126. #define DEMURA_WHITE_LIMIT (1023) /*upper level*/
  127. #define DEMURA_STRENGTH_GAIN_LOW (0x00) /*low strength gain */
  128. #define DEMURA_STRENGTH_GAIN (0x400) /*type strength gain*/
  129. #define DEMURA_STRENGTH_GAIN_HIGH (0x400) /*high strength gain*/
  130. #endif
  131. /*************************************************
  132. DPU Option
  133. *************************************************/
  134. /*是否允许SUB通道和辅助通道公用相同的port*/
  135. #define HV_PROJECT_CONFIG_CHANNEL_USE_SAME_PORT 1
  136. /*是否开启完整LocalDimming*/
  137. #define HV_PROJECT_CONFIG_FULL_LOCALDIMMING HV_CONFIG_OFF
  138. /*是否开启LocalDimming 2D PixelGain*/
  139. #define HV_PROJECT_CONFIG_LDC_2D_PIXELGAIN HV_CONFIG_OFF
  140. /* 开启ldc需要配置kspi通道 */
  141. #if (HV_PROJECT_CONFIG_FULL_LOCALDIMMING == HV_CONFIG_ON)
  142. #define HV_PROJECT_CONFIG_KSPI_CHANNEL_NUM 0x1
  143. #endif
  144. /*是否使用bin文件进行PQ初始化*/
  145. #define HV_PROJECT_CONFIG_PQ_INITBYBIN HV_CONFIG_ON
  146. /*PQ模块调试工具是否读写数据库,默认关闭,调试PQ打开*/
  147. #define HV_PROJECT_CONFIG_PQ_DATABASEWREN HV_CONFIG_ON
  148. /* PQ模块关闭HDR是否切换EDID*/
  149. #define HV_PROJECT_CONFIG_PQ_HDR_CHANGEEDID HV_CONFIG_OFF
  150. /*搜索端口的间隔时间,单位ms*/
  151. #define HV_PROJECT_CONFIG_PERIOD_SEARCH_CHECK_SROUCE_TIMER 100
  152. #define HV_PROJECT_CONFIG_CURRENT_PORT_SEARCHE_TIMES 90 /*当前通道搜索次数,一次HV_PROJECT_CONFIG_PERIOD_SEARCH_CHECK_SROUCE_TIMER毫秒*/
  153. #define HV_PROJECT_CONFIG_EACH_PORT_DISCONNECT_SEARCHE_TIMES 20 /*通道未插线搜索次数,一次HV_PROJECT_CONFIG_PERIOD_SEARCH_CHECK_SROUCE_TIMER毫秒*/
  154. #if (HV_PROJECT_CONFIG_CTS == HV_CONFIG_OFF)
  155. #define HV_PROJECT_CONFIG_NO_SIGNAL_CHECK_TIMES 10 /*无信号时进入待机前的检测信号的次数,每1秒检测一次*/
  156. #define HV_PROJECT_CONFIG_EACH_PORT_SERARCH_MAX_TIMES 30 /*提示无信号前,每个插线通道搜索的次数,每100ms搜索一次*/
  157. #else
  158. #define HV_PROJECT_CONFIG_NO_SIGNAL_CHECK_TIMES 200
  159. #define HV_PROJECT_CONFIG_EACH_PORT_SERARCH_MAX_TIMES 100
  160. #endif
  161. /*工厂模式下,加速进入老化模式*/
  162. #define HV_PROJECT_CONFIG_BURN_IN_EACH_PORT_SEARCH_TIMES 10
  163. #define HV_PROJECT_CONFIG_MAX_SEARCH_TIMERS_BURN_IN (HV_PROJECT_CONFIG_BURN_IN_EACH_PORT_SEARCH_TIMES * (HV_BOARD_CONFIG_MAX_HDMI_PORT_NUM + HV_BOARD_CONFIG_MAX_DP_PORT_NUM))
  164. /*unit millisecond*/
  165. /*total nosignal keep time = NO_SIGNAL_DURATION_TIMES * NO_SIGNAL_CHECK_TIMER_LENGTH */
  166. #define HV_PROJECT_CONFIG_NO_SIGNAL_CHECK_TIMER_LENGTH 1000
  167. #define HV_PROJECT_CONFIG_DPU_OVER_SCAN_SIDE_SIZE 250UL /*side image (250 is 2.5% of each side size) over screen, 0: off*/
  168. #define HV_PROJECT_CONFIG_DPU_BRIGHT_FRAME HV_CONFIG_OFF
  169. #define HV_PROJECT_CONFIG_AUTO_POWER_OFF HV_CONFIG_OFF
  170. #define HV_PROJECT_CONFIG_MAGNIFY_SAMPLING_FLOW_POS HV_CONFIG_ON /*放大镜取样位置是否跟随放大镜显示位置(放大放大镜正下方画面)*/
  171. #define HV_PROJECT_CONFIG_PIP_POS_PRECISE_ADJ HV_CONFIG_OFF /*PIP sub 位置是否开启精确调节,开启后h v位置可以步进调节*/
  172. #define HV_PROJECT_CONFIG_CHANNEL_SEAMLESS_SWITCH HV_CONFIG_OFF /*双通道冻结一帧切换*/
  173. #define HV_PROJECT_CONFIG_OVER_PANEL_CLOCK_EN HV_CONFIG_OFF
  174. #define HV_PROJECT_CONFIG_OVER_PANEL_CLOCK_UP 2000 /*over panel pixel clock KHz*/
  175. #define HV_PROJECT_CONFIG_OVER_PANEL_CLOCK_DOWN 2000 /*reduce panel pixel clock KHz*/
  176. /*************************************************
  177. PM51 Option
  178. *************************************************/
  179. #define HV_PROJECT_CONFIG_PM51_UART_PRINT_ENABLE HV_CONFIG_ON
  180. #define HV_PROJECT_CONFIG_PM51_TYPEC0_ENABLE HV_CONFIG_ON
  181. /* STBY_GP 189:6, 161:0, 162:1 */
  182. #define HV_PROJECT_CONFIG_PM51_IR_USE_GPIO 6
  183. #define HV_PROJECT_CONFIG_PM51_IR_SYSCODE0 0x00bf
  184. #define HV_PROJECT_CONFIG_PM51_IR_SYSCODE1 0x00fc
  185. #define HV_PROJECT_CONFIG_PM51_IR_POWERCODE 0x0d
  186. /*************************************************
  187. DPMS Option
  188. *************************************************/
  189. #define HV_PROJECT_CONFIG_DPMS_HDMI0_CABLE_ENABLE HV_CONFIG_ON
  190. #define HV_PROJECT_CONFIG_DPMS_HDMI1_CABLE_ENABLE HV_CONFIG_ON
  191. #define HV_PROJECT_CONFIG_DPMS_DP0_CABLE_ENABLE HV_CONFIG_OFF
  192. #define HV_PROJECT_CONFIG_DPMS_DP1_CABLE_ENABLE HV_CONFIG_ON
  193. #define HV_PROJECT_CONFIG_DPMS_DP0_AUX_ENABLE HV_CONFIG_OFF
  194. #define HV_PROJECT_CONFIG_DPMS_DP1_AUX_ENABLE HV_CONFIG_ON
  195. #define HV_PROJECT_CONFIG_DPMS_DP0_GPIO_ENABLE HV_CONFIG_OFF
  196. #define HV_PROJECT_CONFIG_DPMS_DP1_GPIO_ENABLE HV_CONFIG_ON
  197. #define HV_PROJECT_CONFIG_HDMI0_DDC_WAKEUP_ENABLE HV_CONFIG_ON
  198. #define HV_PROJECT_CONFIG_HDMI1_DDC_WAKEUP_ENABLE HV_CONFIG_ON
  199. #define HV_PROJECT_CONFIG_CABLE_WAKEUP_DOUBLE_ENABLE HV_CONFIG_ON
  200. /*************************************************
  201. Audio Option
  202. *************************************************/
  203. #define HV_PROJECT_CONFIG_VOLUME_CONSISTENT 1
  204. #define HV_PROJECT_CONFIG_AUDIO_EQ 1
  205. #define HV_PROJECT_CONFIG_DIGITAL_MAX_VOLUME 256
  206. //#define HV_PROJECT_CONFIG_ADJUST_DIGITAL_VOLUME 1
  207. /*************************************************
  208. Panel Option
  209. *************************************************/
  210. #define HV_PROJECT_CONFIG_EDP_TX_TRAINING_TYPE HV_EDP_TX_FULL_LINK_TRAINING
  211. #define HV_PROJECT_CONFIG_EDP_TX_ASSR_EN HV_CONFIG_OFF
  212. #define HV_PROJECT_CONFIG_EDP_TX_AUX0_PORT EDP_AUX_PROT_INDEX0
  213. #define HV_PROJECT_CONFIG_EDP_TX_AUX1_PORT EDP_AUX_PROT_INDEX1
  214. #define HV_PROJECT_CONFIG_EDP_TX_HPD0_PORT EDP_HPD_PROT_INDEX0
  215. #define HV_PROJECT_CONFIG_EDP_TX_HPD1_PORT EDP_HPD_PROT_INDEX1
  216. #define HV_PROJECT_CONFIG_EDP_TX_HPD_IRQ_EN HV_CONFIG_OFF
  217. /*************************************************
  218. MPRT(PWM) Option
  219. *************************************************/
  220. /* 通过原理图查看pinshare,选择合适的port输出波形 */
  221. #define HV_PROJECT_CONFIG_MPRT_HIGHT_PORT 1 //GPIO11/PWM1/PIN92控制
  222. #define HV_PROJECT_CONFIG_MPRT_HIGHT_POL 0
  223. #define HV_PROJECT_CONFIG_BACKLIGHT_ENABLE 1 //背光开
  224. #define HV_PROJECT_CONFIG_BACKLIGHT_DISABLE 0 //背光关
  225. /* 输出固定高频PWM所需的固定参数,根据要设置的频率查表得到此值 */
  226. #define HV_PROJECT_CONFIG_MPRT_HIGHT_FREQ_PWM_TOTAL 4304
  227. #define HV_PROJECT_CONFIG_MPRT_HIGHT_FREQ_PWM_MULT 0
  228. #define HV_PROJECT_CONFIG_MPRT_HIGHT_FREQ_PWM_DUTY 90
  229. /* 通过原理图查看pinshare,选择合适的port输出波形 */
  230. #define HV_PROJECT_CONFIG_MPRT_PORT 2 //GPIO12/PWM2/PIN93控制
  231. #define HV_PROJECT_CONFIG_MPRT_POL 0
  232. /* 输出固定MPRT的PWM所需的固定参数 */
  233. #define HV_PROJECT_CONFIG_MPRT_MODE 0
  234. #define HV_PROJECT_CONFIG_MPRT_STA_VALUE 690 //普通MPRT模式下的拉高起始行,根据实际效果调节
  235. #define HV_PROJECT_CONFIG_MPRT_VALUE 1440
  236. #define HV_PROJECT_CONFIG_MPRT_VS_CLEAR 1 // VRR下MPRT开时,VS_CLEAR也要开,保证在帧结尾波形被拉低
  237. #define HV_PROJECT_CONFIG_MPRT_VRR_STA_VALUE 19660 //65535的占比,起始行占htotal的比例,会根据上一帧自动计算,这里只设比例即可
  238. #define HV_PROJECT_CONFIG_MPRT_VRR_VALUE 1440 // VRR下MPRT开时,VALUE按h total算,要保障拉行数足够大在帧结尾保持高电平
  239. /* 设置供LDC使用的vsync接口,需要PWM的一个通道 */
  240. #define HV_PROJECT_CONFIG_MPRT_LDCVSYNC_PORT 4
  241. /*************************************************
  242. Factory Option
  243. *************************************************/
  244. /* Factory Min*/
  245. #define HV_PROJECT_CONFIG_FACTORY_PANEL_TIME_COUNT_PERIOD 30
  246. /* Device Info Define*/
  247. #define HV_PROJECT_CONFIG_FACTORY_MONITOR_MODE "HIVIEW 27G5F_QHD"
  248. #define HV_PROJECT_CONFIG_FACTORY_SCALER_MODE "HT7315"
  249. #define HV_PROJECT_CONFIG_FACTORY_FW_VERSION "1.0.0"
  250. #define HV_PROJECT_CONFIG_FACTORY_FW_CHANGE_DATE "20241209"
  251. #define HV_PROJECT_CONFIG_FACTORY_PANEL_TYPE "SN270ES01_1 V1.4"
  252. #define HV_PROJECT_CONFIG_FACTORY_PANEL_SIZE "27.0"
  253. /* 8Bytes Max */
  254. #define HV_PROJECT_CONFIG_HDMI_SCDC_DEVICE_STR "HiView"
  255. /*Color Filter Define */
  256. #define HV_PROJECT_CONFIG_COLOR_FILTER HV_CONFIG_ON
  257. /*PQ Ambilight Define */
  258. #define HV_PROJECT_CONFIG_AMBILIGHT HV_CONFIG_ON
  259. /*PQ Ambient Light Define */
  260. #define HV_PROJECT_CONFIG_AMBIENT_LIGHT HV_CONFIG_OFF
  261. /*OSD&LD Bright Frame Define */
  262. #define HV_PROJECT_CONFIG_OSD_BRIGHT_FRAME HV_CONFIG_OFF
  263. #define HV_PROJECT_CONFIG_BRIGHT_FRAME_ALPHA (128)
  264. /* PQ VRR Gamma support */
  265. #define HV_PROJECT_CONFIG_VRR_GAMMA HV_CONFIG_ON
  266. #define HV_PROJECT_CONFIG_PLATFORM HV_CONFIG_ON
  267. /*OTA Partition Define */
  268. #define HV_PROJECT_CONFIG_DUAL_PARTITION HV_CONFIG_ON
  269. #define HV_PROJECT_CONFIG_LOGO_BIN_NAME "Logo.bin"
  270. /* 0:remember, 1:poweroff, 2:poweroff */
  271. #define HV_PROJECT_CONFIG_AC_POWER_STATE 2
  272. #endif