drv_picx.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /******************************************************************************/
  2. /**
  3. *
  4. * @file drv_picx.h
  5. *
  6. * @brief This file specifies the APIs provided to control PICX(Display Fetch)
  7. *
  8. * @note Copyright (c) 2013 S2 Technology Co., Ltd. \n
  9. * All rights reserved.
  10. *
  11. * @author
  12. *
  13. ******************************************************************************/
  14. #ifndef __DRV_PICX_H__
  15. #define __DRV_PICX_H__
  16. /*******************************************************************************
  17. * Header include
  18. ******************************************************************************/
  19. #include "drv_types.h"
  20. #include "drv_pq_external.h"
  21. typedef enum _DRV_PICX_FLIP_TYPE
  22. {
  23. ePICX_FLIP_TYPE_HORIZONTAL = 0,
  24. ePICX_FLIP_TYPE_VERTICAL,
  25. } DRV_PICX_FLIP_TYPE;
  26. typedef enum _DRV_PICX_DATA_TYPE
  27. {
  28. ePICX_DATA_TYPE_Y = 0,
  29. ePICX_DATA_TYPE_Y8,
  30. ePICX_DATA_TYPE_UV,
  31. ePICX_DATA_TYPE_UV8,
  32. ePICX_DATA_TYPE_MO,
  33. ePICX_DATA_TYPE_MBW,
  34. } DRV_PICX_DATA_TYPE;
  35. typedef enum _DRV_PICX_FRAME_START_ADDRESS
  36. {
  37. ePICX_FRAME_0_START = 0,
  38. ePICX_FRAME_1_START,
  39. ePICX_FRAME_2_START,
  40. ePICX_FRAME_3_START,
  41. } DRV_PICX_FRAME_START_ADDRESS;
  42. typedef enum _DRV_PICX_SKIP_N_LINES
  43. {
  44. ePICX_SKIP_NONE = 0,
  45. ePICX_SKIP_1_LINE = 1,
  46. ePICX_SKIP_3_LINES = 2,
  47. ePICX_SKIP_7_LINES = 3,
  48. } DRV_PICX_SKIP_N_LINES;
  49. typedef enum _DRV_PICX_REGISTER_UPDATE_MODE
  50. {
  51. ePICX_REGISTER_UPDATE_MODE_0 = 0,
  52. ePICX_REGISTER_UPDATE_MODE_1 = 1,
  53. } DRV_PICX_REGISTER_UPDATE_MODE;
  54. /*
  55. typedef enum _DRV_PICX_RGB_COLOR_FORMAT
  56. {
  57. ePICX_RGB_COLOR_FORMAT_DISABLED = 0,
  58. ePICX_RGB_COLOR_FORMAT_RGB888 = 1,
  59. ePICX_RGB_COLOR_FORMAT_ARGB888 = 2,
  60. ePICX_RGB_COLOR_FORMAT_RGB565 = 3,
  61. } DRV_PICX_RGB_COLOR_FORMAT;
  62. */
  63. typedef enum _DRV_PICX_FETCH_PRIORITY
  64. {
  65. ePICX_FETCH_PRIORITY_NORMAL = 0,
  66. ePICX_FETCH_PRIORITY_LOW = 1,
  67. } DRV_PICX_FETCH_PRIORITY;
  68. typedef enum _DRV_PICX_DFM
  69. {
  70. ePICX_DFM_VIDEO = 0, /* 24/25/30/50/60hz inputs */
  71. ePICX_DFM_PC = 1, /* > 60hz, need to be progressive */
  72. } DRV_PICX_DFM;
  73. typedef enum _DRV_PICX_3D_RGB_ORDER
  74. {
  75. ePICX_3D_RGB_ORDER_NORMAL = 0,
  76. ePICX_3D_RGB_ORDER_R_B_SWAP = 1, /* inverse rgb order (r and b swapped, for imagination GPU core) */
  77. } DRV_PICX_3D_RGB_ORDER;
  78. typedef enum _DRV_PICX_YCBCR_RANGE
  79. {
  80. ePICX_YCBCR_255=0,
  81. ePICX_YCBCR_235,
  82. ePICX_YCBCR_NONE,
  83. } DRV_PICX_YCBCR_RANGE;
  84. void DRV_PICX_Reset(BOOL fEnable);
  85. void DRV_PICX_ReadEn(BOOL fEnable);
  86. void DRV_PICX_EnableFlip(DRV_PICX_FLIP_TYPE eType, UINT8 fEnable);
  87. BOOL DRV_PICX_IsFlipEnabled(DRV_PICX_FLIP_TYPE eType);
  88. #if (CONFIG_CHIPID == 0x330)
  89. void DRV_PICX_SetFrameStartAddress(DRV_PICX_DATA_TYPE eType, DRV_PICX_FRAME_START_ADDRESS eFrameStart, UINT32 Value);
  90. #else
  91. void DRV_PICX_SetFrameStartAddress(DRV_PICX_FRAME_START_ADDRESS eFrameStart, UINT32 Value);
  92. #endif
  93. void DRV_PICX_SetPackWidth(UINT32 Value);
  94. void DRV_PICX_SetLines(UINT32 Value);
  95. void DRV_PICX_SetOffset(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  96. void DRV_PICX_SetSize(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  97. UINT32 DRV_PICX_GetSize(DRV_PICX_DATA_TYPE eType);
  98. void DRV_PICX_SetYWordOffset(UINT32 Value);
  99. UINT32 DRV_PICX_GetYWordOffset(void);
  100. void DRV_PICX_SetY4bitOffset(UINT32 Value);
  101. UINT32 DRV_PICX_GetY4bitOffset(void);
  102. void DRV_PICX_SetUVWordOffset(UINT32 Value);
  103. UINT32 DRV_PICX_GetUVWordOffset(void);
  104. void DRV_PICX_SetUV4bitOffset(UINT32 Value);
  105. UINT32 DRV_PICX_GetUV4bitOffset(void);
  106. void DRV_PICX_SetMOWordOffset(UINT32 Value);
  107. UINT32 DRV_PICX_GetMOWordOffset(void);
  108. void DRV_PICX_SetMO2bitOffset(UINT32 Value);
  109. UINT32 DRV_PICX_GetMO2bitOffset(void);
  110. //void DRV_PICX_SetMOHalf(BOOL fFlag);
  111. void DRV_PICX_SetMBWLines(UINT32 Value);
  112. void DRV_PICX_SetMBWWordOffset(UINT32 Value);
  113. UINT32 DRV_PICX_GetMBWWordOffset(void);
  114. void DRV_PICX_SetMBW2bitOffset(UINT32 Value);
  115. UINT32 DRV_PICX_GetMBW2bitOffset(void);
  116. void DRV_PICX_SetMBWPackWidth(UINT32 Value);
  117. UINT32 DRV_PICX_GetMBWPackWidth(void);
  118. void DRV_PICX_EnableMBWRead(BOOL fEnable);
  119. //void DRV_PICX_SetMBWxxx(UINT32 Value);
  120. void DRV_PICX_SetRegisterUpdateMode(DRV_PICX_REGISTER_UPDATE_MODE eMode);
  121. //void DRV_PICX_SetRGBColorFormat(DRV_PICX_RGB_COLOR_FORMAT eFormat);
  122. void DRV_PICX_SetFrameBufferIndex(UINT8 Index);
  123. void DRV_PICX_SetFetchPriority(DRV_PICX_FETCH_PRIORITY ePriority);
  124. void DRV_PICX_SetDFM(DRV_PICX_DFM eDFM);
  125. void DRV_PICX_SetDataPipeDelay(UINT32 PixelClockCycleTime);
  126. void DRV_PICX_SkipLinesInMemory(DRV_PICX_SKIP_N_LINES eSelect);
  127. UINT32 DRV_PICX_GetSkipLinesInMemory(void);
  128. void DRV_PICX_EnableInterlaceAddressingMode(BOOL fEnable);
  129. void DRV_PICX_SetBurstOffset(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  130. UINT32 DRV_PICX_GetBurstOffset(DRV_PICX_DATA_TYPE eType);
  131. void DRV_PICX_SetLastNumber(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  132. void DRV_PICX_Set3DRGBOrder(DRV_PICX_3D_RGB_ORDER eOrder);
  133. void DRV_PICX_Enable3DInterleaving(BOOL fEnable);
  134. void DRV_PICX_Split3DLeftRight(BOOL fEnable);
  135. void DRV_PICX_Swap3DLeftRight(BOOL fEnable);
  136. void DRV_PICX_Set3DYWordOffset(UINT32 Value);
  137. void DRV_PICX_Set3DY4bitOffset(UINT32 Value);
  138. void DRV_PICX_Set3DUVWordOffset(UINT32 Value);
  139. void DRV_PICX_Set3DUV4bitOffset(UINT32 Value);
  140. void DRV_PICX_Set3DMOWordOffset(UINT32 Value);
  141. void DRV_PICX_Set3DMO2bitOffset(UINT32 Value);
  142. void DRV_PICX_Set3DMBWWordOffset(UINT32 Value);
  143. void DRV_PICX_Set3DMBW2bitOffset(UINT32 Value);
  144. void DRV_PICX_SetSkipFirstLine_UV(UINT32 Value);
  145. void DRV_PICX_Set3DSideBySideSize(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  146. void DRV_PICX_Set3DSideBySideBurst(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  147. void DRV_PICX_Set3DFrameBurst(DRV_PICX_DATA_TYPE eType, UINT32 Value);
  148. void DRV_PICX_SetY8bit(BOOL fEnable);
  149. void DRV_PICX_SetSelVDI (BOOL fEnable);
  150. void DRV_PICX_SetPreFetch_Enable(BOOL fEnable);
  151. /**
  152. * @brief Set Picx Memory control.
  153. *
  154. * This function setup PICX sram control method, decide if release time slot for other channel
  155. *
  156. * @param uEnable : value 0 mean as previous design(occupy time slot even not access sram anymore)
  157. * ,1 for release time slot for other channel
  158. * @return : n/a
  159. */
  160. void DRV_PICX_SetMifOpt(BOOL uEnable);
  161. /**
  162. * @brief PIP set RGB value have a nominal range of 0-255 or 16-235.
  163. *
  164. * This function setup PICX set RGB value with nominal range of 0-255 or 16-235, mostly used in JPEG source, apply the nominal range
  165. * while load data from memory.
  166. *
  167. * @param eRange : value 0 (ePICX_YCBCR_255) : set RGB range as 0-255, value 1 (ePICX_YCBCR_235) : set RGB range as 16-235
  168. * @return : n/a
  169. */
  170. void DRV_PICX_SetRGB2YCbCrRange(DRV_PICX_YCBCR_RANGE eRange);
  171. /**
  172. * @brief Control PICX RGB to YCbCr matrix reference HW orignal 601 matrix or SW setting
  173. *
  174. * This function control PICX RGB to YCbCr matrix, if PICX read data from memory, and data format is RGB, enable the Matrix convert RGB data to YCbCr
  175. *
  176. * @param uEnable : value 0 mean convert by 601 matrix(HW orignal design), 1 mean PIP matrix will reference PICX_RGB2YCBCR_MAT_A11 ~ PICX_RGB2YCBCR_MAT_A34 setting
  177. *
  178. * @return : n/a
  179. */
  180. void DRV_PICX_SetRGB2YCbCrMatrixOpt(BOOL uEnable);
  181. /**
  182. * @brief Set parameter to the RGB to YCbCr matrix in PIP
  183. *
  184. * This function set parameter to the RGB to YCbCr matrix in PIP, mostly applied in the JPEG source with RGB color space
  185. *
  186. * @param matrix coefficient
  187. *
  188. * @return : n/a
  189. */
  190. void DRV_PICX_SetMatrix(CSC_SETTING* pRGB2YCCMatrix);
  191. #endif