vip2_ioctl.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. #ifndef _VIP2_IOCTL_H_
  2. #define _VIP2_IOCTL_H_
  3. #include "drv_vip_external.h"
  4. #include "drv_kmf_interface.h"
  5. #include "drv_cvd2_external.h"
  6. #include "kmf_ioctl.h"
  7. typedef enum _SRCTYPE_t{
  8. SRCTYPE_ATV = 0x1,
  9. SRCTYPE_DTV = 0x2,
  10. SRCTYPE_TV = 0x4,
  11. SRCTYPE_AV = 0x10,
  12. SRCTYPE_SV = 0x20,
  13. SRCTYPE_SCART = 0x40,
  14. SRCTYPE_VIDEO = 0x80,
  15. SRCTYPE_COMPONENT = 0x100,
  16. SRCTYPE_PC = 0x200,
  17. SRCTYPE_DVD = 0x400, //[Singming 20121030] Add for CONFIG_DVD_COMBO
  18. #ifdef CONFIG_BLUETOOTH_SUPPORT
  19. SRCTYPE_BLUETOOTH = 0x800,
  20. #endif
  21. SRCTYPE_HDMI = 0x1000,
  22. SRCTYPE_EMENU = 0x2000,
  23. #if defined(CONFIG_SUPPORT_NES_GAME) || defined(CONFIG_OSD_GAME_SUPPORT)
  24. SRCTYPE_GAME = 0x4000,
  25. #endif
  26. SRCTYPE_PVR = 0x8000,
  27. SRCTYPE_PICVIEWER = 0x10000,
  28. SRCTYPE_MUSICPLAYER = 0x20000,
  29. SRCTYPE_MEDIA = 0x40000,
  30. SRCTYPE_KOK = 0x80000,
  31. SRCTYPE_ANYPLEX = 0x100000,
  32. SRCTYPE_ANDROID = 0x200000,
  33. //Special Source
  34. SRCTYPE_BURNIN = 0x400000,
  35. SRCTYPE_FIRMWAREUPDTAE = 0x800000,
  36. //Reserved bits
  37. SRCTYPE_RESERVED = 0xff000000
  38. }SRCTYPE_t;
  39. typedef enum {
  40. MID_PROGRESSIVE=0,
  41. MID_INTERLACE
  42. } MID_LACE_MODE_t;
  43. typedef enum {
  44. MID_CVD2_STD_NONE = CVD2_STD_NONE,
  45. MID_CVD2_STD_NTSC_M = CVD2_STD_NTSC_M,
  46. MID_CVD2_STD_NTSC_443 = CVD2_STD_NTSC_443,
  47. MID_CVD2_STD_PAL = CVD2_STD_PAL_IBGDK,
  48. MID_CVD2_STD_PAL_M = CVD2_STD_PAL_M,
  49. MID_CVD2_STD_PAL_CN = CVD2_STD_PAL_CN,
  50. MID_CVD2_STD_PAL_60 = CVD2_STD_PAL_60,
  51. MID_CVD2_STD_SECAM = CVD2_STD_SECAM,
  52. MID_CVD2_STD_END,
  53. } MID_CVD2_MODE_t;
  54. typedef enum {
  55. MID_HDMI_MODE=0,
  56. MID_DVI_MODE,
  57. } MID_HDMI_MODE_t;
  58. typedef enum {
  59. STATUS_NOSIGNAL,
  60. STATUS_SIGNALOK,
  61. STATUS_SIGNALWEAK,
  62. STATUS_NOTSUPPORT,
  63. STATUS_UNKNOWN,
  64. } MID_INPUT_STATUS_t;
  65. typedef struct MID_InputInfo
  66. {
  67. unsigned int wHactive; // input horizontal resouluton
  68. unsigned int wVactive; // input vertical resolution
  69. unsigned int wHsfreq; // H sync frequency
  70. unsigned int wVsfreq; // V sync frequency
  71. MID_CVD2_MODE_t eCvd2ColorFormat; // CVD2 source: PAL / NTSC / SECAM
  72. unsigned char bIsHdmiNeedOverScan; // for menu determine showing HDMI screen mode item(0: HDMI timing don't do overscan, 1: HDMI timing need do overscan)
  73. MID_LACE_MODE_t eInterlace; // 1=interlaced, 0=progressive
  74. VIP_InputStruct_3D_t e3DStructure; // HDMI source 3D mode
  75. unsigned char bRGBRange; // HDMI source RGB range
  76. MID_HDMI_MODE_t eSourceDVIMode; // HDMI source: 0: HDMI mode, 1: DVI mode
  77. SCART_MODE_t eScartMode; // CVD2 source: 0: SCART_SV mode, 1: SCART_CVBS mode, 2: SCART_RGB mode
  78. MID_INPUT_STATUS_t eInputStatus; // 0:No signal, 1:Signal stable, 2: weak signal; Set by driver only
  79. SRCTYPE_t eMidSourceType;
  80. unsigned int uiTimingIndex; // Only works in CVD2 and ADC and HDMI
  81. unsigned char bCodedFrame; // Input source aspect ratio
  82. unsigned short usTimingTableHStart; //For Factory menu used only
  83. unsigned short usTimingTableVStart; //For Factory menu used only
  84. unsigned char bIsHScalerDown;
  85. unsigned char bITC;
  86. }MID_InputInfo_t, *PMID_InputInfo_t;
  87. typedef struct _DrvInputStatus_t
  88. {
  89. unsigned char msgfromVIP; // 1: VIP, 0: other driver
  90. unsigned char bSub; // 0: main, 1: sub; set by VIP driver only.
  91. unsigned int path; // input path
  92. unsigned char bActive; // 0:FALSE, 1:TRUE; Set by driver only
  93. unsigned char bNotSupport;
  94. unsigned char bScramble; //0:FALSE, 1:TRUE; Set by DTV driver only
  95. unsigned char bAudioOnly;
  96. unsigned char bHscalerDown;
  97. }DrvInputStatus_t, *PDrvInputStatus_t;
  98. /* VIP module related factory define Begin */
  99. enum{
  100. STRIPE_PATTERN_DISABLE,
  101. STRIPE_PATTERN_HORIZONTAL,
  102. STRIPE_PATTERN_VERTICAL,
  103. };
  104. typedef enum{
  105. VIP_TEST_PATTERN_DISABLE = 0,
  106. VIP_TEST_PATTERN_GRAY16,
  107. VIP_TEST_PATTERN_GRAY32,
  108. VIP_TEST_PATTERN_GRAY64,
  109. VIP_TEST_PATTERN_VERTICAL_COLORBAR,
  110. VIP_TEST_PATTERN_HORIZONTAL_RAMP_COLORBAR,
  111. VIP_TEST_PATTERN_VERTICAL_STRIPE_PATTERN,
  112. VIP_TEST_PATTERN_HORIZONTAL_STRIPE_PATTERN,
  113. VIP_TEST_PATTERN_DISABLE_STRIPE_PATTERN,
  114. VIP_TEST_PATTERN_FILL_COLOR = 0x80,
  115. #ifdef CONFIG_CONTROL_WHITE_pattern_BY_PQ
  116. VIP_TEST_PATTERN_FILL_COLOR_PQ,
  117. #endif
  118. VIP_TEST_PATTERN_END,
  119. }VIP_TestPattern_t;
  120. typedef struct _VIP_TestPattern {
  121. UINT16 wPatternType; //VIP test pattern type selection
  122. UINT16 wRedColor; //Fill Red color value
  123. UINT16 wGreenColor; //Fill Green color value
  124. UINT16 wBlueColor; //Fill Blue color value
  125. }VIP_TestPattern,*PVIP_TestPattern;
  126. /* VIP module related factory define End */
  127. UINT8 Cmd_VipInit(void);
  128. UINT8 Cmd_VipAdjust(VIP_ADJCMD_t cmd, int value);
  129. UINT8 Cmd_VipSetOverScan(UINT16 usiTop, UINT16 usBottom, UINT16 usLeft, UINT16 usRight);
  130. UINT8 Cmd_VipGetOverScan(UINT16* usiTop, UINT16* usBottom, UINT16* usLeft, UINT16* usRight, BOOL* fUnitByRatio);
  131. UINT8 Cmd_VipGetYAvag(UINT32* Yavg);
  132. UINT8 Cmd_VipSetExtsInputWin(UINT16 usHStart, UINT16 usHEnd, UINT16 usVStart, UINT16 usVEnd);
  133. UINT8 Cmd_VipGetExtsInputWin(UINT16* usHStart, UINT16* usHEnd, UINT16* usVStart, UINT16* usVEnd);
  134. UINT8 Cmd_VipSetHDMIScreenMode(UINT8 eMode);
  135. UINT8 Cmd_VipOverScanEn(UINT8 ucEn);
  136. UINT8 Cmd_VipGetInputInfo(SRCTYPE_t eSource, PMID_InputInfo_t pInput_Info);
  137. UINT8 Cmd_VipGetPanelRes(UINT32* ulWidth, UINT32* ulHeight);
  138. UINT32 Cmd_VipGetAdcHTotal(void);
  139. UINT8 Cmd_VipSetAPPMuteStatus(BOOL eMuteStatus);
  140. #ifdef CONFIG_QSD
  141. UINT8 Cmd_VipSetMTMuteStatus(BOOL eMuteStatus);
  142. #endif
  143. UINT8 Cmd_VipGetMuteStatus(PVIP_Mute_Flag_st peRetMuteStatus);
  144. BOOL Cmd_VipIsSupport3D(VIP_InputStruct_3D_t e3DInputStruct);
  145. UINT8 Cmd_VipSetMuteColor(UINT8 bR, UINT8 bG, UINT8 bB);
  146. UINT8 Cmd_VipSetTvfeMuteColorByAPP(BOOL fEn);
  147. UINT8 Cmd_VipSourceSelect_By_ShowLogo(input_type_t eInputType);
  148. //UINT8 Cmd_VipTestPattern(UINT16 ePattern);
  149. UINT8 Cmd_VipTestPattern(UINT16 ePattern,UINT16 eRedColor,UINT16 eGreenColor,UINT16 eBuleColor);
  150. UINT8 Cmd_VipGetPanelInverse(BOOL *fFlip);
  151. UINT8 Cmd_VipGetDefPanelInverse(BOOL * fFlip);
  152. UINT8 Cmd_SetVideoPosAndSize(INT16 sdHstart, INT16 sdVstart, UINT16 sdHsize, UINT16 sdVsize, UINT8 fMHEG5Active, UINT8 bInfo);
  153. UINT8 Cmd_GetDispAspectRatio(void);
  154. #ifdef CONFIG_SUPPORT_MHEG5
  155. UINT8 Cmd_SetMHEG5En(UINT8 ucEn);
  156. UINT8 Cmd_SetWideAlignment(VIP_MHEG5_WideAignment eWideAlignment, UINT8 fMheg5Active, UINT8 bInfo);
  157. UINT8 Cmd_SetSceneAspectRatio(VIP_MHEG5_SceneAspectRatio eSceneAR, UINT8 fMheg5Active, UINT8 bInfo);
  158. UINT8 Cmd_UpdateVIP(UINT8 fMheg5Active, UINT8 bInfo);
  159. UINT8 Cmd_GetDecFC(VIP_MHEG5_DecFC *decFC);
  160. #endif
  161. #ifdef CONFIG_ENABLE_MIR
  162. UINT8 Cmd_VipSetMirrorFormat(BOOL fMirEn, UINT8 bFormat, BOOL fOSDEn);
  163. #endif
  164. UINT8 Cmd_VipSetMonflg(UINT32 dMonflg);
  165. void Cmd_VipSetSrcZoom(BOOL en, UINT16 x, UINT16 y, UINT16 dWidth, UINT16 dHeight);
  166. void Cmd_VipSetDspZoom(BOOL en, UINT16 x, UINT16 y, UINT16 dWidth, UINT16 dHeight);
  167. UINT8 Cmd_VipSSC_LVDS_CLKShift(VIP_ADJCMD_t cmd, int value,int iParm1);
  168. void Cmd_SetMediaPlayStatus(VIP_MEDIA_Playback_State_t eMediaPlayStatus);
  169. /**
  170. * @brief Set Zoom in/out percent with each aspectraio
  171. *
  172. * This function set zoom in/out percent and apply to aspectratio setting, set this function before aspectraio function.
  173. * Supported in PC, HDMI, DTV, Media-Movie and PHOTO source currently.
  174. *
  175. * @param HPercent : zoom in/out in horizontal, the value should be 20 - 100. 20 is 20%, and 100 is 100%, default should be 100
  176. * @param VPercent : zoom in/out in vertical, the value should be 20 - 100. 20 is 20%, and 100 is 100%, default should be 100
  177. * the parameter HPercent can be different with VPercent
  178. * @return n/a
  179. */
  180. void Cmd_SetZoomPercent(INT32 HPercent, INT32 VPercent);
  181. UINT8 Cmd_VipGetRGBMaxMin(INT32* iRMax, INT32* iGMax, INT32* iBMax, INT32* iRMin, INT32* iGMin, INT32* iBMin);
  182. UINT8 Cmd_VipGetYHistOverValCnt(INT32 iYHistOverValue, INT32* iCount);
  183. #endif