Advertisement
mpthompson

Wonder Media Post Processor (vpp) driver

Sep 26th, 2012
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.95 KB | None | 0 0
  1. /*++
  2. * linux/drivers/video/wmt/vpp.h
  3. * WonderMedia video post processor (VPP) driver
  4. *
  5. * Copyright c 2010 WonderMedia Technologies, Inc.
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * WonderMedia Technologies, Inc.
  21. * 4F, 533, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C
  22. --*/
  23.  
  24. /*
  25. * ChangeLog
  26. *
  27. * 2010-08-05 Sam Shen
  28. * * Add License declaration and ChangeLog
  29. */
  30.  
  31. #include "vpp-osif.h"
  32. #include "./hw/wmt-vpp-hw.h"
  33. #include "com-vpp.h"
  34.  
  35. #ifndef VPP_H
  36. #define VPP_H
  37.  
  38. /* VPP feature config */
  39. /* 0 - right edge black edge, 1 - scale more to cut right edge for fit visual window */
  40. // #define CONFIG_VPP_SCALEDWN_FIT_RIGHT_EDGE // WM3426 don't support bcz SCLR and GOVW width should equal
  41. #define CONFIG_VPP_INTERRUPT
  42. #define CONFIG_VPP_DUAL_BUFFER
  43. // #define CONFIG_VPP_ALLOC_VPU_FB
  44. #define CONFIG_VPP_GOVW_TG_ERR_DROP_FRAME // drop display frame when govw tg error (bandwidth not enough)
  45. #define CONFIG_GOVW_FPS_AUTO_ADJUST
  46. // #define CONFIG_GOVW_FBSWAP_VBIE
  47. #ifdef VPU_DEI_ENABLE
  48. #define CONFIG_VPP_DYNAMIC_DEI
  49. #endif
  50. //#define CONFIG_VPP_VBIE_FREE_MB
  51. #define CONFIG_VPP_GOVRH_FBSYNC // direct path govrh fb swap sync with media fps
  52. #define CONFIG_VPP_GE_DIRECT_PATH
  53. #define CONFIG_VPP_DISPFB_FREE_POSTPONE // free display fb in next vsync
  54.  
  55. #ifdef __KERNEL__
  56. #define CONFIG_VPP_SCALE_ASYNC
  57. #endif
  58.  
  59. // SW patch to fix bug
  60. #define PATCH_SCL_SCALEUP // scl hw bug : scale up right edge
  61. #define PATCH_VPU_COORDINATE // vpu hw bug : vpu coordinate will make TG error
  62.  
  63. // VPP constant define
  64. #define VPP_DAC_SENSE_SECOND 5
  65. #define VPP_VOUT_FRAMERATE_DEFAULT 60
  66. #define GOVRH_DAC_SENSE_VALUE 0x42 // 0x55
  67.  
  68. #define VPP_SCALE_UP_RATIO_H 31
  69. #define VPP_SCALE_DN_RATIO_H 32
  70. #define VPP_SCALE_UP_RATIO_V 31
  71. // #ifdef WMT_FTBLK_SCL_VSCL_32
  72. #if 1
  73. #define VPP_SCALE_DN_RATIO_V 32
  74. #else
  75. #define VPP_SCALE_DN_RATIO_V 16
  76. #endif
  77.  
  78. typedef enum {
  79. VPP_INT_NULL = 0,
  80. VPP_INT_ALL = 0xffffffff,
  81.  
  82. VPP_INT_GOVRH_PVBI = BIT0,
  83. VPP_INT_GOVRH_VBIS = BIT1, //write done
  84. VPP_INT_GOVRH_VBIE = BIT2,
  85.  
  86. VPP_INT_GOVW_PVBI = BIT3,
  87. VPP_INT_GOVW_VBIS = BIT4,
  88. VPP_INT_GOVW_VBIE = BIT5,
  89.  
  90. VPP_INT_DISP_PVBI = BIT6,
  91. VPP_INT_DISP_VBIS = BIT7,
  92. VPP_INT_DISP_VBIE = BIT8,
  93.  
  94. VPP_INT_LCD_EOF = BIT9,
  95.  
  96. VPP_INT_SCL_PVBI = BIT12,
  97. VPP_INT_SCL_VBIS = BIT13,
  98. VPP_INT_SCL_VBIE = BIT14,
  99.  
  100. VPP_INT_VPU_PVBI = BIT15,
  101. VPP_INT_VPU_VBIS = BIT16,
  102. VPP_INT_VPU_VBIE = BIT17,
  103.  
  104. VPP_INT_MAX = BIT31,
  105.  
  106. } vpp_int_t;
  107.  
  108. typedef enum {
  109. /* SCL */
  110. VPP_INT_ERR_SCL_TG = BIT0,
  111. VPP_INT_ERR_SCLR1_MIF = BIT1,
  112. VPP_INT_ERR_SCLR2_MIF = BIT2,
  113. VPP_INT_ERR_SCLW_MIFRGB = BIT3,
  114. VPP_INT_ERR_SCLW_MIFY = BIT4,
  115. VPP_INT_ERR_SCLW_MIFC = BIT5,
  116.  
  117. /* VPU */
  118. VPP_INT_ERR_VPU_TG = BIT6,
  119. VPP_INT_ERR_VPUR1_MIF = BIT7,
  120. VPP_INT_ERR_VPUR2_MIF = BIT8,
  121. VPP_INT_ERR_VPUW_MIFRGB = BIT9,
  122. VPP_INT_ERR_VPUW_MIFY = BIT10,
  123. VPP_INT_ERR_VPUW_MIFC = BIT11,
  124. VPP_INT_ERR_VPU_MVR = BIT25,
  125.  
  126. /* GOVW */
  127. VPP_INT_ERR_GOVM_VPU = BIT12,
  128. VPP_INT_ERR_GOVM_GE = BIT13,
  129. VPP_INT_ERR_GOVM_SPU = BIT14,
  130. VPP_INT_ERR_GOVM_PIP = BIT15,
  131.  
  132. /* GOVW */
  133. VPP_INT_ERR_GOVW_TG = BIT16, //def at govw
  134. VPP_INT_ERR_GOVW_MIFY = BIT17, //def at govw
  135. VPP_INT_ERR_GOVW_MIFC = BIT18, //def at govw
  136.  
  137. /* GOVRS */
  138. VPP_INT_ERR_GOVRS_MIF = BIT19,
  139.  
  140. /* GOVRH */
  141. VPP_INT_ERR_GOVRH_MIF = BIT20,
  142.  
  143. /* PIP */
  144. VPP_INT_ERR_PIP_Y = BIT21,
  145. VPP_INT_ERR_PIP_C = BIT22,
  146.  
  147. /* LCD */
  148. VPP_INT_ERR_LCD_UNDERRUN = BIT23,
  149. VPP_INT_ERR_LCD_OVERFLOW = BIT24,
  150. } vpp_int_err_t;
  151.  
  152. // VPP FB capability flag
  153. #define VPP_FB_FLAG_COLFMT 0xFFFF
  154. #define VPP_FB_FLAG_SCALE BIT(16)
  155. #define VPP_FB_FLAG_CSC BIT(17)
  156. #define VPP_FB_FLAG_MEDIA BIT(18)
  157. #define VPP_FB_FLAG_FIELD BIT(19)
  158.  
  159. typedef struct {
  160. vdo_framebuf_t fb;
  161. vpp_csc_t csc_mode;
  162. int framerate;
  163. vpp_media_format_t media_fmt;
  164. int wait_ready;
  165. unsigned int capability;
  166.  
  167. void (*set_framebuf)(vdo_framebuf_t *fb);
  168. void (*set_addr)(unsigned int yaddr,unsigned int caddr);
  169. void (*get_addr)(unsigned int *yaddr,unsigned int *caddr);
  170. void (*set_csc)(vpp_csc_t mode);
  171. vdo_color_fmt (*get_color_fmt)(void);
  172. void (*set_color_fmt)(vdo_color_fmt colfmt);
  173. void (*fn_view)(int read,vdo_view_t *view);
  174. } vpp_fb_base_t;
  175.  
  176. #define VPP_MOD_BASE \
  177. vpp_mod_t mod; /* module id*/\
  178. unsigned int int_catch; /* interrupt catch */\
  179. vpp_fb_base_t *fb_p; /* framebuf base pointer */\
  180. unsigned int *reg_bk; /* register backup pointer */\
  181. void (*init)(void *base); /* module initial */\
  182. void (*dump_reg)(void); /* dump hardware register */\
  183. void (*set_enable)(vpp_flag_t enable); /* module enable/disable */\
  184. void (*set_colorbar)(vpp_flag_t enable,int mode,int inv); /* hw colorbar enable/disable & mode */\
  185. void (*set_tg)(vpp_clock_t *tmr,unsigned int pixel_clock); /* set timing */\
  186. void (*get_tg)(vpp_clock_t *tmr); /* get timing */\
  187. unsigned int (*get_sts)(void); /* get interrupt or error status */\
  188. void (*clr_sts)(unsigned int sts); /* clear interrupt or error status */\
  189. void (*suspend)(int sts); /* module suspend */\
  190. void (*resume)(int sts) /* module resume */
  191. /* End of vpp_mod_base_t */
  192.  
  193. typedef struct {
  194. VPP_MOD_BASE;
  195. } vpp_mod_base_t;
  196.  
  197. #define VPP_MOD_FLAG_FRAMEBUF BIT(0)
  198.  
  199. typedef enum {
  200. VPP_SCALE_MODE_RT,
  201. VPP_SCALE_MODE_RT_BILINEAR,
  202. VPP_SCALE_MODE_RT_BILINEAR_HW,
  203. VPP_SCALE_MODE_PP,
  204. VPP_SCALE_MODE_PP_BILINEAR,
  205. VPP_SCALE_MODE_MAX
  206. } vpp_scale_mode_t;
  207.  
  208. typedef enum {
  209. VPP_HDMI_AUDIO_I2S,
  210. VPP_HDMI_AUDIO_SPDIF,
  211. VPP_HDMI_AUDIO_MAX
  212. } vpp_hdmi_audio_inf_t;
  213.  
  214. #include "vppm.h"
  215.  
  216. #include "vpu.h"
  217. #include "lcd.h"
  218.  
  219. // #ifdef WMT_FTBLK_SCL
  220. #include "scl.h"
  221. // #endif
  222. /*
  223. #ifdef WMT_FTBLK_GE
  224. #include "ge.h"
  225. #endif
  226. */
  227. #ifdef WMT_FTBLK_GOVM
  228. #include "govm.h"
  229. #endif
  230. #ifdef WMT_FTBLK_GOVW
  231. #include "govw.h"
  232. #endif
  233. #ifdef WMT_FTBLK_GOVRS
  234. #include "govrs.h"
  235. #endif
  236. #ifdef WMT_FTBLK_GOVRH
  237. #include "govrh.h"
  238. #endif
  239. #ifdef WMT_FTBLK_DISP
  240. #include "disp.h"
  241. #endif
  242. #ifdef WMT_FTBLK_LCDC
  243. #include "lcdc.h"
  244. #endif
  245. #ifdef WMT_FTBLK_LVDS
  246. #include "lvds.h"
  247. #endif
  248. // #ifdef WMT_FTBLK_HDMI
  249. #include "hdmi.h"
  250. // #endif
  251. #ifdef CONFIG_WMT_EDID
  252. #include "edid.h"
  253. #endif
  254.  
  255. typedef enum {
  256. VPP_DBGLVL_DISABLE = 0x0,
  257. VPP_DBGLVL_SCALE = 1,
  258. VPP_DBGLVL_DISPFB = 2,
  259. VPP_DBGLVL_INT = 3,
  260. VPP_DBGLVL_TG = 4,
  261. VPP_DBGLVL_IOCTL = 5,
  262. VPP_DBGLVL_DIAG = 6,
  263. VPP_DBGLVL_DEI = 7,
  264. VPP_DBGLVL_SYNCFB = 8,
  265. VPP_DBGLVL_ALL = 0xFF,
  266. } vpp_dbg_level_t;
  267.  
  268. typedef struct {
  269. // internal parameter
  270. int vo_enable;
  271. int govrh_preinit;
  272. vpp_mod_base_t *govr; // module pointer
  273. int chg_res_blank;
  274.  
  275. // vout
  276. int vga_enable;
  277. vpp_hdmi_audio_inf_t hdmi_audio_interface; // 0-I2S, 1-SPDIF
  278. int hdmi_cp_enable; // 0-off, 1-on
  279.  
  280. // govrh
  281. int govrh_field;
  282.  
  283. // govw
  284. int govw_skip_frame;
  285. int govw_skip_all;
  286. int govw_hfp;
  287. int govw_hbp;
  288. int govw_vfp;
  289. int govw_vbp;
  290.  
  291. // video parameter
  292. int video_quality_mode; // 1: quality mode, 0: performance mode (drop line)
  293.  
  294. // scale parameter
  295. int vpu_skip_all;
  296. int scale_keep_ratio;
  297.  
  298. // alloc frame buffer
  299. unsigned int mb[2];
  300. unsigned int resx;
  301. unsigned int resy;
  302.  
  303. // display framebuf queue
  304. int disp_fb_max;
  305. int disp_fb_cnt;
  306. int disp_fb_keep;
  307.  
  308. // direct path
  309. int direct_path;
  310. vdo_framebuf_t direct_path_ori_fb;
  311. int ge_direct_path;
  312. int direct_path_chg;
  313. int ge_direct_init;
  314.  
  315. // govrh fb sync
  316. #ifdef CONFIG_VPP_GOVRH_FBSYNC
  317. int fbsync_enable;
  318. int fbsync_frame;
  319. int fbsync_step;
  320. int fbsync_substep;
  321. int fbsync_cnt;
  322. int fbsync_vsync;
  323. int fbsync_isrcnt;
  324. #endif
  325.  
  326. // VO PTS
  327. vpp_pts_t frame_pts;
  328. vpp_pts_t govw_pts;
  329. vpp_pts_t disp_pts;
  330.  
  331. // auto adjust fps for bandwidth
  332. int govw_tg_dynamic;
  333. unsigned int govw_tg_rcyc;
  334. unsigned int govw_tg_rtn_cnt;
  335. unsigned int govw_tg_rtn_max;
  336.  
  337. // debug
  338. int dbg_msg_level;
  339. int dbg_govw_fb_cnt;
  340. int dbg_govw_vbis_cnt;
  341. int dbg_govw_pvbi_cnt;
  342. int dbg_vpu_dispfb_skip_cnt;
  343. int dbg_govw_tg_err_cnt;
  344. int dbg_vpu_disp_cnt;
  345. int dbg_pip_disp_cnt;
  346. int dbg_govrh_vbis_cnt;
  347. int dbg_dispfb_isr_cnt;
  348. int dbg_dispfb_full_cnt;
  349.  
  350. } vpp_info_t;
  351.  
  352. typedef struct {
  353. unsigned int pixel_clock;
  354. unsigned int PLL;
  355. unsigned int divisor;
  356. unsigned int rd_cyc;
  357. } vpp_base_clock_t;
  358.  
  359. #ifdef __cplusplus
  360. extern "C" {
  361. #endif
  362.  
  363. #ifdef VPP_C
  364. #define EXTERN
  365.  
  366. const unsigned int vpp_csc_parm[VPP_CSC_MAX][7] = {
  367. {0x000004a8, 0x04a80662, 0x1cbf1e70, 0x081204a8, 0x00010000, 0x00010001, 0x00000101}, //YUV2RGB_SDTV_0_255
  368. {0x00000400, 0x0400057c, 0x1d351ea8, 0x06ee0400, 0x00010000, 0x00010001, 0x00000001}, //YUV2RGB_SDTV_16_235
  369. {0x000004a8, 0x04a8072c, 0x1ddd1f26, 0x087604a8, 0x00010000, 0x00010001, 0x00000101}, //YUV2RGB_HDTV_0_255
  370. {0x00000400, 0x04000629, 0x1e2a1f45, 0x07440400, 0x00010000, 0x00010001, 0x00000001}, //YUV2RGB_HDTV_16_235
  371. {0x00000400, 0x0400059c, 0x1d251ea0, 0x07170400, 0x00010000, 0x00010001, 0x00000001}, //YUV2RGB_JFIF_0_255
  372. {0x00000400, 0x0400057c, 0x1d351ea8, 0x06ee0400, 0x00010000, 0x00010001, 0x00000001}, //YUV2RGB_SMPTE170M
  373. {0x00000400, 0x0400064d, 0x1e001f19, 0x074f0400, 0x00010000, 0x00010001, 0x00000001}, //YUV2RGB_SMPTE240M
  374. {0x02040107, 0x1f680064, 0x01c21ed6, 0x1e8701c2, 0x00211fb7, 0x01010101, 0x00000000}, //RGB2YUV_SDTV_0_255
  375. {0x02590132, 0x1f500075, 0x020b1ea5, 0x1e4a020b, 0x00011fab, 0x01010101, 0x00000000}, //RGB2YUV_SDTV_16_235
  376. {0x027500bb, 0x1f99003f, 0x01c21ea6, 0x1e6701c2, 0x00211fd7, 0x01010101, 0x00000000}, //RGB2YUV_HDTV_0_255
  377. {0x02dc00da, 0x1f88004a, 0x020b1e6d, 0x1e25020b, 0x00011fd0, 0x01010101, 0x00000000}, //RGB2YUV_HDTV_16_235
  378. {0x02590132, 0x1f530075, 0x02001ead, 0x1e530200, 0x00011fad, 0x00ff00ff, 0x00000000}, //RGB2YUV_JFIF_0_255
  379. {0x02590132, 0x1f500075, 0x020b1ea5, 0x1e4a020b, 0x00011fab, 0x01010101, 0x00000000}, //RGB2YUV_SMPTE170M
  380. {0x02ce00d9, 0x1f890059, 0x02001e77, 0x1e380200, 0x00011fc8, 0x01010101, 0x00000000}, //RGB2YUV_SMPTE240M
  381. };
  382.  
  383. const vpp_timing_t vpp_video_mode_table[] = {
  384. { /* 640x480@60 DMT/CEA861 */
  385. 25175000, /* pixel clock */
  386. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_640x480p60_4x3), /* option */
  387. 96, 48, 640, 16, /* H sync, bp, pixel, fp */
  388. 2, 33, 480, 10 /* V sync, bp, line, fp */
  389. },
  390. { /* 640x480@60 CVT */
  391. 23750000, /* pixel clock */
  392. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  393. 64, 80, 640, 16, /* H sync, bp, pixel, fp */
  394. 4, 13, 480, 3 /* V sync, bp, line, fp */
  395. },
  396. { /* 640x480@75 DMT */
  397. 31500000, /* pixel clock */
  398. VPP_OPT_FPS_VAL(75), /* option */
  399. 64, 120, 640, 16, /* H sync, bp, pixel, fp */
  400. 3, 16, 480, 1 /* V sync, bp, line, fp */
  401. },
  402. { /* 640x480@75 CVT */
  403. 30750000, /* pixel clock */
  404. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  405. 64, 88, 640, 24, /* H sync, bp, pixel, fp */
  406. 4, 17, 480, 3 /* V sync, bp, line, fp */
  407. },
  408. { /* 720x480p@60 CEA861 */
  409. 27027060, /* pixel clock */
  410. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x480p60_16x9), /* option */
  411. 62, 60, 720, 16, /* H sync, bp, pixel, fp */
  412. 6, 30, 480, 9 /* V sync, bp, line, fp */
  413. },
  414. { /* 720x480i@60 CEA861 */
  415. 13514000, /* pixel clock */
  416. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x480p60_16x9)+VPP_OPT_INTERLACE, /* option */
  417. 62, 57, 720, 19, /* H sync, bp, pixel, fp */
  418. 3, 15, 240, 4 /* V sync, bp, line, fp */
  419. },
  420. { /* 720x480i@60 CEA861 */
  421. 13514000, /* pixel clock */
  422. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x480p60_16x9)+VPP_OPT_INTERLACE, /* option */
  423. 62, 57, 720, 19, /* H sync, bp, pixel, fp */
  424. 3, 16, 240, 4 /* V sync, bp, line, fp */
  425. },
  426. { /* 720x576p@50 CEA861 */
  427. 27000000, /* pixel clock */
  428. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x576p50_16x9), /* option */
  429. 64, 68, 720, 12, /* H sync, bp, pixel, fp */
  430. 5, 39, 576, 5 /* V sync, bp, line, fp */
  431. },
  432. { /* 720x576i@50 */ /* Twin mode */
  433. 13514000, /* pixel clock */
  434. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x576p50_16x9)+VPP_OPT_INTERLACE, /* option */
  435. 63, 69, 720, 12, /* H sync, bp, pixel, fp */
  436. 3, 19, 288, 2 /* V sync, bp, line, fp */
  437. },
  438. { /* 720x576i@50 CEA861 */
  439. 13514000, /* pixel clock */
  440. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_720x576p50_16x9)+VPP_OPT_INTERLACE, /* option */
  441. 63, 69, 720, 12, /* H sync, bp, pixel, fp */
  442. 3, 20, 288, 2 /* V sync, bp, line, fp */
  443. },
  444. #if(WMT_CUR_PID == WMT_PID_8650)
  445. { /* 800x480@60 LCD */
  446. 33333333, /* pixel clock */
  447. VPP_OPT_FPS_VAL(60), /* option */
  448. 1, 45, 800, 210, /* H sync, bp, pixel, fp */
  449. 1, 22, 480, 22 /* V sync, bp, line, fp */
  450. },
  451. #else
  452. { /* 800x480@60 CVT */
  453. 29500000, /* pixel clock */
  454. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  455. 72, 96, 800, 24, /* H sync, bp, pixel, fp */
  456. 7, 10, 480, 3 /* V sync, bp, line, fp */
  457. },
  458. #endif
  459. { /* 800x480@75 CVT */
  460. 38500000, /* pixel clock */
  461. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  462. 80, 112, 800, 32, /* H sync, bp, pixel, fp */
  463. 7, 14, 480, 3 /* V sync, bp, line, fp */
  464. },
  465. { /* 800x600@60 DMT */
  466. 40000000, /* pixel clock */
  467. VPP_OPT_FPS_VAL(60)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  468. 128, 88, 800, 40, /* H sync, bp, pixel, fp */
  469. 4, 23, 600, 1 /* V sync, bp, line, fp */
  470. },
  471. { /* 800x600@60 CVT */
  472. 38250000, /* pixel clock */
  473. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  474. 80, 112, 800, 32, /* H sync, bp, pixel, fp */
  475. 4, 17, 600, 3 /* V sync, bp, line, fp */
  476. },
  477. { /* 800x600@75 DMT */
  478. 49500000, /* pixel clock */
  479. VPP_OPT_FPS_VAL(75)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  480. 80, 160, 800, 16, /* H sync, bp, pixel, fp */
  481. 3, 21, 600, 1 /* V sync, bp, line, fp */
  482. },
  483. { /* 800x600@75 CVT */
  484. 49000000, /* pixel clock */
  485. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  486. 80, 120, 800, 40, /* H sync, bp, pixel, fp */
  487. 4, 22, 600, 3 /* V sync, bp, line, fp */
  488. },
  489. { /* 1024x600@60 DMT */
  490. 49000000, /* pixel clock */
  491. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  492. 104, 144, 1024, 40, /* H sync, bp, pixel, fp */
  493. 10, 11, 600, 3 /* V sync, bp, line, fp */
  494. },
  495. { /* 1024x768@60 DMT */
  496. 65000000, /* pixel clock */
  497. VPP_OPT_FPS_VAL(60), /* option */
  498. 136, 160, 1024, 24, /* H sync, bp, pixel, fp */
  499. 6, 29, 768, 3 /* V sync, bp, line, fp */
  500. },
  501. { /* 1024x768@60 CVT */
  502. 63500000, /* pixel clock */
  503. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  504. 104, 152, 1024, 48, /* H sync, bp, pixel, fp */
  505. 4, 23, 768, 3 /* V sync, bp, line, fp */
  506. },
  507. { /* 1024x768@75 DMT */
  508. 78750000, /* pixel clock */
  509. VPP_OPT_FPS_VAL(75)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  510. 96, 176, 1024, 16, /* H sync, bp, pixel, fp */
  511. 3, 28, 768, 1 /* V sync, bp, line, fp */
  512. },
  513. { /* 1024x768@75 CVT */
  514. 82000000, /* pixel clock */
  515. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  516. 104, 168, 1024, 64, /* H sync, bp, pixel, fp */
  517. 4, 30, 768, 3 /* V sync, bp, line, fp */
  518. },
  519. { /* 1152x864@60 CVT */
  520. 81750000, /* pixel clock */
  521. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  522. 120, 184, 1152, 64, /* H sync, bp, pixel, fp */
  523. 4, 26, 864, 3 /* V sync, bp, line, fp */
  524. },
  525. { /* 1152x864@75 DMT */
  526. 108000000, /* pixel clock */
  527. VPP_OPT_FPS_VAL(75)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  528. 128, 256, 1152, 64, /* H sync, bp, pixel, fp */
  529. 3, 32, 864, 1 /* V sync, bp, line, fp */
  530. },
  531. { /* 1152x864@75 CVT */
  532. 104000000, /* pixel clock */
  533. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  534. 120, 192, 1152, 72, /* H sync, bp, pixel, fp */
  535. 4, 34, 864, 3 /* V sync, bp, line, fp */
  536. },
  537. { /* 1280x720@60 CEA861 */
  538. 74250060, /* pixel clock */
  539. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1280x720p60_16x9)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  540. 40, 220, 1280, 110, /* H sync, bp, pixel, fp */
  541. 5, 20, 720, 5 /* V sync, bp, line, fp */
  542. },
  543. { /* 1280x720@50 CEA861 */
  544. 74250050, /* pixel clock */
  545. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_1280x720p50_16x9)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  546. 40, 220, 1280, 440, /* H sync, bp, pixel, fp */
  547. 5, 20, 720, 5 /* V sync, bp, line, fp */
  548. },
  549. { /* 1280x720@60 CVT */
  550. 74500000, /* pixel clock */
  551. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  552. 128, 192, 1280, 64, /* H sync, bp, pixel, fp */
  553. 5, 20, 720, 3 /* V sync, bp, line, fp */
  554. },
  555. { /* 1280x720@75 CVT */
  556. 95750000, /* pixel clock */
  557. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  558. 128, 208, 1280, 80, /* H sync, bp, pixel, fp */
  559. 5, 27, 720, 3 /* V sync, bp, line, fp */
  560. },
  561. { /* 1280x768@60 DMT/CVT */
  562. 79500000, /* pixel clock */
  563. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  564. 128, 192, 1280, 64, /* H sync, bp, pixel, fp */
  565. 7, 20, 768, 3 /* V sync, bp, line, fp */
  566. },
  567. { /* 1280x768@75 DMT/CVT */
  568. 102250000, /* pixel clock */
  569. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  570. 128, 208, 1280, 80, /* H sync, bp, pixel, fp */
  571. 7, 27, 768, 3 /* V sync, bp, line, fp */
  572. },
  573. { /* 1280x800@60 DMT/CVT */
  574. 83500000, /* pixel clock */
  575. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  576. 128, 200, 1280, 72, /* H sync, bp, pixel, fp */
  577. 6, 22, 800, 3 /* V sync, bp, line, fp */
  578. },
  579. { /* 1280x800@75 DMT/CVT */
  580. 106500000, /* pixel clock */
  581. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  582. 128, 208, 1280, 80, /* H sync, bp, pixel, fp */
  583. 6, 29, 800, 3 /* V sync, bp, line, fp */
  584. },
  585. { /* 1280x960@60 DMT */
  586. 108000000, /* pixel clock */
  587. VPP_OPT_FPS_VAL(60)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  588. 112, 312, 1280, 96, /* H sync, bp, pixel, fp */
  589. 3, 36, 960, 1 /* V sync, bp, line, fp */
  590. },
  591. { /* 1280x960@60 CVT */
  592. 101250000, /* pixel clock */
  593. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  594. 128, 208, 1280, 80, /* H sync, bp, pixel, fp */
  595. 4, 29, 960, 3 /* V sync, bp, line, fp */
  596. },
  597. { /* 1280x960@75 CVT */
  598. 130000000, /* pixel clock */
  599. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  600. 136, 224, 1280, 88, /* H sync, bp, pixel, fp */
  601. 4, 38, 960, 3 /* V sync, bp, line, fp */
  602. },
  603. { /* 1280x1024@60 DMT */
  604. 108000000, /* pixel clock */
  605. VPP_OPT_FPS_VAL(60)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  606. 112, 248, 1280, 48, /* H sync, bp, pixel, fp */
  607. 3, 38, 1024, 1 /* V sync, bp, line, fp */
  608. },
  609. { /* 1280x1024@60 CVT */
  610. 109000000, /* pixel clock */
  611. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  612. 136, 216, 1280, 80, /* H sync, bp, pixel, fp */
  613. 7, 29, 1024, 3 /* V sync, bp, line, fp */
  614. },
  615. { /* 1280x1024@75 DMT */
  616. 135000000, /* pixel clock */
  617. VPP_OPT_FPS_VAL(75)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  618. 144, 248, 1280, 16, /* H sync, bp, pixel, fp */
  619. 3, 38, 1024, 1 /* V sync, bp, line, fp */
  620. },
  621. { /* 1280x1024@75 CVT */
  622. 138750000, /* pixel clock */
  623. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  624. 136, 224, 1280, 88, /* H sync, bp, pixel, fp */
  625. 7, 38, 1024, 3 /* V sync, bp, line, fp */
  626. },
  627. { /* 1360x768@60 */
  628. 85500000, /* pixel clock */
  629. VPP_OPT_FPS_VAL(60)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  630. 112, 256, 1360, 64, /* H sync, bp, pixel, fp */
  631. 6, 18, 768, 3 /* V sync, bp, line, fp */
  632. },
  633. { /* 1366x768@60 */
  634. 85500000, /* pixel clock */
  635. VPP_OPT_FPS_VAL(60)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  636. 143, 213, 1366, 70, /* H sync, bp, pixel, fp */
  637. 3, 24, 768, 3 /* V sync, bp, line, fp */
  638. },
  639. { /* 1400x1050@60 DMT/CVT */
  640. 121750000, /* pixel clock */
  641. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  642. 144, 232, 1400, 88, /* H sync, bp, pixel, fp */
  643. 4, 32, 1050, 3 /* V sync, bp, line, fp */
  644. },
  645. { /* 1400x1050@60+R DMT/CVT */
  646. 101000000, /* pixel clock */
  647. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  648. 32, 80, 1400, 48, /* H sync, bp, pixel, fp */
  649. 4, 23, 1050, 3 /* V sync, bp, line, fp */
  650. },
  651. { /* 1440x480p@60 CEA861 */
  652. 54054000, /* pixel clock */
  653. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1440x480p60_16x9), /* option */
  654. 124, 120, 1440, 32, /* H sync, bp, pixel, fp */
  655. 6, 30, 480, 9 /* V sync, bp, line, fp */
  656. },
  657. { /* 1440x480i@60 CEA861 */ /* Twin mode */
  658. 27000000, /* pixel clock */
  659. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1440x480i60_16x9)+VPP_OPT_INTERLACE, /* option */
  660. 124, 114, 1440, 38, /* H sync, bp, pixel, fp */
  661. 3, 15, 240, 4 /* V sync, bp, line, fp */
  662. },
  663. { /* 1440x480i@60 CEA861 */
  664. 27000000, /* pixel clock */
  665. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1440x480i60_16x9)+VPP_OPT_INTERLACE, /* option */
  666. 124, 114, 1440, 38, /* H sync, bp, pixel, fp */
  667. 3, 16, 240, 4 /* V sync, bp, line, fp */
  668. },
  669. { /* 1440x576i@50 */ /* Twin mode */
  670. 27000000, /* pixel clock */
  671. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_1440x576i50_16x9)+VPP_OPT_INTERLACE, /* option */
  672. 126, 138, 1440, 24, /* H sync, bp, pixel, fp */
  673. 3, 19, 288, 2 /* V sync, bp, line, fp */
  674. },
  675. { /* 1440x576i@50 CEA861 */
  676. 27000000, /* pixel clock */
  677. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_1440x576i50_16x9)+VPP_OPT_INTERLACE, /* option */
  678. 126, 138, 1440, 24, /* H sync, bp, pixel, fp */
  679. 3, 20, 288, 2 /* V sync, bp, line, fp */
  680. },
  681. { /* 1440x900@60 DMT/CVT */
  682. 106500000, /* pixel clock */
  683. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  684. 152, 232, 1440, 80, /* H sync, bp, pixel, fp */
  685. 6, 25, 900, 3 /* V sync, bp, line, fp */
  686. },
  687. { /* 1440x900@75 DMT/CVT */
  688. 136750000, /* pixel clock */
  689. VPP_OPT_FPS_VAL(75)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  690. 152, 248, 1440, 96, /* H sync, bp, pixel, fp */
  691. 6, 33, 900, 3 /* V sync, bp, line, fp */
  692. },
  693. { /* 1600x1200@60 DMT/CVT */
  694. 162000000, /* pixel clock */
  695. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  696. 192, 304, 1600, 64, /* H sync, bp, pixel, fp */
  697. 3, 46, 1200, 1 /* V sync, bp, line, fp */
  698. },
  699. { /* 1680x1050@60 DMT/CVT */
  700. 146250000, /* pixel clock */
  701. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  702. 176, 280, 1680, 104, /* H sync, bp, pixel, fp */
  703. 6, 30, 1050, 3 /* V sync, bp, line, fp */
  704. },
  705. { /* 1920x1080p@60 */
  706. 148500000, /* pixel clock */
  707. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p60_16x9)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  708. 44, 148, 1920, 88, /* H sync, bp, pixel, fp */
  709. 5, 36, 1080, 4 /* V sync, bp, line, fp */
  710. },
  711. { /* 1920x1080p@25 CEA861 */
  712. 74250025, /* pixel clock */
  713. VPP_OPT_FPS_VAL(25)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p25_16x9)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  714. 44, 148, 1920, 528, /* H sync, bp, pixel, fp */
  715. 5, 36, 1080, 4 /* V sync, bp, line, fp */
  716. },
  717. { /* 1920x1080p@30 CEA861 */
  718. 74250030, /* pixel clock */
  719. VPP_OPT_FPS_VAL(30)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p30_16x9)+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  720. 44, 148, 1920, 88, /* H sync, bp, pixel, fp */
  721. 5, 36, 1080, 4 /* V sync, bp, line, fp */
  722. },
  723. { /* 1920x1080i@50 */ /* Twin mode */
  724. 74250050, /* pixel clock */
  725. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p50_16x9)+VPP_OPT_INTERLACE+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  726. 44, 148, 1920, 528, /* H sync, bp, pixel, fp */
  727. 5, 15, 540, 2 /* V sync, bp, line, fp */
  728. },
  729. { /* 1920x1080i@50 CEA861 */
  730. 74250050, /* pixel clock */
  731. VPP_OPT_FPS_VAL(50)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p50_16x9)+VPP_OPT_INTERLACE+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  732. 44, 148, 1920, 528, /* H sync, bp, pixel, fp */
  733. 5, 16, 540, 2 /* V sync, bp, line, fp */
  734. },
  735. { /* 1920x1080i@60 */ /* Twin mode */
  736. 74250060, /* pixel clock */
  737. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p60_16x9)+VPP_OPT_INTERLACE+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  738. 44, 148, 1920, 88, /* H sync, bp, pixel, fp */
  739. 5, 15, 540, 2 /* V sync, bp, line, fp */
  740. },
  741. { /* 1920x1080i@60 CEA861 */
  742. 74250060, /* pixel clock */
  743. VPP_OPT_FPS_VAL(60)+VPP_OPT_HDMI_VIC_VAL(HDMI_1920x1080p60_16x9)+VPP_OPT_INTERLACE+VPP_VGA_HSYNC_POLAR_HI+VPP_VGA_VSYNC_POLAR_HI, /* option */
  744. 44, 148, 1920, 88, /* H sync, bp, pixel, fp */
  745. 5, 16, 540, 2 /* V sync, bp, line, fp */
  746. },
  747. { /* 1920x1200p@60 DMT/CVT */
  748. 193250000, /* pixel clock */
  749. VPP_OPT_FPS_VAL(60)+VPP_VGA_VSYNC_POLAR_HI, /* option */
  750. 200, 336, 1920, 136, /* H sync, bp, pixel, fp */
  751. 6, 36, 1200, 3 /* V sync, bp, line, fp */
  752. },
  753. { 0 }
  754. };
  755.  
  756. const char *vpp_vout_str[] = {"SDA","SDD","LCD","DVI","HDMI","DVO2HDMI","DVO","VGA"};
  757. unsigned int vpp_vo_boot_arg[6] = {0xFF};
  758. unsigned int vpp_vo_boot_arg2[6] = {0xFF};
  759. char *vpp_colfmt_str[] = {"YUV420","YUV422H","YUV422V","YUV444","YUV411","GRAY","ARGB","AUTO","RGB888","RGB666","RGB565","RGB1555","RGB5551"};
  760.  
  761. #else
  762. #define EXTERN extern
  763.  
  764. extern const unsigned int vpp_csc_parm[VPP_CSC_MAX][7];
  765. extern char *vpp_colfmt_str[];
  766. extern const vpp_timing_t vpp_video_mode_table[];
  767. extern const char *vpp_vout_str[];
  768. extern unsigned int vpp_vo_boot_arg[6];
  769. extern unsigned int vpp_vo_boot_arg2[6];
  770.  
  771. #endif
  772.  
  773. EXTERN vpp_info_t g_vpp;
  774.  
  775. static __inline__ int vpp_get_hdmi_spdif(void)
  776. {
  777. return (g_vpp.hdmi_audio_interface == VPP_HDMI_AUDIO_SPDIF)? 1:0;
  778. }
  779.  
  780. //Internal functions
  781. EXTERN int get_key(void);
  782. EXTERN U8 vppif_reg8_in(U32 offset);
  783. EXTERN U8 vppif_reg8_out(U32 offset, U8 val);
  784. EXTERN U16 vppif_reg16_in(U32 offset);
  785. EXTERN U16 vppif_reg16_out(U32 offset, U16 val);
  786. EXTERN U32 vppif_reg32_in(U32 offset);
  787. EXTERN U32 vppif_reg32_out(U32 offset, U32 val);
  788. EXTERN U32 vppif_reg32_write(U32 offset, U32 mask, U32 shift, U32 val);
  789. EXTERN U32 vppif_reg32_read(U32 offset, U32 mask, U32 shift);
  790. EXTERN U32 vppif_reg32_mask(U32 offset, U32 mask, U32 shift);
  791. EXTERN int vpp_check_dbg_level(vpp_dbg_level_t level);
  792. EXTERN void vpp_set_dbg_gpio(int no,int value);
  793. EXTERN unsigned int vpp_get_chipid(void);
  794.  
  795. //Export functions
  796. EXTERN void vpp_mod_unregister(vpp_mod_t mod);
  797. EXTERN vpp_mod_base_t *vpp_mod_register(vpp_mod_t mod,int size,unsigned int flags);
  798. EXTERN vpp_mod_base_t *vpp_mod_get_base(vpp_mod_t mod);
  799. EXTERN vpp_fb_base_t *vpp_mod_get_fb_base(vpp_mod_t mod);
  800. EXTERN vdo_framebuf_t *vpp_mod_get_framebuf(vpp_mod_t mod);
  801. EXTERN void vpp_mod_set_timing(vpp_mod_t mod,vpp_timing_t *tmr);
  802. EXTERN void vpp_mod_init(void);
  803.  
  804. EXTERN unsigned int vpp_get_base_clock(vpp_mod_t mod);
  805. EXTERN void vpp_set_video_scale(vdo_view_t *vw);
  806. EXTERN int vpp_set_recursive_scale(vdo_framebuf_t *src_fb,vdo_framebuf_t *dst_fb);
  807. EXTERN vpp_display_format_t vpp_get_fb_field(vdo_framebuf_t *fb);
  808. EXTERN void vpp_wait_vsync(void);
  809. EXTERN int vpp_irqproc_flag(vpp_int_t type, int * flag, int wait);
  810. EXTERN int vpp_irqproc_work(vpp_int_t type, int(* func)(void * argc), void * arg, int wait);
  811. EXTERN int vpp_get_gcd(int A, int B);
  812. EXTERN unsigned int vpp_calculate_diff(unsigned int val1,unsigned int val2);
  813. EXTERN void vpp_check_scale_ratio(int *src,int *dst,int max,int min);
  814. EXTERN void vpp_calculate_timing(vpp_mod_t mod,unsigned int fps,vpp_clock_t *tmr);
  815. EXTERN void vpp_fill_framebuffer(vdo_framebuf_t *fb,unsigned int x,unsigned int y,unsigned int w,unsigned int h,unsigned int color);
  816. EXTERN vpp_csc_t vpp_check_csc_mode(vpp_csc_t mode,vdo_color_fmt src_fmt,vdo_color_fmt dst_fmt,unsigned int flags);
  817. EXTERN void vpp_trans_timing(vpp_mod_t mod,vpp_timing_t *tmr,vpp_clock_t *hw_tmr,int to_hw);
  818. EXTERN void vpp_fill_pattern(vpp_mod_t mod,int no,int arg);
  819. EXTERN unsigned int vpp_get_vmode_pixel_clock(unsigned int resx,unsigned int resy,unsigned int fps);
  820. EXTERN vpp_timing_t *vpp_get_video_mode(unsigned int resx,unsigned int resy,unsigned int pixel_clock);
  821. EXTERN void vpp_set_video_mode(unsigned int resx,unsigned int resy,unsigned int pixel_clock);
  822. EXTERN void vpp_set_video_quality(int mode);
  823. EXTERN unsigned int vpp_get_video_mode_fps(vpp_timing_t *timing);
  824. EXTERN void vpp_calculate_clock(vpp_base_clock_t *clk,unsigned int div_max,unsigned int base_mask);
  825. EXTERN void vpp_govw_dynamic_tg_set_rcyc(int rcyc);
  826. EXTERN void vpp_govw_dynamic_tg(int err);
  827. EXTERN void vpp_set_vppm_int_enable(vpp_int_t int_bit,int enable);
  828. EXTERN __inline__ void vpp_cache_sync(void);
  829.  
  830. #ifdef __KERNEL__
  831. /* dev-vpp.c */
  832. EXTERN void vpp_get_info(struct fb_var_screeninfo *var);
  833. EXTERN int vpp_config(struct fb_info *info);
  834. EXTERN int vpp_mmap(struct vm_area_struct *vma);
  835. EXTERN int vpp_ioctl(unsigned int cmd,unsigned long arg);
  836. EXTERN int vpp_dev_init(void);
  837. EXTERN int vpp_i2c_write(unsigned int addr,unsigned int index,char *pdata,int len);
  838. EXTERN int vpp_i2c_read(unsigned int addr,unsigned int index,char *pdata,int len);
  839. EXTERN int vpp_i2c_enhanced_ddc_read(unsigned int addr,unsigned int index,char *pdata,int len);
  840. EXTERN int vpp_i2c0_read(unsigned int addr,unsigned int index,char *pdata,int len) ;
  841. EXTERN int vpp_suspend(int state);
  842. EXTERN int vpp_resume(void);
  843. EXTERN unsigned int *vpp_backup_reg(unsigned int addr,unsigned int size);
  844. EXTERN int vpp_restore_reg(unsigned int addr,unsigned int size,unsigned int *reg_ptr);
  845. EXTERN int vpp_pan_display(struct fb_var_screeninfo *var, struct fb_info *info,int enable);
  846. #endif
  847.  
  848. EXTERN void vpp_show_fb(vdo_framebuf_t *fb);
  849. EXTERN void vpp_reg_dump(unsigned int addr,int size);
  850. EXTERN int vpp_irqproc_enable_govw(void *arg);
  851. EXTERN int vpp_irqproc_disable_disp(void *arg);
  852. EXTERN int vpp_irqproc_enable_vpu(void *arg);
  853. EXTERN unsigned int vpp_convert_colfmt(int yuv2rgb,unsigned int data);
  854.  
  855. EXTERN void vpp_set_govw_tg(int enable);
  856. EXTERN void vpp_set_govm_path(vpp_path_t in_path, vpp_flag_t enable);
  857. EXTERN vpp_path_t vpp_get_govm_path(void);
  858.  
  859. #undef EXTERN
  860.  
  861. #ifdef __cplusplus
  862. }
  863. #endif
  864. #endif //VPP_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement