video.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * AMLOGIC Audio/Video streaming port driver.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the named License,
  7. * or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  17. *
  18. * Author: Tim Yao <timyao@amlogic.com>
  19. *
  20. */
  21. #ifndef VIDEO_H
  22. #define VIDEO_H
  23. enum {
  24. VIDEO_WIDEOPTION_NORMAL = 0,
  25. VIDEO_WIDEOPTION_FULL_STRETCH = 1,
  26. VIDEO_WIDEOPTION_4_3 = 2,
  27. VIDEO_WIDEOPTION_16_9 = 3,
  28. VIDEO_WIDEOPTION_NORMAL_NOSCALEUP = 4,
  29. VIDEO_WIDEOPTION_MAX = 5
  30. };
  31. typedef struct {
  32. s32 x ;
  33. s32 y ;
  34. s32 w ;
  35. s32 h ;
  36. } disp_rect_t;
  37. #define VIDEO_NOTIFY_TRICK_WAIT 0x01
  38. #define VIDEO_NOTIFY_PROVIDER_GET 0x02
  39. #define VIDEO_NOTIFY_PROVIDER_PUT 0x04
  40. #define VIDEO_NOTIFY_FRAME_WAIT 0x08
  41. #define VIDEO_NOTIFY_POS_CHANGED 0x10
  42. #ifdef CONFIG_ARCH_MESON6
  43. // TODO: move to register headers
  44. #define VPP_VADJ2_BLMINUS_EN (1 << 3)
  45. #define VPP_VADJ2_EN (1 << 2)
  46. #define VPP_VADJ1_BLMINUS_EN (1 << 1)
  47. #define VPP_VADJ1_EN (1 << 0)
  48. #define VPP_VD_SIZE_MASK 0xfff
  49. #define VPP_VD1_START_BIT 16
  50. #define VPP_VD1_END_BIT 0
  51. #define VPP_REGION_MASK 0xfff
  52. #define VPP_REGION1_BIT 16
  53. #define VPP_REGION2_BIT 0
  54. #define VPP_REGION3_BIT 16
  55. #define VPP_REGION4_BIT 0
  56. #define VDIF_PIC_END_BIT 16
  57. #define VDIF_PIC_START_BIT 0
  58. #define VD1_FMT_LUMA_WIDTH_MASK 0xfff
  59. #define VD1_FMT_LUMA_WIDTH_BIT 16
  60. #define VD1_FMT_CHROMA_WIDTH_MASK 0xfff
  61. #define VD1_FMT_CHROMA_WIDTH_BIT 0
  62. #define VPP_VD2_ALPHA_WID 9
  63. #define VPP_VD2_ALPHA_MASK 0x1ff
  64. #define VPP_VD2_ALPHA_BIT 18
  65. #define VPP_OSD2_PREBLEND (1 << 17)
  66. #define VPP_OSD1_PREBLEND (1 << 16)
  67. #define VPP_VD2_PREBLEND (1 << 15)
  68. #define VPP_VD1_PREBLEND (1 << 14)
  69. #define VPP_OSD2_POSTBLEND (1 << 13)
  70. #define VPP_OSD1_POSTBLEND (1 << 12)
  71. #define VPP_VD2_POSTBLEND (1 << 11)
  72. #define VPP_VD1_POSTBLEND (1 << 10)
  73. #define VPP_OSD1_ALPHA (1 << 9)
  74. #define VPP_OSD2_ALPHA (1 << 8)
  75. #define VPP_POSTBLEND_EN (1 << 7)
  76. #define VPP_PREBLEND_EN (1 << 6)
  77. #define VPP_PRE_FG_SEL_MASK (1 << 5)
  78. #define VPP_PRE_FG_OSD2 (1 << 5)
  79. #define VPP_PRE_FG_OSD1 (0 << 5)
  80. #define VPP_POST_FG_SEL_MASK (1 << 4)
  81. #define VPP_POST_FG_OSD2 (1 << 4)
  82. #define VPP_POST_FG_OSD1 (0 << 4)
  83. #define VPP_FIFO_RESET_DE (1 << 2)
  84. #define VPP_OUT_SATURATE (1 << 0)
  85. #define VDIF_RESET_ON_GO_FIELD (1<<29)
  86. #define VDIF_URGENT_BIT 27
  87. #define VDIF_CHROMA_END_AT_LAST_LINE (1<<26)
  88. #define VDIF_LUMA_END_AT_LAST_LINE (1<<25)
  89. #define VDIF_HOLD_LINES_BIT 19
  90. #define VDIF_HOLD_LINES_MASK 0x3f
  91. #define VDIF_LAST_LINE (1<<18)
  92. #define VDIF_BUSY (1<<17)
  93. #define VDIF_DEMUX_MODE (1<<16)
  94. #define VDIF_DEMUX_MODE_422 (0<<16)
  95. #define VDIF_DEMUX_MODE_RGB_444 (1<<16)
  96. #define VDIF_FORMAT_BIT 14
  97. #define VDIF_FORMAT_MASK 3
  98. #define VDIF_FORMAT_SPLIT (0<<14)
  99. #define VDIF_FORMAT_422 (1<<14)
  100. #define VDIF_FORMAT_RGB888_YUV444 (2<<14)
  101. #define VDIF_BURSTSIZE_MASK 3
  102. #define VDIF_BURSTSIZE_CR_BIT 12
  103. #define VDIF_BURSTSIZE_CB_BIT 10
  104. #define VDIF_BURSTSIZE_Y_BIT 8
  105. #define VDIF_MANULE_START_FRAME (1<<7)
  106. #define VDIF_CHRO_RPT_LAST (1<<6)
  107. #define VDIF_CHROMA_HZ_AVG (1<<3)
  108. #define VDIF_LUMA_HZ_AVG (1<<2)
  109. #define VDIF_SEPARATE_EN (1<<1)
  110. #define VDIF_ENABLE (1<<0)
  111. #define VDIF_LOOP_MASK 0xff
  112. #define VDIF_CHROMA_LOOP1_BIT 24
  113. #define VDIF_LUMA_LOOP1_BIT 16
  114. #define VDIF_CHROMA_LOOP0_BIT 8
  115. #define VDIF_LUMA_LOOP0_BIT 0
  116. #define HFORMATTER_REPEAT (1<<28)
  117. #define HFORMATTER_BILINEAR (0<<28)
  118. #define HFORMATTER_PHASE_MASK 0xf
  119. #define HFORMATTER_PHASE_BIT 24
  120. #define HFORMATTER_RRT_PIXEL0 (1<<23)
  121. #define HFORMATTER_YC_RATIO_1_1 (0<<21)
  122. #define HFORMATTER_YC_RATIO_2_1 (1<<21)
  123. #define HFORMATTER_YC_RATIO_4_1 (2<<21)
  124. #define HFORMATTER_EN (1<<20)
  125. #define VFORMATTER_ALWAYS_RPT (1<<19)
  126. #define VFORMATTER_LUMA_RPTLINE0_DE (1<<18)
  127. #define VFORMATTER_CHROMA_RPTLINE0_DE (1<<17)
  128. #define VFORMATTER_RPTLINE0_EN (1<<16)
  129. #define VFORMATTER_SKIPLINE_NUM_MASK 0xf
  130. #define VFORMATTER_SKIPLINE_NUM_BIT 12
  131. #define VFORMATTER_INIPHASE_MASK 0xf
  132. #define VFORMATTER_INIPHASE_BIT 8
  133. #define VFORMATTER_PHASE_MASK (0x7f)
  134. #define VFORMATTER_PHASE_BIT 1
  135. #define VFORMATTER_EN (1<<0)
  136. #define VPP_PHASECTL_TYPE (1<<16)
  137. #define VPP_PHASECTL_TYPE_PROG (0<<16)
  138. #define VPP_PHASECTL_TYPE_INTERLACE (1<<16)
  139. #define VPP_PHASECTL_VSL0B (1<<15)
  140. #define VPP_PHASECTL_INIRPTNUM_MASK 0x3
  141. #define VPP_PHASECTL_INIRPTNUM_WID 2
  142. #define VPP_PHASECTL_INIRPTNUMB_BIT 13
  143. #define VPP_PHASECTL_INIRCVNUM_MASK 0xf
  144. #define VPP_PHASECTL_INIRCVNUM_WID 5
  145. #define VPP_PHASECTL_INIRCVNUMB_BIT 8
  146. #define VPP_PHASECTL_VSL0T (1<<7)
  147. #define VPP_PHASECTL_INIRPTNUMT_BIT 5
  148. #define VPP_PHASECTL_INIRCVNUMT_BIT 0
  149. #define VPP_SC_PREHORZ_EN (1 << 20)
  150. #define VPP_SC_PREVERT_EN (1 << 19)
  151. #define VPP_SC_VERT_EN (1 << 18)
  152. #define VPP_SC_HORZ_EN (1 << 17)
  153. #define VPP_SC_TOP_EN (1 << 16)
  154. #define VPP_SC_V1OUT_EN (1 << 15)
  155. #define VPP_SC_RGN14_HNOLINEAR (1 << 12)
  156. #define VPP_SC_BANK_LENGTH_WID 3
  157. #define VPP_SC_BANK_LENGTH_MASK 0x7
  158. #define VPP_SC_HBANK_LENGTH_BIT 8
  159. #define VPP_SC_RGN14_VNOLINEAR (1 << 4)
  160. #define VPP_SC_VBANK_LENGTH_BIT 0
  161. #define VPP_HSC_INIRPT_NUM_MASK 0x3
  162. #define VPP_HSC_INIRPT_NUM_BIT 21
  163. #define VPP_HSC_INIRCV_NUM_MASK 0xf
  164. #define VPP_HSC_INIRCV_NUM_BIT 16
  165. #define VPP_HSC_TOP_INI_PHASE_WID 16
  166. #define VPP_HSC_TOP_INI_PHASE_BIT 0
  167. #define VPP_OFIFO_LINELEN_MASK 0xfff
  168. #define VPP_OFIFO_LINELEN_BIT 20
  169. #define VPP_INV_VS (1 << 19)
  170. #define VPP_INV_HS (1 << 18)
  171. #define VPP_FORCE_FIELD_EN (1 << 17)
  172. #define VPP_FORCE_FIELD_TYPE_MASK (1 << 16)
  173. #define VPP_FORCE_FIELD_TOP (0 << 16)
  174. #define VPP_FORCE_FIELD_BOTTOM (1 << 16)
  175. #define VPP_FOURCE_GO_FIELD (1 << 15)
  176. #define VPP_FOURCE_GO_LINE (1 << 14)
  177. #define VPP_OFIFO_SIZE_WID 12
  178. #define VPP_OFIFO_SIZE_MASK 0xfff
  179. #define VPP_OFIFO_SIZE_BIT 0
  180. #define VPP_COEF_IDXINC (1 << 15)
  181. #define VPP_COEF_RD_CBUS (1 << 14)
  182. #define VPP_COEF_9BIT (1 << 9)
  183. #define VPP_COEF_TYPE (1 << 8)
  184. #define VPP_COEF_VERT (0 << 8)
  185. #define VPP_COEF_HORZ (1 << 8)
  186. #define VPP_COEF_INDEX_MASK 0x7f
  187. #define VPP_COEF_INDEX_BIT 0
  188. #define P_VFIFO2VD_LINE_TOP_START P_ENCP_VFIFO2VD_LINE_TOP_START
  189. #endif
  190. #endif /* VIDEO_H */