blob: b2a8d1041dd9b6de18418f9161e107a808d965fe [file] [log] [blame]
Terence Hampsona6914ca2012-04-09 14:06:50 -04001#ifndef VCAP_FMT_H
2#define VCAP_FMT_H
Terence Hampsond75869e2012-09-21 11:13:04 -04003#include <linux/videodev2.h>
Terence Hampsona6914ca2012-04-09 14:06:50 -04004
Terence Hampson7d5bfbc2012-05-08 13:33:48 -04005#define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE)
Terence Hampson98d11802012-06-06 18:18:43 -04006
7#define VCAP_GENERIC_NOTIFY_EVENT 0
8#define VCAP_VC_PIX_ERR_EVENT 1
9#define VCAP_VC_LINE_ERR_EVENT 2
10#define VCAP_VC_VSYNC_ERR_EVENT 3
11#define VCAP_VC_NPL_OFLOW_ERR_EVENT 4
12#define VCAP_VC_LBUF_OFLOW_ERR_EVENT 5
13#define VCAP_VC_BUF_OVERWRITE_EVENT 6
Terence Hampsonaa64d3a2012-10-29 13:05:37 -040014#define VCAP_VC_VSYNC_SEQ_ERR 7
15#define VCAP_VP_REG_R_ERR_EVENT 8
16#define VCAP_VP_REG_W_ERR_EVENT 9
17#define VCAP_VP_IN_HEIGHT_ERR_EVENT 10
18#define VCAP_VP_IN_WIDTH_ERR_EVENT 11
19#define VCAP_VC_UNEXPECT_BUF_DONE 12
20#define VCAP_MAX_NOTIFY_EVENT 13
Terence Hampsona6914ca2012-04-09 14:06:50 -040021
22enum hal_vcap_mode {
23 HAL_VCAP_MODE_PRO = 0,
24 HAL_VCAP_MODE_INT,
25};
26
27enum hal_vcap_polar {
Terence Hampsoncff77432012-11-30 19:14:43 -050028 HAL_VCAP_POLAR_POS = 0,
29 HAL_VCAP_POLAR_NEG,
Terence Hampsona6914ca2012-04-09 14:06:50 -040030};
31
32enum hal_vcap_color {
33 HAL_VCAP_YUV = 0,
34 HAL_VCAP_RGB,
35};
36
Terence Hampson6a744e32012-12-07 15:50:32 -050037enum nr_threshold_mode {
38 NR_THRESHOLD_STATIC = 0,
39 NR_THRESHOLD_DYNAMIC,
40};
41
Terence Hampson3dff4ef2012-06-13 15:20:59 -040042enum nr_mode {
43 NR_DISABLE = 0,
44 NR_AUTO,
45 NR_MANUAL,
46};
47
48enum nr_decay_ratio {
49 NR_Decay_Ratio_26 = 0,
50 NR_Decay_Ratio_25,
51 NR_Decay_Ratio_24,
52 NR_Decay_Ratio_23,
53 NR_Decay_Ratio_22,
54 NR_Decay_Ratio_21,
55 NR_Decay_Ratio_20,
56 NR_Decay_Ratio_19,
57};
58
59struct nr_config {
60 uint8_t max_blend_ratio;
61 uint8_t scale_diff_ratio;
62 uint8_t diff_limit_ratio;
63 uint8_t scale_motion_ratio;
64 uint8_t blend_limit_ratio;
65};
66
67struct nr_param {
Terence Hampson6a744e32012-12-07 15:50:32 -050068 enum nr_threshold_mode threshold;
Terence Hampson3dff4ef2012-06-13 15:20:59 -040069 enum nr_mode mode;
70 enum nr_decay_ratio decay_ratio;
71 uint8_t window;
72 struct nr_config luma;
73 struct nr_config chroma;
74};
75
76#define VCAPIOC_NR_S_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+0), struct nr_param)
77
78#define VCAPIOC_NR_G_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+1), struct nr_param)
Terence Hampson2cba63f2012-08-21 10:54:38 -040079#define VCAPIOC_S_NUM_VC_BUF _IOWR('V', (BASE_VIDIOC_PRIVATE+2), int)
Terence Hampson3dff4ef2012-06-13 15:20:59 -040080
Terence Hampsona6914ca2012-04-09 14:06:50 -040081struct v4l2_format_vc_ext {
Terence Hampsona6914ca2012-04-09 14:06:50 -040082 enum hal_vcap_mode mode;
83 enum hal_vcap_polar h_polar;
84 enum hal_vcap_polar v_polar;
85 enum hal_vcap_polar d_polar;
86 enum hal_vcap_color color_space;
87
Terence Hampson779dc762012-06-07 15:59:27 -040088 uint32_t clk_freq;
89 uint32_t frame_rate;
Terence Hampsona6914ca2012-04-09 14:06:50 -040090 uint32_t vtotal;
91 uint32_t htotal;
92 uint32_t hactive_start;
93 uint32_t hactive_end;
94 uint32_t vactive_start;
95 uint32_t vactive_end;
96 uint32_t vsync_start;
97 uint32_t vsync_end;
98 uint32_t hsync_start;
99 uint32_t hsync_end;
100 uint32_t f2_vactive_start;
101 uint32_t f2_vactive_end;
102 uint32_t f2_vsync_h_start;
103 uint32_t f2_vsync_h_end;
104 uint32_t f2_vsync_v_start;
105 uint32_t f2_vsync_v_end;
Terence Hampson7d5bfbc2012-05-08 13:33:48 -0400106 uint32_t sizeimage;
107 uint32_t bytesperline;
108};
109
110enum vcap_type {
111 VC_TYPE,
112 VP_IN_TYPE,
113 VP_OUT_TYPE,
114};
115
Terence Hampsondf1d4de2012-11-05 17:06:02 -0500116enum vcap_stride {
117 VC_STRIDE_16,
118 VC_STRIDE_32,
119};
120
Terence Hampson7d5bfbc2012-05-08 13:33:48 -0400121struct vcap_priv_fmt {
122 enum vcap_type type;
Terence Hampsondf1d4de2012-11-05 17:06:02 -0500123 enum vcap_stride stride;
Terence Hampson7d5bfbc2012-05-08 13:33:48 -0400124 union {
125 struct v4l2_format_vc_ext timing;
Terence Hampsonaeb793e2012-05-11 11:41:16 -0400126 struct v4l2_pix_format pix;
Terence Hampson7d5bfbc2012-05-08 13:33:48 -0400127 /* Once VP is created there will be another type in here */
128 } u;
Terence Hampsona6914ca2012-04-09 14:06:50 -0400129};
130#endif