hv_mw_Video.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. /**
  2. * @file hv_mw_Video.h
  3. * @brief Header file of dpu module.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use hv_mw_Video(...) as a function handle.
  10. *
  11. * @endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 1.0.0
  15. * @date 2022-08-10
  16. */
  17. #ifndef __SDK_MIDDLEWARE_VIDEO_INC_VIDEO_H__
  18. #define __SDK_MIDDLEWARE_VIDEO_INC_VIDEO_H__
  19. #include "hv_comm_DataType.h"
  20. #include "hv_comm_Define.h"
  21. #include "hv_comm_PqDef.h"
  22. #include "../../inc/hv_mw_Channel_Manager.h"
  23. typedef struct _DataPathSearchTable
  24. {
  25. DisplayDataPathMode enDataPathMode;
  26. ColorFormatType enColorFormat;
  27. CompressRatio enCompressRatio;
  28. }DataPathSearchElem;
  29. /**
  30. * @brief Get default fake VideoConfigParams config param.
  31. * @param[in] none
  32. * @return VideoConfigParams.
  33. */
  34. VOID Hv_Mw_Video_GetFakeVideoConfigParams(VideoTimingParam *pstVideoTiming, VideoConfigParams *pstVideoConfigParams);
  35. /**
  36. * @brief Estimate Sub Channel ddr Size
  37. * @return ddr size.
  38. */
  39. UINT32 Hv_Mw_Video_EstimateSubChannelMemSize(PxpMode enPxpMode);
  40. /**
  41. * @brief video data patch is framesync
  42. * @return Status, 0-frc, 1-framesync.
  43. */
  44. BOOL Hv_Mw_Video_CheckUseFrameSync(BOOL bVflipEnable, const VideoTimingParam* pstVideoTiming, const VideoConfigParams* pstVideoConfigParams);
  45. /**
  46. * @brief Send Reconfig data path message to System task
  47. * @param[in] none
  48. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  49. */
  50. Status Hv_Mw_Video_DataPathReconfig( VOID );
  51. /**
  52. * @brief video Data path config
  53. * @param[in] ChannelType-main or sub, VideoConfigParams-param calc by preconfig,VdeTimingParam-param from RX.
  54. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  55. */
  56. Status Hv_Mw_Video_ConfigDisplayDataPath(ChannelData* pstChannelData, VideoConfigParams* pstVideoConfigParams, VideoTimingParam* pstRxVideoTiming);
  57. /**
  58. * @brief set INP pattern frame rate for pq calibrate
  59. * @param[in] uiFrameRate frame rate.
  60. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  61. */
  62. Status Hv_Mw_Video_SetPqCalibrateFrameRate(UINT32 uiFrameRate);
  63. /**
  64. * @brief Set video aspect ratio.
  65. * @param[in] enVideoRatio:read in hv_comm_Define.h
  66. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  67. */
  68. Status Hv_Mw_Video_SetAspectRatio(VideoRatio enVideoRatio);
  69. /**
  70. * @brief set main channel video inputport source.
  71. * @param[in] 0- HDMI0 1:HDMI1 2-DP0 3-DP1.
  72. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  73. */
  74. Status Hv_Mw_Video_SetMainVideoSource(LinkPortIndex enLinkPortIndex);
  75. #ifdef CONFIG_USER_DOUBLE_CHANNEL_ON
  76. /**
  77. * @brief Set PIP / PBP funciton enable.
  78. * @param[in] 0- close PIP or PBP 1-PIP enable 2-pbp enable.
  79. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  80. */
  81. Status Hv_Mw_Video_SetPxpMode(PxpMode enPxpMode);
  82. /**
  83. * @brief set sub channel video inputport source.
  84. * @param[in] 0- HDMI0 1:HDMI1 2-DP0 3-DP1.
  85. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  86. */
  87. Status Hv_Mw_Video_SetSubVideoSource(LinkPortIndex enLinkPortIndex);
  88. /**
  89. * @brief swap main and sub channel inputport source.
  90. * @param[in] none.
  91. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  92. */
  93. Status Hv_Mw_Video_SetMainSubVideoSourceSwap();
  94. /**
  95. * @brief In pip Mode set sub window position.
  96. * @param[in] 0:左上 1:左下 2:右上 3右下
  97. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  98. */
  99. Status Hv_Mw_Video_SetSubVideoWindowPosition(PipPos enPipPos);
  100. /**
  101. * @brief set pip sub h position
  102. */
  103. VOID Hv_Mw_Video_SetPipWindowHPosition(USHORT16 usHPosLevel);
  104. /**
  105. * @brief set pip sub V position
  106. */
  107. VOID Hv_Mw_Video_SetPipWindowVPosition(USHORT16 usVPosLevel);
  108. /**
  109. * @brief get pip sub h position
  110. */
  111. USHORT16 Hv_Mw_Video_GetPipWindowHPosition(VOID);
  112. /**
  113. * @brief get pip sub V position
  114. */
  115. USHORT16 Hv_Mw_Video_GetPipWindowVPosition(VOID);
  116. /**
  117. * @brief set pbp window size.
  118. * @param[in] 0-small 1-middle 2-big
  119. */
  120. Status Hv_Mw_Video_SetPbpSize(PbpSize enPbpSize);
  121. /**
  122. * @brief set pip window size.
  123. * @param[in] 0-small 1-big
  124. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  125. */
  126. Status Hv_Mw_Video_SetSubVideoWindowSize(PipSize enPipSize);
  127. #endif
  128. /**
  129. * @brief set professional esport funciton switch.
  130. * @param[in] HV_OFF-close HV_ON-open
  131. */
  132. VOID Hv_Mw_Video_SetProEsportSwitch(UCHAR8 ucSw);
  133. /**
  134. * @brief set FreeSync funciton switch.
  135. * @param[in] HV_OFF-close HV_ON-open
  136. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  137. */
  138. Status Hv_Mw_Video_SetFreeSyncSwitch(UCHAR8 ucSw);
  139. /**
  140. * @brief 需要修改EDID重新拉HPD的HDR开关类型
  141. * @param[in] 0-close 1-open
  142. */
  143. VOID Hv_Mw_Video_SetEdidHdrSwitch(UINT32 uiValue);
  144. /**
  145. * @brief Set h flip
  146. * @param[in] HV_OFF-close HV_ON-open
  147. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  148. */
  149. Status Hv_Mw_Video_SetHflipSwitch(UCHAR8 ucSw);
  150. /**
  151. * @brief Set v flip
  152. * @param[in] HV_OFF-close HV_ON-open
  153. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  154. */
  155. Status Hv_Mw_Video_SetVflipSwitch(UCHAR8 ucSw);
  156. /**
  157. * @brief set auto search signal source function enable .
  158. * @param[in] HV_OFF-close HV_ON-open
  159. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  160. */
  161. Status Hv_Mw_Video_SetVideoAutoSelectSw(UCHAR8 ucSw);
  162. /**
  163. * @brief calc dcw ddr size.
  164. */
  165. VOID Hv_Mw_video_CalcDcwDdrOrWtrSize(VideoConfigParams* pstVideoConfigParams);
  166. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_MAGNIFY)
  167. /**
  168. * @brief Calc ddr video size.
  169. * @param[in] VideoConfigParams
  170. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  171. */
  172. VOID Hv_Mw_video_CalcMagniferDdrVideoSize(VideoConfigParams* pstVideoConfigParams);
  173. /**
  174. * @brief set Magnify Glass function Switch .
  175. * @param[in] HV_OFF-close HV_ON-open
  176. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  177. */
  178. Status Hv_Mw_Video_SetMagnifyGlassSwitch(UCHAR8 ucSw);
  179. /**
  180. * @brief set Magnify Glass function ratio .
  181. * @param[in] 0-100
  182. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  183. */
  184. Status Hv_Mw_Video_SetMagnifyGlassRatio(FLOAT32 fMgRatio);
  185. /**
  186. * @brief set Magnify Glass position
  187. * @param[in] range usMgPosH: 0-pannel Hactive, usMgPosV: 0-panel Vactive
  188. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  189. */
  190. Status Hv_Mw_Video_SetMagnifyGlassPos(USHORT16 usMgPosH, USHORT16 usMgPosV);
  191. /**
  192. * @brief set Magnify Glass sampling location
  193. * @param[in] range usSampleLocH: 0-pannel Hactive, usSampleLocV: 0-panel Vactive
  194. */
  195. VOID Hv_Mw_Video_SetMagnifyGlassSamplingLocation(USHORT16 usSampleLocH, USHORT16 usSampleLocV);
  196. /**
  197. * @brief set Magnify Glass Size
  198. * @param[in] range usMgHsize:0-panne Havtive , usMgVsize: 0-panel Vactive
  199. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  200. */
  201. Status Hv_Mw_Video_SetMagnifyGlassSize(USHORT16 usMgHsize, USHORT16 usMgVsize);
  202. #endif
  203. /**
  204. * @brief Set mprt enable.
  205. * @param[in] enMprtType:0-disable , 1: normal mprt, 2: vrr mprt
  206. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  207. */
  208. VOID Hv_Mw_Video_SetOutMprtPwmEnable(MprtType enMprtType);
  209. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_MAIN_MONTAGE)
  210. /**
  211. * @brief Set main channel montage enbale.
  212. * @param[in] bSw:0-disable , 1: enable
  213. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  214. */
  215. Status Hv_Mw_Video_SetMainMontageSw(UCHAR8 ucSw);
  216. /**
  217. * @brief Updata video param for montage setting.
  218. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  219. */
  220. Status Hv_Mw_Video_SetMainMontageParam(USHORT16 usCutHsta, USHORT16 usCutHend, USHORT16 usCutVsta, USHORT16 usCutVend);
  221. #endif
  222. /**
  223. * @brief Set ALLM enable and return status.
  224. * @return Status, 0-HV_FALSE, 1-HV_TRUE.
  225. */
  226. BOOL Hv_Mw_Video_SetMainALLMStatus(VOID);
  227. /**
  228. * @brief Set main channel over scan enbale.
  229. * @param[in] HV_OFF-close HV_ON-open
  230. */
  231. VOID Hv_Mw_Video_SetOverScanEn(UCHAR8 ucSw);
  232. /**
  233. * @brief Set main channel over scan enbale.
  234. * @return Status, 0-HV_FALSE, 1-HV_TRUE.
  235. */
  236. BOOL Hv_Mw_Video_GetOverScanEn(VOID);
  237. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_OVER_PANEL_CLOCK_EN)
  238. /**
  239. * @brief Set panel over clock en.
  240. */
  241. VOID Hv_Mw_Video_SetOverClockEn(UCHAR8 ucSw);
  242. /**
  243. * @brief Get panel over clock en.
  244. * @return Status, 0-HV_FALSE, 1-HV_TRUE.
  245. */
  246. BOOL Hv_Mw_Video_GetOverClockEn(VOID);
  247. #endif
  248. /**
  249. * @brief Get dtc vtotal is in panel spec.
  250. * @return BOOL, 0-HV_FALSE, 1-HV_TRUE.
  251. */
  252. BOOL Hv_Mw_Video_IsDtcVtotalInPanlSpec(VOID);
  253. /**
  254. * @brief Get dtc dynamic htotal
  255. */
  256. USHORT16 Hv_Mw_Video_GetDtcDynamicHtotal(VOID);
  257. /**
  258. * @brief Updata panel param for video to used.
  259. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  260. */
  261. VOID Hv_Mw_Video_SetVideoPanelParam(VOID);
  262. /**
  263. * @brief Set Line interrupt
  264. * @param[in] ucIndex: one of 24 index
  265. * @param[in] usLine: Line number of Interrupt
  266. * @return Status, None
  267. */
  268. VOID Hv_Mw_Video_SetLineInt(UCHAR8 ucIndex, USHORT16 usLine);
  269. /**
  270. * @brief Set Line en 24bit
  271. * @param[in] uiEn, 24bit en
  272. * @return Status, None
  273. */
  274. VOID Hv_Mw_Video_SetLineIntEn(UINT32 uiEn);
  275. /**
  276. * @brief Set dpu int en
  277. * @param[in] ucEn, 5bits
  278. * @return Status, None
  279. */
  280. VOID Hv_Mw_Video_SetDpuIntEn(UCHAR8 ucEn);
  281. /**
  282. * @brief Set Main Channel pos if not full screen
  283. * @param[in] pstVideoConfigParams
  284. * @param[in] usHoffset
  285. * @param[in] usVoffset
  286. * @return Status, None
  287. */
  288. VOID Hv_Mw_Video_SetMainPicPos(VideoConfigParams* pstVideoConfigParams, USHORT16 usHoffset, USHORT16 usVoffset);
  289. #endif