pq_ioctl.h 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. #ifndef _PQ_IOCTL_H_
  2. #define _PQ_IOCTL_H_
  3. #include "drv_pq_external.h"
  4. /******************************************************************************
  5. * @ brief input source mapping to PQ input type : CVD2, Video, Others
  6. * @ CVD2 input type : ATV, AV, SV
  7. * @ Video input type : YPbPr, HDMI, DTV, BLT type(MEDIA, Android)
  8. * @ Other input type : PC, DVI
  9. * @ note : this kind input index should be only used in PQ setting
  10. ******************************************************************************/
  11. //input source type only for PQ
  12. typedef enum _PIC_InputIndex_ByType{
  13. PIC_InputIdxByType_Start,
  14. PIC_InputIdxByType_ATV = PIC_InputIdxByType_Start,
  15. PIC_InputIdxByType_DTV,
  16. PIC_InputIdxByType_AV,
  17. PIC_InputIdxByType_SV,
  18. PIC_InputIdxByType_COMPONENT,
  19. PIC_InputIdxByType_HDMI,
  20. PIC_InputIdxByType_DVI,
  21. PIC_InputIdxByType_PC,
  22. PIC_InputIdxByType_ANDROID_MEDIA,
  23. PIC_InputIdxByType_MAX,// 9
  24. }PIC_InputIndex_ByType;
  25. typedef enum _PQSrcMainType{
  26. PicColorSrc_Start,
  27. PicColorSrc_CVD2=PicColorSrc_Start,
  28. PicColorSrc_Video,
  29. PicColorSrc_Other,
  30. PicColorSrc_End
  31. }PQSrcMainType;
  32. // input type index for pic color (Video type)
  33. typedef enum _PicSrcVideo{
  34. PicSrcVideo_Start,
  35. PicSrcVideo_YPbPr = PicSrcVideo_Start,
  36. PicSrcVideo_HDMI,
  37. PicSrcVideo_DTV,
  38. PicSrcVideo_ANDROID_MEDIA,
  39. PicSrcVideo_End
  40. }PicSrcVideo;
  41. // input type index for color temp-Video type
  42. //yPbPr colortemp need set by resolution level(SD, MD and HD)
  43. typedef enum _PicColorTempSrcVideo{
  44. PicColorTempSrcVideo_Start,
  45. PicColorTempSrcVideo_YPbPr_SD = PicSrcVideo_Start,
  46. PicColorTempSrcVideo_YPbPr_MD,
  47. PicColorTempSrcVideo_YPbPr_HD,
  48. PicColorTempSrcVideo_HDMI,
  49. PicColorTempSrcVideo_DTV,
  50. PicColorTempSrcVideo_ANDROID_MEDIA,
  51. PicColorTempSrcVideo_End
  52. }PicColorTempSrcVideo;
  53. typedef enum _PicResource{
  54. PicResource_Start,
  55. PicResource_ATV = PicResource_Start,
  56. PicResource_DTV_SD,
  57. PicResource_DTV_MD,
  58. PicResource_DTV_HD,
  59. PicResource_AV,
  60. PicResource_SV,
  61. PicResource_YPbPr_SD, //6
  62. PicResource_YPbPr_MD,
  63. PicResource_YPbPr_HD,
  64. PicResource_HDMI_SD,
  65. PicResource_HDMI_MD,
  66. PicResource_HDMI_HD, //11
  67. PicResource_DVI,
  68. PicResource_PC,
  69. PicResource_ANDROID_MEDIA_SD,
  70. PicResource_ANDROID_MEDIA_MD,
  71. PicResource_ANDROID_MEDIA_HD,
  72. PicResource_MAX,// 17
  73. }PicResource;
  74. typedef enum _PicResource_NonLineCurve{
  75. PicResource_NonLineCurve_Start,
  76. PicResource_NonLineCurve_ATV = PicResource_Start,
  77. PicResource_NonLineCurve_DTV_SD,
  78. PicResource_NonLineCurve_DTV_MD,
  79. PicResource_NonLineCurve_DTV_HD,
  80. PicResource_NonLineCurve_AV,
  81. PicResource_NonLineCurve_SV,
  82. PicResource_NonLineCurve_YPbPr_SD, //6
  83. PicResource_NonLineCurve_YPbPr_MD,
  84. PicResource_NonLineCurve_YPbPr_HD,
  85. PicResource_NonLineCurve_HDMI_SD,
  86. PicResource_NonLineCurve_HDMI_MD,
  87. PicResource_NonLineCurve_HDMI_HD, //11
  88. PicResource_NonLineCurve_DVI,
  89. PicResource_NonLineCurve_PC,
  90. PicResource_NonLineCurve_ANDROID_MEDIA_SD,
  91. PicResource_NonLineCurve_ANDROID_MEDIA_MD,
  92. PicResource_NonLineCurve_ANDROID_MEDIA_HD,
  93. PicResource_NonLineCurve_SCART_CVBS_PAL, //17
  94. PicResource_NonLineCurve_SCART_CVBS_NTSC,
  95. PicResource_NonLineCurve_SCART_CVBS_SECAM,
  96. PicResource_NonLineCurve_SCART_RGB,
  97. PicResource_NonLineCurve_MAX, //21
  98. }PicResource_NonLineCurve;
  99. typedef enum _PicSrcOther{
  100. PicSrcOther_Start,
  101. PicSrcOther_DVI = PicSrcOther_Start,
  102. PicSrcOther_PC,
  103. PicSrcOther_End
  104. }PicSrcOther;
  105. typedef struct _PicColorSetting_t{
  106. unsigned char Brightness;
  107. unsigned char Contrast;
  108. unsigned char Sharpness;
  109. unsigned char Saturation; //Color (weifeng modify old releatd function name from color to saturation)
  110. char Hue; // Tint (PICCOLOR_TINT)
  111. char StaticGamma; //Gamma
  112. unsigned char NoiseReduction;
  113. unsigned char ColorTempMode; // Tint , for color temp mode effected by picture mode
  114. unsigned char AdvanceSharpness;
  115. unsigned char DynamicContrast;
  116. unsigned char DynamicBacklight;
  117. unsigned char MPEGNR;
  118. unsigned char ColorEnhancement; //DCE DynamicSaturation
  119. char BlackExtend;
  120. char WhiteExtend;
  121. }PicColorSetting_t;
  122. enum {
  123. PICCOLOR_BRIGHTNESS = 0,
  124. PICCOLOR_CONSTRAST = 1,
  125. PICCOLOR_SHARPNESS = 2,
  126. PICCOLOR_SATURATION = 3,
  127. PICCOLOR_HUE = 4,
  128. PICCOLOR_STATICGAMMA = 5,
  129. PICCOLOR_NR = 6,
  130. PICCOLOR_COLORTEMPMODE = 7,
  131. PICCOLOR_ADVANCESHARPNESS = 8,
  132. PICCOLOR_DYNAMICCONTRAST = 9,
  133. PICCOLOR_DYNAMICBACKLIGHT = 10,
  134. PICCOLOR_MPEGNR = 11,
  135. PICCOLOR_COLORENHANCEMENT = 12,
  136. PICCOLOR_BLACKEXTEND = 13,
  137. PICCOLOR_WHITEEXTEND = 14,
  138. PICCOLOR_BRIGHTNESS_OFFSET = 15,
  139. PICCOLOR_CONSTRAST_OFFSET = 16,
  140. PICCOLOR_SHARPNESS_OFFSET = 17,
  141. PICCOLOR_SATURATION_OFFSET = 18,
  142. PICCOLOR_HUE_OFFSET = 19,
  143. };
  144. typedef struct _PQ_Setting_bySrc_t{
  145. unsigned char PicMode;
  146. char Hposition;
  147. char Vposition;
  148. unsigned char ColorSpace;
  149. unsigned char ColorTempMode; //for color temp mode effected by source
  150. char BrightnessOffset;
  151. char ContrastOffset;
  152. char SharpnessOffset;
  153. char SaturationOffset; //Color
  154. char HueOffset; // Tint
  155. }PQ_Setting_bySrc_t;
  156. // set overscan / aspectratio by source and by resolution level((SD¡BMD¡BHD))
  157. // for CVD2, please set/get overscan via CVD2VideoDecoderSetting_t
  158. typedef struct _PQ_Setting_byResource_t{
  159. unsigned char Hoverscan;
  160. unsigned char Voverscan;
  161. unsigned char AspectRatio;
  162. }PQ_Setting_byResource_t;
  163. enum {
  164. PQSetting_PicMode,
  165. PQSetting_Hposition,
  166. PQSetting_Vposition,
  167. PQSetting_ColorSpace,
  168. PQSetting_Hoverscan,
  169. PQSetting_Voverscan,
  170. PQSetting_AspectRatio,
  171. PQSetting_HDMIRGBRange,
  172. PQSetting_DitheringLevel,
  173. PQSetting_DitheringAlgo,
  174. PQSetting_Backlight,
  175. PQSetting_ColorTempMode,
  176. PQSetting_Brightness_Offset,
  177. PQSetting_Constrast_Offset,
  178. PQSetting_Sharpness_Offset,
  179. PQSetting_Saturation_Offset,
  180. PQSetting_Hue_Offset,
  181. };
  182. typedef struct _PicColorTmpSetting_t{
  183. short Rgain;
  184. short Ggain;
  185. short Bgain;
  186. short Roffset;
  187. short Goffset;
  188. short Boffset;
  189. short GammaTableIndex;
  190. }PicColorTmpSetting_t;
  191. enum {
  192. COLORTMP_RGAIN = 0,
  193. COLORTMP_GGAIN = 1,
  194. COLORTMP_BGAIN = 2,
  195. COLORTMP_ROFFSET = 3,
  196. COLORTMP_GOFFSET = 4,
  197. COLORTMP_BOFFSET = 5,
  198. COLORTMP_GAMMATABLEINDEX = 6,
  199. };
  200. enum {
  201. NonLineCurve_Item_Start,
  202. NonLineCurve_Brightness = NonLineCurve_Item_Start,
  203. NonLineCurve_Contrast,
  204. NonLineCurve_Sharpness,
  205. NonLineCurve_Saturation,
  206. NonLineCurve_Hue,
  207. NonLineCurve_End,
  208. };
  209. enum {
  210. NonLineCurveLevel_0,
  211. NonLineCurveLevel_25,
  212. NonLineCurveLevel_50,
  213. NonLineCurveLevel_75,
  214. NonLineCurveLevel_100,
  215. };
  216. // this is a set can get index information need by PQ setting
  217. // ex: srcIndex, format, definition, ...
  218. // these information can be get via PQ_Get_Input_TypeandIndex
  219. typedef struct _PQIndexInfo{
  220. unsigned int srcId;
  221. unsigned int srcType;
  222. int format;
  223. unsigned char definition;
  224. unsigned char dvi;
  225. unsigned char PQ_SrcIdx;
  226. unsigned char PQ_MainType;
  227. unsigned char Piccolor_SubIdx;
  228. unsigned char Colortemp_SubIdx;
  229. unsigned char PQResourceIdx;
  230. unsigned char NonLine_PQResourceIdx;
  231. #if defined(SISCONFIG_OCEANBLUE)
  232. unsigned char scartInput;
  233. #endif
  234. }PQIndexInfo_t, *pPQIndexInfo_t;
  235. typedef struct _PQ_Setting_byResource_NonLineCurveLevel_t{
  236. unsigned char Brightness_Level_0; // 0 ~ 255
  237. unsigned char Brightness_Level_25;
  238. unsigned char Brightness_Level_50;
  239. unsigned char Brightness_Level_75;
  240. unsigned char Brightness_Level_100;
  241. unsigned char Contrast_Level_0; // 0 ~ 255
  242. unsigned char Contrast_Level_25;
  243. unsigned char Contrast_Level_50;
  244. unsigned char Contrast_Level_75;
  245. unsigned char Contrast_Level_100;
  246. unsigned char Sharpness_Level_0; // 0 ~ 127
  247. unsigned char Sharpness_Level_25;
  248. unsigned char Sharpness_Level_50;
  249. unsigned char Sharpness_Level_75;
  250. unsigned char Sharpness_Level_100;
  251. unsigned char Saturation_Level_0; // 0 ~ 255
  252. unsigned char Saturation_Level_25;
  253. unsigned char Saturation_Level_50;
  254. unsigned char Saturation_Level_75;
  255. unsigned char Saturation_Level_100;
  256. unsigned char Hue_Level_0; // 100 ~ 0
  257. unsigned char Hue_Level_25;
  258. unsigned char Hue_Level_50;
  259. unsigned char Hue_Level_75;
  260. unsigned char Hue_Level_100;
  261. }PQ_Setting_byResource_NonLineCurveLevel_t;
  262. typedef struct _REG_RANGE
  263. {
  264. int min;
  265. int max;
  266. int middle;
  267. } REG_RANGE;
  268. typedef struct _PQ_REG_RANGE
  269. {
  270. REG_RANGE NRRange;
  271. REG_RANGE GammaRange;
  272. REG_RANGE BacklightRange;
  273. }PQ_REG_RANGE, *pPQ_REG_RANGE;
  274. unsigned char Cmd_PqAdjust(PQ_ADJCMD_t cmd, int value);
  275. unsigned char Cmd_PqAdjust_ColTemp(PQ_ADJCMD_t cmd,UINT16 bRain,UINT16 bGain,UINT16 bBgain,UINT8 bGammaswitch,UINT8 bGammaIndex);
  276. unsigned char Cmd_ColorLUT7AxisAdjust(PQ_ADJCMD_t cmd, UINT8 RegionIdx, UINT8 bEnable, INT8 iHueGain, INT8 iSatGain, INT8 iYGain, BOOL bSet);
  277. unsigned char Cmd_ColorLUT7RangeAdjust(UINT8 RegionIdx, UINT8 bMake, UINT8 HueMin, UINT8 HueMax, UINT8 SatMin, UINT8 SatMax, UINT8 YMin, UINT8 YMax, UINT8 SmoothLevel, BOOL bSet);
  278. unsigned char Cmd_regionY(UINT8 bRegionIndex,UINT8 bTotalHnum,UINT8 bTotalVnum);
  279. unsigned char Cmd_PqAdjust_Curve(PQ_ADJCMD_t cmd, UINT8 CurveType, UINT8 CurvePointIndex, INT16 value);
  280. UINT16 PQ_GetCurrRegionY(void);
  281. UINT16 PQ_GetCurrHVStartSize(RegionHVStartSize* bvalue);
  282. UINT32 PQ_Gethistormbin(UINT32* bHistBin );
  283. unsigned char Cmd_PqAdjust2(PQ_ADJCMD_t cmd, int value, int min, int max);
  284. unsigned char Cmd_PqGetRegRange(PQ_REG_RANGE *value);
  285. UINT32 PQ_GetCurrPWMFreq(void);
  286. UINT32 PQ_GetCurrPWM(void);
  287. UINT16 PQ_GetCurrDutyPWM(void);
  288. UINT8 PQ_SetCurrDutyPWM(UINT16 uwDuty);
  289. UINT8 PQ_GetCurrPolarity(void);
  290. UINT32 PQ_GetCurrElectricity(void);
  291. UINT8 PQ_SetHbinINDEX(UINT8 index);
  292. UINT32 PQ_Getbjpeg(void);
  293. #endif //#ifndef _PQ_IOCTL_H_