hv_mw_PQ.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. /**
  2. * @file hv_mw_PQ.h
  3. * @brief Header file of dpu module.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use hv_mw_PQ(...) 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_PQ_H__
  18. #define __SDK_MIDDLEWARE_VIDEO_INC_PQ_H__
  19. #include "Common/hv_comm_DataType.h"
  20. #include "hv_comm_Define.h"
  21. #include "hv_comm_PqDef.h"
  22. #if (HV_PROJECT_CONFIG_PQ_DATABASEWREN == HV_CONFIG_ON)
  23. #define HV_PQ_DATABASE_SET(module, param, value) HV_COMMON_DATABASE_SET(module, param, value)
  24. #else
  25. #define HV_PQ_DATABASE_SET(module, param, value) \
  26. ({\
  27. \
  28. })
  29. #endif
  30. #define HV_PQ_DATABASE_GET(module, param) HV_COMMON_DATABASE_GET(module, param)
  31. typedef struct _DispCtrlCfg
  32. {
  33. const UINT32 *puiFrameDetThd;
  34. const UINT32 *puiGammaVrrLut;
  35. const UINT32 *puiODLut0;
  36. const UINT32 *puiODLut1;
  37. const UINT32 *puiDemuraLut;
  38. UINT32 uiDemuraLutLen;
  39. }DispCtrlCfg;
  40. /**
  41. * @brief bypass all PQ Module.
  42. * @param[in] bBypass, status of PQ bypass
  43. * @return VOID
  44. */
  45. VOID Hv_Mw_PQ_PQBypass(BOOL bBypass);
  46. /**
  47. * @brief PQ common reg Init.
  48. * @param[in] puiBaseRegAddr:address of Init bin;
  49. * @param[in] uiLen:address of Init bin;
  50. * @return None.
  51. */
  52. VOID Hv_Mw_PQ_DpuPQ_CommonRegInit(const UINT32 *puiBaseRegAddr, UINT32 uiLen);
  53. /**
  54. * @brief CM reg Init.
  55. * @param[in] puiCmAddr:address of CM Init bin;
  56. * @param[in] uiLen:address of Init bin;
  57. * @return Stauts, 0-HV_SUCCESS, 1-HV_FAILURE.
  58. */
  59. Status Hv_Mw_PQ_CMInit(const UINT32 *puiCmAddr, UINT32 uiLen);
  60. /**
  61. * @brief CM Lut Init.
  62. * @param[in] puiCmLutAddr:default address of CM lut;
  63. * @param[in] puiCmLutAddr2:current address of CM lut;
  64. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  65. */
  66. Status Hv_Mw_PQ_CMLutInit(const UINT32 *puiCmLutAddr, UINT32 *puiCmLutAddr2);
  67. /**
  68. * @brief CM Enable.
  69. * @param[in] bEn:status of CM enable;
  70. * @return VOID
  71. */
  72. VOID Hv_Mw_PQ_CMEnable(BOOL bEn);
  73. /**
  74. * @brief CM setting hue.
  75. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  76. * @param[in] ucCmHue:value of hue setting;
  77. * @return VOID
  78. */
  79. VOID Hv_Mw_PQ_CMSetHue(CmColorType enCmMod, UCHAR8 ucCmHue);
  80. /**
  81. * @brief CM setting saturation.
  82. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  83. * @param[in] ucSat:value of sat setting;
  84. * @return VOID
  85. */
  86. VOID Hv_Mw_PQ_CMSetSat(CmColorType enCmMod, UCHAR8 ucSat);
  87. /**
  88. * @brief CM setting luminance.
  89. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  90. * @param[in] ucLum:value of lum setting;
  91. * @return VOID
  92. */
  93. VOID Hv_Mw_PQ_CMSetLum(CmColorType enCmdMod, UCHAR8 ucLum);
  94. /**
  95. * @brief CM getting hue.
  96. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  97. * @return value of hue.
  98. */
  99. UCHAR8 Hv_Mw_PQ_CMGetHue(CmColorType enCmMod);
  100. /**
  101. * @brief CM getting saturation.
  102. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  103. * @return value of saturation.
  104. */
  105. UCHAR8 Hv_Mw_PQ_CMGetSat(CmColorType enCmMod);
  106. /**
  107. * @brief CM getting luminance.
  108. * @param[in] ucCmMod:module of CM(R,G,B,C,M,Y);
  109. * @return value of luminance.
  110. */
  111. UCHAR8 Hv_Mw_PQ_CMGetLum(CmColorType enCmMod);
  112. /**
  113. * @brief CM64��for CM debug by tool�� setting all parameters.
  114. * @param[in] None;
  115. * @return VOID
  116. */
  117. VOID Hv_Mw_PQ_CM64SetAll(VOID);
  118. /**
  119. * @brief CM64��for CM debug by tool��setting hue.
  120. * @param[in] ucIndex:index of hue(0-63);
  121. * @return VOID
  122. */
  123. VOID Hv_Mw_PQ_CM64AxisSetHue(UCHAR8 ucIndex);
  124. /**
  125. * @brief CM64��for CM debug by tool��setting luminance.
  126. * @param[in] ucIndex:index of lum(0-63);
  127. * @return VOID
  128. */
  129. VOID Hv_Mw_PQ_CM64AxisSetLum(UCHAR8 ucIndex);
  130. /**
  131. * @brief CM64��for CM debug by tool��setting saturation.
  132. * @param[in] ucIndex:index of sat(0-63);
  133. * @return VOID
  134. */
  135. VOID Hv_Mw_PQ_CM64AxisSetSat(UCHAR8 ucIndex);
  136. /**
  137. * @brief CM64��for CM debug by tool��getting saturation.
  138. * @param[in] ucIndex:index of sat(0-63);
  139. * @return value of sat.
  140. */
  141. UCHAR8 Hv_Mw_PQ_Cm64AxisGetSat(UCHAR8 ucIndex);
  142. /**
  143. * @brief CM64��for CM debug by tool��getting luminance.
  144. * @param[in] ucIndex:index of lum(0-63);
  145. * @return value of lum.
  146. */
  147. UCHAR8 Hv_Mw_PQ_Cm64AxisGetLum(UCHAR8 ucIndex);
  148. /**
  149. * @brief CM64��for CM debug by tool��getting hue.
  150. * @param[in] ucIndex:index of hue(0-63);
  151. * @return value of hue.
  152. */
  153. UCHAR8 Hv_Mw_PQ_Cm64AxisGetHue(UCHAR8 ucIndex);
  154. /**
  155. * @brief CSC Init.
  156. * @param[in] puiCscAddr:address of Csc Init bin;
  157. * @param[in] uiLen:address of Init bin;
  158. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  159. */
  160. Status Hv_Mw_PQ_CscInit(const UINT32 *puiCscAddr, UINT32 uiLen);
  161. /**
  162. * @brief CSC config address.
  163. * @param[in] puiMainCscHdb:address of Csc main config;
  164. * @param[in] puiSubCscHdb:address of Csc sub config;
  165. * @return VOID
  166. */
  167. VOID Hv_Mw_PQ_CscConfigAddr(const UINT32 *puiMainCscHdb, const UINT32 *puiSubCscHdb);
  168. /**
  169. * @brief gamma Init.
  170. * @param[in] auiGammabin:address of gamma Init bin;
  171. * @param[in] uiLen:address of Init bin;
  172. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  173. */
  174. Status Hv_Mw_PQ_GammaInit(const UINT32 *puiGammabin, UINT32 uiLen);
  175. /**
  176. * @brief gamma Lut Init.
  177. * @param[in] auiGammalut:default address of gamma lut;
  178. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  179. */
  180. Status Hv_Mw_PQ_GammaLutInit(const UINT32 *puiGammalut);
  181. /**
  182. * @brief osd gamma Lut Init.
  183. * @param[in] puiOsdGmiAddr:default address of gamma lut;
  184. * @param[in] puiOsdGmdAddr:default address of gamma lut;
  185. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  186. */
  187. Status Hv_Mw_PQ_OsdGammaLutInit(const UINT32 *puiOsdGmiAddr, const UINT32 *puiOsdGmdAddr);
  188. /**
  189. * @brief Set different Gamma
  190. * @param[in] ucGammaIndex: index of Gamma lut to be set
  191. * @return VOID
  192. */
  193. VOID Hv_Mw_PQ_SetGamma(UCHAR8 ucGammaIndex);
  194. /**
  195. * @brief Set gamma lut.
  196. * @param[in] pucGamma:address of gamma lut;
  197. * @param[in] usTableSize:size of gamma lut;
  198. * @return VOID
  199. */
  200. VOID Hv_Mw_PQ_SetGammaLut(UCHAR8 *pucGamma, USHORT16 usTableSize);
  201. /**
  202. * @brief sharpness Init.
  203. * @param[in] puiSharpnessbin:address of sharpness Init bin;
  204. * @param[in] uiLen:address of Init bin;
  205. * @param[in] puiSharpnessParam:address of sharpness cfg bin;
  206. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  207. */
  208. Status Hv_Mw_PQ_SharpnessInit(const UINT32 *puiSharpnessbin, UINT32 uiLen, const UINT32 *puiSharpnessParam);
  209. /**
  210. * @brief Sharpness Setting
  211. * @param[in] value of Sharpness
  212. * @return VOID
  213. */
  214. VOID Hv_Mw_PQ_SetSharpness(UCHAR8 ucSharpness);
  215. /**
  216. * @brief sharpness Enable.
  217. * @param[in] bEn:status of sharpness enable;
  218. * @return VOID
  219. */
  220. VOID Hv_Mw_PQ_SharpnessEnable(BOOL bEn);
  221. /**
  222. * @brief local dimming Init.
  223. * @param[in] puiLdcAddr:address of ldc Init bin;
  224. * @param[in] uiLen:address of Init bin;
  225. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  226. */
  227. Status Hv_Mw_PQ_LdcInit(const UINT32 *puiLdcAddr, UINT32 uiLen);
  228. /**
  229. * @brief local dimming Lut Init.
  230. * @param[in] puiLdcLutAddr:default address of ldc lut;
  231. * @param[in] puiBlAddr:address backlight;
  232. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  233. */
  234. Status Hv_Mw_PQ_LdcLutInit(const UINT32 *puiLdcLutAddr, UINT32 *puiBlAddr);
  235. /**
  236. * @brief LocalDimming bypass
  237. * @param[in] bypass:status of ldc bypass
  238. * @return VOID
  239. */
  240. VOID Hv_Mw_PQ_SetLdBypass(BOOL bLdBypass);
  241. /**
  242. * @brief LocalDimming blend pwm
  243. * @param[in] uiPwm:value of pwm
  244. * @return VOID
  245. */
  246. VOID Hv_Mw_PQ_LdcPwmBlend(UINT32 uiPwm);
  247. /**
  248. * @brief set address of three mode lut
  249. * @param[in] pusLdcModeLutBaseAddr:default address of ldc mode lut;
  250. * @return VOID
  251. */
  252. VOID Hv_Mw_PQ_LdcSetModeLutAddr(const USHORT16 *pusLdcModeLutBaseAddr);
  253. /**
  254. * @brief LocalDimming setting mode
  255. * @param[in] ucLdcModeIndx:value of mode
  256. * @param[in] usMaxWeightVal max weight value
  257. * @return VOID
  258. */
  259. VOID Hv_Mw_PQ_LdcSetMode(UCHAR8 ucLdcModeIndex, USHORT16 usMaxWeightVal);
  260. /**
  261. * @brief get global average brightness
  262. * @param[in] None
  263. * @return value of average brightness
  264. */
  265. UINT32 Hv_Mw_PQ_LDCGetGlobalAvgBright(VOID);
  266. /**
  267. * @brief get global max brightness
  268. * @param[in] None
  269. * @return value of max brightness
  270. */
  271. UINT32 Hv_Mw_PQ_LDCGetGlobalMaxBright(VOID);
  272. /**
  273. * @brief Max Backlight setting
  274. * @param[in] value of Backlight
  275. * @return VOID
  276. */
  277. VOID Hv_Mw_PQ_SetMaxBl(UCHAR8 ucMaxBl);
  278. /**
  279. * @brief get ldim address of wdma
  280. * @param[in] ucBlBufId id of dma buffer
  281. * @return address of wdma.
  282. */
  283. UINT32 Hv_Mw_PQ_GetLdimBlBufAddr(UCHAR8 ucBlBufId);
  284. /**
  285. * @brief get Kspi address of rdma
  286. * @param[in] None
  287. * @return address of rdma.
  288. */
  289. UINT32 Hv_Mw_PQ_GetKspiRdmaAddr(VOID);
  290. /**
  291. * @brief set Kspi demo mode
  292. * @param[in] ucDemoMode demo mode of Kspi
  293. * @return VOID
  294. */
  295. VOID Hv_Mw_PQ_SetKspiDemoMode(UCHAR8 ucDemoMode);
  296. /**
  297. * @brief set Kspi demo data
  298. * @param[in] usDemoData demo data of Kspi
  299. * @return VOID
  300. */
  301. VOID Hv_Mw_PQ_SetKspiDemoData(USHORT16 usDemoData);
  302. /**
  303. * @brief set Kspi data length
  304. * @param[in] usDataLen length of Kspi data
  305. * @return VOID
  306. */
  307. VOID Hv_Mw_PQ_SetKspiDataLen(USHORT16 usDataLen);
  308. /**
  309. * @brief set Kspi header
  310. * @param[in] ucCh channel of spi
  311. * @param[in] ucHeaderNum number of header
  312. * @param[in] pusHeadrData point of head data
  313. * @return VOID
  314. */
  315. VOID Hv_Mw_PQ_SetKspiHeader(UCHAR8 ucCh, UCHAR8 ucHeaderNum, USHORT16 *pusHeadrData);
  316. /**
  317. * @brief set Kspi tail
  318. * @param[in] ucCh channel of spi
  319. * @param[in] ucTailNum number of tail
  320. * @param[in] pusTailData point of tail data
  321. * @return VOID
  322. */
  323. VOID Hv_Mw_PQ_SetKspiTail(UCHAR8 ucCh, UCHAR8 ucTailNum, USHORT16 *pusTailData);
  324. /**
  325. * @brief Kspi hard crc enable
  326. * @param[in] ucHardCrcEn enable of hard crc
  327. * @return VOID
  328. */
  329. VOID Hv_Mw_PQ_KspiHardCrcEn(UCHAR8 ucHardCrcEn);
  330. /**
  331. * @brief Kspi software mode enable
  332. * @param[in] ucSwModeEn enable of software mode
  333. * @return VOID
  334. */
  335. VOID Hv_Mw_PQ_KspiSwModeEn(UCHAR8 ucSwModeEn);
  336. /**
  337. * @brief global contrast Init.
  338. * @param[in] puiGcAddr:address of ldc init bin;
  339. * @param[in] uiLen:length of ldc init bin;
  340. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  341. */
  342. Status Hv_Mw_PQ_GcInit(const UINT32 *puiGcAddr, UINT32 uiLen);
  343. /**
  344. * @brief global contrast Lut Init.
  345. * @param[in] puiGcLutAddr:default address of gc lut;
  346. * @param[in] puiGcLutAddr1:current address of gc lut;
  347. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  348. */
  349. Status Hv_Mw_PQ_GcLutInit(const UINT32 *puiGcLutAddr, UINT32 *puiGcLutAddr1);
  350. /**
  351. * @brief global contrast mode setting.
  352. * @param[in] ucGcMode:gc mode;
  353. * @param[in] ucCurBlkSta:;
  354. * @return VOID
  355. */
  356. VOID Hv_Mw_PQ_GcModeSwitch(UCHAR8 ucGcMode, UCHAR8 ucCurBlkSta);
  357. /**
  358. * @brief GC Enable.
  359. * @param[in] bEn:status of GC enable;
  360. * @return VOID
  361. */
  362. VOID Hv_Mw_PQ_GCEnable(BOOL bEn);
  363. /**
  364. * @brief set gc DarkStabilizer direction.
  365. * @param[in] ucDir:direction of DarkStabilizer;
  366. * @return VOID
  367. */
  368. VOID Hv_Mw_PQ_GCSetDarkStaDir(UCHAR8 ucDir);
  369. /**
  370. * @brief HDR Init.
  371. * @param[in] puiHdrAddr1:address of ldc init bin;
  372. * @param[in] ucHdrIdx:channel of HDR;
  373. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  374. */
  375. Status Hv_Mw_PQ_HdrInit(const UINT32 *puiHdrAddr1, UCHAR8 ucHdrIdx);
  376. /**
  377. * @brief Get HDR Enable Flag
  378. * @param[in] ucCh:channel of HDR;
  379. * @return Hdr Enable Status
  380. */
  381. VOID Hv_Mw_PQ_SetHDREnableFlag(UCHAR8 ucCh, UCHAR8 ucHDREn);
  382. /**
  383. * @brief Get HDR Enable.
  384. * @param[in] ucCh:channel of HDR;
  385. * @return Hdr Enable Status
  386. */
  387. UCHAR8 Hv_Mw_PQ_GetHDREnable(UCHAR8 ucCh);
  388. /**
  389. * @brief HDR Enable.
  390. * @param[in] ucCh:channel of HDR;
  391. * @param[in] ucHDREn:status of HDR enable;
  392. * @return VOID
  393. */
  394. VOID Hv_Mw_PQ_HDREnable(UCHAR8 ucCh, UCHAR8 ucHDREn);
  395. /**
  396. * @brief set HDR mode.
  397. * @param[in] ucCh:id of channel;
  398. * @param[in] ucHdrModel:HDR mode;
  399. * @param[in] pstHdrParam:HdrParam;
  400. * @return VOID
  401. */
  402. VOID Hv_Mw_PQ_SetHdrMode(UCHAR8 ucCh, UCHAR8 ucHdrModel, const HDRParam* pstHdrParam);
  403. /**
  404. * @brief Hdr Tonemapping Init
  405. * @param[in] ucMapType:Mapping Type
  406. * @param[in] uiMapLutAddr:Lut Addr if Type is Lut
  407. * @return VOID
  408. */
  409. VOID Hv_Mw_PQ_HdrSetMappingInit(UCHAR8 ucMapType, UINT32 uiMapLutAddr);
  410. /**
  411. * @brief set GetRGB
  412. * @param[in] ucPstX:position x;
  413. * @param[in] ucPstY:position x;
  414. * @param[in] pucRed:red info;
  415. * @param[in] pucGreen:green info;
  416. * @param[in] pucBlue:blue info;
  417. * @return VOID
  418. */
  419. VOID Hv_Mw_PQ_GetBlkAvg(USHORT16 ucPstX, USHORT16 ucPstY, UCHAR8 *pucRed, UCHAR8 *pucGreen, UCHAR8 *pucBlue);
  420. /**
  421. * @brief wcg Init.
  422. * @param[in] puiWcgAddr:address of wcg init bin;
  423. * @param[in] uiLen:length of wcg init bin;
  424. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  425. */
  426. Status Hv_Mw_PQ_WcgInit(const UINT32 *puiWcgAddr, UINT32 uiLen);
  427. /**
  428. * @brief wcg Enable.
  429. * @param[in] ucWcgEn:status of wcg enable;
  430. * @return VOID
  431. */
  432. VOID Hv_Mw_PQ_WcgEnable(UCHAR8 ucWcgEn);
  433. /**
  434. * @brief wcg Lut Init.
  435. * @param[in] puiGmiAddr:default address of gmi lut;
  436. * @param[in] puiRgbAddr:current address of rgb lut;
  437. * @param[in] puiGmdAddr:default address of gmd lut;
  438. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  439. */
  440. Status Hv_Mw_PQ_WcgLutInit(const UINT32 *puiGmiAddr, const UINT32 *puiRgbAddr, const UINT32 *puiGmdAddr);
  441. /**
  442. * @brief load wcg rgb Lut.
  443. * @param[in] puiRgbAddr:address of wcg rgb lut;
  444. * @return VOID
  445. */
  446. VOID Hv_Mw_PQ_LoadWCGLUT(const UINT32 *puiRgbAddr);
  447. /**
  448. * @brief Enable WCG cm func.
  449. * @param[in] None;
  450. * @return None.
  451. */
  452. VOID Hv_Mw_PQ_SetWCGLutEnable(VOID);
  453. /**
  454. * @brief Enable Gamut setting
  455. * @param[in] Index of Gamut
  456. * @return None
  457. */
  458. VOID Hv_Mw_PQ_SetGamutEnable(VOID);
  459. /**
  460. * @brief Gamut settting
  461. * @param[in] psGamut paras of Gamut
  462. * @return None
  463. */
  464. VOID Hv_Mw_PQ_SetGamutParam(const GamutSet *psGamut);
  465. /**
  466. * @brief Gamut offset settting
  467. * @param[in] psGamut paras of Gamut
  468. * @return None
  469. */
  470. VOID Hv_Mw_PQ_SetGamutOffset(const GamutOffset *pstOffset);
  471. /**
  472. * @brief setting native Gamut
  473. * @param[in] psGamut paras of Gamut
  474. * @return VOID
  475. */
  476. VOID Hv_Mw_PQ_SetGamutNative();
  477. /**
  478. * @brief setting Gamut in factory mode
  479. * @param[in] stGamut paras of Gamut
  480. * @return VOID
  481. */
  482. VOID Hv_Mw_PQ_SetGamutFac(GamutSet *stGamut);
  483. /**
  484. * @brief Contrast set
  485. * @param[in] ucCh:id of channel
  486. * @param[in] uiContrast:value of contrast
  487. * @return VOID
  488. */
  489. VOID Hv_Mw_PQ_SetContrast(UCHAR8 ucCh, UINT32 uiContrast);
  490. /**
  491. * @brief RGB Gain settting in factory mode
  492. * @param[in] ucCh id of channel
  493. * @param[in] Value of R,G,B Gain
  494. * @return VOID
  495. */
  496. VOID Hv_Mw_PQ_SetRGBGainFac(UCHAR8 ucCh, USHORT16 usRed, USHORT16 usGreen, USHORT16 usBlue);
  497. /**
  498. * @brief RGB Gain settting
  499. * @param[in] ucCh id of channel
  500. * @param[in] Value of R,G,B Gain
  501. * @return VOID
  502. */
  503. VOID Hv_Mw_PQ_SetRGBGain(UCHAR8 ucCh, USHORT16 usRed, USHORT16 usGreen, USHORT16 usBlue);
  504. /**
  505. * @brief RGB offset settting
  506. * @param[in] ucCh id of channel
  507. * @param[in] Value of R,G,B offset
  508. * @return VOID
  509. */
  510. VOID Hv_Mw_PQ_SetRGBOffset(UCHAR8 ucCh, USHORT16 usRed, USHORT16 usGreen, USHORT16 usBlue);
  511. /**
  512. * @brief get R Gain
  513. * @param[in] None
  514. * @return value of R Gain.
  515. */
  516. UCHAR8 Hv_Mw_PQ_GetRGain(VOID);
  517. /**
  518. * @brief get Green Gain
  519. * @param[in] None
  520. * @return value of Green Gain.
  521. */
  522. UCHAR8 Hv_Mw_PQ_GetGGain(VOID);
  523. /**
  524. * @brief get blue Gain
  525. * @param[in] None
  526. * @return value of blue Gain.
  527. */
  528. UCHAR8 Hv_Mw_PQ_GetBGain(VOID);
  529. /**
  530. * @brief Black Level set
  531. * @param[in] ucCh id of channel
  532. * @param[in] ucBlackLevel value of BlackLevel
  533. * @return VOID
  534. */
  535. VOID Hv_Mw_PQ_SetBlackLevel(UCHAR8 ucCh, USHORT16 usBlackLevel);
  536. /**
  537. * @brief Saturation set
  538. * @param[in] ucCh id of channel
  539. * @param[in] ucSaturation value of ucSaturation
  540. * @return VOID
  541. */
  542. VOID Hv_Mw_PQ_SetSaturation(UCHAR8 ucCh, UCHAR8 ucSaturation);
  543. /**
  544. * @brief Hue set
  545. * @param[in] ucCh id of channel
  546. * @param[in] ucHue value of ucHue
  547. * @return VOID
  548. */
  549. VOID Hv_Mw_PQ_SetHue(UCHAR8 ucCh, UCHAR8 ucHue);
  550. /**
  551. * @brief BrightRange set
  552. * @param[in] ucCh id of channel
  553. * @param[in] enRange value of BrightRange
  554. * @return VOID
  555. */
  556. VOID Hv_Mw_PQ_SetBrightRange(UCHAR8 ucCh, PQBrightRange enRange);
  557. /**
  558. * @brief ColorSpace set
  559. * @param[in] ucCh id of channel
  560. * @param[in] enColorSpace value of colorSpace
  561. * @return VOID
  562. */
  563. VOID Hv_Mw_PQ_SetColorSpace(UCHAR8 ucCh, PQColorSpace enColorSpace);
  564. /**
  565. * @brief get Saturation
  566. * @param[in] None
  567. * @return value of saturation.
  568. */
  569. UCHAR8 Hv_Mw_PQ_GetSaturation(VOID);
  570. /**
  571. * @brief get Contrast from Database
  572. * @param[in] None
  573. * @return value of contrast.
  574. */
  575. UCHAR8 Hv_Mw_PQ_GetContrastDB(VOID);
  576. /**
  577. * @brief get Hue
  578. * @param[in] None
  579. * @return value of hue.
  580. */
  581. UCHAR8 Hv_Mw_PQ_GetHue(VOID);
  582. /**
  583. * @brief scaler Lut Init.
  584. * @param[in] puiScalerAddr:address of scaler lut;
  585. * @return Status , 0-HV_SUCCESS, 1-HV_FAILURE.
  586. */
  587. Status Hv_Mw_PQ_ScalerUpLutInit(const UINT32 *puiScalerAddr);
  588. /**
  589. * @brief dither Init.
  590. * @param[in] puiDitherAddr:address of dither init bin;
  591. * @param[in] uiLen:length of puiDitherAddr;
  592. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  593. */
  594. Status Hv_Mw_PQ_DitherInit(const UINT32 *puiDitherAddr, UINT32 uiLen);
  595. /**
  596. * @brief Brightness set
  597. * @param[in] usBrightness value of Brightness
  598. * @return VOID
  599. */
  600. VOID Hv_Mw_PQ_SetBrightness(USHORT16 usBrightness);
  601. /**
  602. * @brief switch HDR and SDR
  603. * @param[in] uiValue status of HDR
  604. * @return VOID
  605. */
  606. VOID Hv_Mw_PQ_SetHdrSwitch(UINT32 uiValue);
  607. /**
  608. * @brief set PQ dma latch mode (active when vsync isr)
  609. * @param[in] None
  610. * @return None.
  611. */
  612. VOID Hv_Mw_PQ_DmaSetlatch(VOID);
  613. /**
  614. * @brief PQ dma workaround
  615. * @param[in] None
  616. * @return None.
  617. */
  618. VOID Hv_Mw_PQ_DmaWorkaround(VOID);
  619. /**
  620. * @brief set PWM duty
  621. * @param[in] usHigh value of PWM
  622. * @return VOID
  623. */
  624. VOID Hv_Mw_PQ_SetPwmDuty(USHORT16 usHigh);
  625. /**
  626. * @brief Get dynamic backlight PWM
  627. * @param[in] None
  628. * @return value of PWM
  629. */
  630. UCHAR8 Hv_Mw_PQ_GetPicPWM(VOID);
  631. /**
  632. * @brief Display Control module init, includes od,gamma,framerate det,...
  633. * @param[in] pstDispCtlCfg - config display ctrl lut addr
  634. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  635. */
  636. Status Hv_Mw_PQ_DispCtrlInit(const DispCtrlCfg *pstDispCtlCfg);
  637. /**
  638. * @brief Set display control od level.
  639. * @param[in] ucODLevel, 0 always is off.
  640. * @return VOID
  641. */
  642. VOID Hv_Mw_PQ_SetODLevel(UCHAR8 ucODLevel);
  643. /**
  644. * @brief Only write OD table
  645. * @param[in] pucOdTable Pointer of od lut table.
  646. * @param[in] usTableSize Length of od lut table.
  647. * @param[in] ucWhichLut Indicates lut0 or lut1.
  648. * @return Status, 0-HV_SUCCESS, 1-HV_FAILURE.
  649. */
  650. Status Hv_Mw_PQ_SetODTable(UCHAR8 *pucOdTable, USHORT16 usTableSize, UCHAR8 ucWhichLut);
  651. /**
  652. * @brief 给OSD使用的接口,由OSD自行决定是否要关闭OD。
  653. * @detail因为OSD Rotation与OD公用DDR,所以在打开OSD时需要关闭OD。
  654. * OSD开----需要关闭OD----Y---->置标志&关OD(此时调整OD选项并不能立即看到效果)------>退出OSD时根据菜单中选项来恢复OD
  655. * |--------N---->无需控制OD(此时调整OD选项能立即看到效果,在调整OD菜单选项时要判断OD是否受OSD控制了)
  656. * @param[in] bControl, HV_TRUE-OSD关闭OD, HV_FALSE-OSD恢复OD
  657. * @return None
  658. */
  659. VOID Hv_Mw_PQ_OsdControlOdOff(BOOL bControl);
  660. /**
  661. * @brief set Gamma level
  662. * @param[in] ucGammaLevel
  663. * @return VOID
  664. */
  665. VOID Hv_Mw_PQ_SetGammaLevel(UCHAR8 ucGammaLevel);
  666. /**
  667. * @brief set OSD gamma level
  668. * @param[in] ucGammaLevel
  669. * @return VOID
  670. */
  671. VOID Hv_Mw_PQ_SetOsdGammaLevel(UCHAR8 ucGammaLevel);
  672. /**
  673. * @brief set Demura level
  674. * @param[in] ucDemuraLevel
  675. * @return VOID
  676. */
  677. VOID Hv_Mw_PQ_SetDemuraLevel(UCHAR8 ucDemuraLevel);
  678. UCHAR8 Hv_Mw_PQ_GetDemuraCrcFlag(void);
  679. /**
  680. * @brief Get dynamic backlight
  681. * @param[in] None
  682. * @return Status of DynamicBL
  683. */
  684. UCHAR8 Hv_Mw_PQ_GetDynamicBLEn();
  685. /**
  686. * @brief enable dynamic backlight
  687. * @param[in] ucEn:status of enable
  688. * @return VOID
  689. */
  690. VOID Hv_Mw_PQ_DynamicBLEn(UCHAR8 ucEn);
  691. /**
  692. * @brief get HDR pattern information
  693. * @param[in] None
  694. * @return info of HDR pattern.
  695. */
  696. UCHAR8 Hv_Mw_PQ_GetPattern();
  697. #if (HV_PROJECT_CONFIG_AMBILIGHT == HV_CONFIG_ON)
  698. /**
  699. * @brief init of crosshair
  700. * @param[in] None
  701. * @return None.
  702. */
  703. VOID Hv_Mw_PQ_CrosshairInit(VOID);
  704. /**
  705. * @brief Enable crosshair
  706. * @param[in] bEnable:enable status of crosshair
  707. * @return None.
  708. */
  709. VOID Hv_Mw_PQ_CrosshairEnable(BOOL bEnable);
  710. /**
  711. * @brief set crosshair area
  712. * @param[in] pstArea:position info of crosshair
  713. * @return None.
  714. */
  715. VOID Hv_Mw_PQ_CrosshairSetArea(CrosshairArea *pstArea);
  716. /**
  717. * @brief get crosshair color info
  718. * @param[in] pstValue:color info of crosshair
  719. * @return None.
  720. */
  721. VOID Hv_Mw_PQ_CrosshairGetRGBY(CrosshairRGBY *pstValue);
  722. #endif
  723. /**
  724. * @brief CM change Lut
  725. * @param[in] uiLutAddr: addr of lut
  726. * @return VOID
  727. */
  728. VOID Hv_Mw_PQ_CMChangeLut(UINT32 uiLutAddr);
  729. VOID Hv_Mw_PQ_SetInpColor(USHORT16 usRed, USHORT16 usGreen, USHORT16 usBlue);
  730. VOID Hv_Mw_PQ_SetInpPattEn(UCHAR8 ucEn);
  731. VOID Hv_Mw_PQ_SetInpPatt(UCHAR8 ucPattSwitch, UCHAR8 ucPatternMode);
  732. #if (HV_CONFIG_ON == HV_PROJECT_CONFIG_AMBIENT_LIGHT)
  733. VOID Hv_Mw_PQ_UpdateFollowingPQ(VOID* pvArgument, USHORT16 usTimerId);
  734. VOID Hv_Mw_PQ_StartFollowingPQ(VOID);
  735. VOID Hv_Mw_PQ_StopFollowingPQ(VOID);
  736. VOID Hv_Mw_PQ_UpdateSingleColor(UCHAR8 ucColorType);
  737. VOID Hv_Mw_PQ_UpdateAutoColor(VOID* pvArgument, USHORT16 usTimerId);
  738. VOID Hv_Mw_PQ_StartAutoColor(VOID);
  739. VOID Hv_Mw_PQ_StopAutoColor(VOID);
  740. VOID Hv_Mw_PQ_UpdateMarqueeColor(VOID* pvArgument, USHORT16 usTimerId);
  741. VOID Hv_Mw_PQ_StartMarqueeColor(VOID);
  742. VOID Hv_Mw_PQ_StopMarqueeColor(VOID);
  743. VOID Hv_Mw_PQ_BulbInit(VOID);
  744. VOID Hv_Mw_PQ_BulbDeInit(VOID);
  745. VOID Hv_Mw_PQ_StartAmbilightTimer(UINT32 uiTimeoutMs);
  746. VOID Hv_Mw_PQ_StopAmbilightTimer(VOID);
  747. VOID Hv_Mw_PQ_StartAutoTimer(UINT32 uiTimeoutMs);
  748. VOID Hv_Mw_PQ_StopAutoTimer(VOID);
  749. VOID Hv_Mw_PQ_StartMarqueeTimer(UINT32 uiTimeoutMs);
  750. VOID Hv_Mw_PQ_StopMarqueeTimer(VOID);
  751. #endif
  752. /**
  753. * @brief Kspi send data in software mode
  754. * @param[in] ucCh channel of spi
  755. * @param[in] puiData point of data
  756. * @param[in] uiLength length of 32bit data
  757. * @return None.
  758. */
  759. VOID Hv_Mw_PQ_KspiSwSendData(UCHAR8 ucCh, UINT32* puiData, UINT32 uiLength);
  760. /**
  761. * @brief Kspi send data init before copying data to sram
  762. * @param[in] None
  763. * @return None.
  764. */
  765. VOID Hv_Mw_PQ_KspiSwSendDataInit(VOID);
  766. /**
  767. * @brief start Kspi sending in software mode
  768. * @param[in] none
  769. * @return None.
  770. */
  771. VOID Hv_Mw_PQ_KspiSwSendDataStart(VOID);
  772. /**
  773. * @brief Set ldc spf curve
  774. * @param[in] ucY0 value of y0
  775. * @param[in] ucY1 value of y1
  776. * @return None.
  777. */
  778. VOID Hv_Mw_PQ_LdcSetCurveY(UCHAR8 ucY0, UCHAR8 ucY1);
  779. VOID Hv_Mw_PQ_PatDetInit(USHORT16 ** puiArray, UCHAR8 ucPatNum, UCHAR8 ucPatW, UCHAR8 ucPatH);
  780. VOID Hv_Mw_PQ_GammaEnable(BOOL bEn);
  781. VOID Hv_Mw_PQ_ColorEnable(BOOL bEn);
  782. USHORT16 Hv_Mw_PQ_GetBlackLevel(UCHAR8 ucCh);
  783. USHORT16 Hv_Mw_PQ_GetContrast(UCHAR8 ucCh);
  784. VOID Hv_Mw_PQ_LDCPrintPattern();
  785. VOID Hv_Hv_Mw_Video_SetBrightFrameBrightness(USHORT16 usBrightness);
  786. USHORT16 Hv_Mw_Video_GetBrightFrameBrightness(VOID);
  787. VOID Hv_Mw_Video_SetBrightFrameContrast(USHORT16 usContrast);
  788. USHORT16 Hv_Mw_Video_GetBrightFrameContrast(VOID);
  789. VOID Hv_Mw_PQ_SetSharpnessReverse(UCHAR8 ucSharpness);
  790. VOID Hv_Mw_PQ_SetHdrGmiLut(UCHAR8 ucHdrIdx, UINT32 uiHdrGmiLutAddr);
  791. VOID Hv_Mw_PQ_LDCPrintSumDiff();
  792. VOID Hv_Mw_PQ_LDCSetPatThr(UINT32 usThr);
  793. VOID Hv_Mw_PQ_MhiInit();
  794. VOID Hv_Mw_MhiSetPos(USHORT16 usStartX, USHORT16 usStartY, USHORT16 usWidth, USHORT16 usHeight);
  795. UINT32* Hv_Mw_PQ_GetMhi16();
  796. VOID Hv_Mw_PQ_PWM(VOID);
  797. #endif