Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 1 | #ifndef VCAP_FMT_H |
| 2 | #define VCAP_FMT_H |
Terence Hampson | d75869e | 2012-09-21 11:13:04 -0400 | [diff] [blame] | 3 | #include <linux/videodev2.h> |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 4 | |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 5 | #define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE) |
Terence Hampson | 98d1180 | 2012-06-06 18:18:43 -0400 | [diff] [blame] | 6 | |
| 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 Hampson | aa64d3a | 2012-10-29 13:05:37 -0400 | [diff] [blame] | 14 | #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 Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 21 | |
| 22 | enum hal_vcap_mode { |
| 23 | HAL_VCAP_MODE_PRO = 0, |
| 24 | HAL_VCAP_MODE_INT, |
| 25 | }; |
| 26 | |
| 27 | enum hal_vcap_polar { |
Terence Hampson | cff7743 | 2012-11-30 19:14:43 -0500 | [diff] [blame] | 28 | HAL_VCAP_POLAR_POS = 0, |
| 29 | HAL_VCAP_POLAR_NEG, |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | enum hal_vcap_color { |
| 33 | HAL_VCAP_YUV = 0, |
| 34 | HAL_VCAP_RGB, |
| 35 | }; |
| 36 | |
Terence Hampson | 6a744e3 | 2012-12-07 15:50:32 -0500 | [diff] [blame] | 37 | enum nr_threshold_mode { |
| 38 | NR_THRESHOLD_STATIC = 0, |
| 39 | NR_THRESHOLD_DYNAMIC, |
| 40 | }; |
| 41 | |
Terence Hampson | 3dff4ef | 2012-06-13 15:20:59 -0400 | [diff] [blame] | 42 | enum nr_mode { |
| 43 | NR_DISABLE = 0, |
| 44 | NR_AUTO, |
| 45 | NR_MANUAL, |
| 46 | }; |
| 47 | |
| 48 | enum 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 | |
| 59 | struct 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 | |
| 67 | struct nr_param { |
Terence Hampson | 6a744e3 | 2012-12-07 15:50:32 -0500 | [diff] [blame] | 68 | enum nr_threshold_mode threshold; |
Terence Hampson | 3dff4ef | 2012-06-13 15:20:59 -0400 | [diff] [blame] | 69 | 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 Hampson | 2cba63f | 2012-08-21 10:54:38 -0400 | [diff] [blame] | 79 | #define VCAPIOC_S_NUM_VC_BUF _IOWR('V', (BASE_VIDIOC_PRIVATE+2), int) |
Terence Hampson | 3dff4ef | 2012-06-13 15:20:59 -0400 | [diff] [blame] | 80 | |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 81 | struct v4l2_format_vc_ext { |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 82 | 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 Hampson | 779dc76 | 2012-06-07 15:59:27 -0400 | [diff] [blame] | 88 | uint32_t clk_freq; |
| 89 | uint32_t frame_rate; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 90 | 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 Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 106 | uint32_t sizeimage; |
| 107 | uint32_t bytesperline; |
| 108 | }; |
| 109 | |
| 110 | enum vcap_type { |
| 111 | VC_TYPE, |
| 112 | VP_IN_TYPE, |
| 113 | VP_OUT_TYPE, |
| 114 | }; |
| 115 | |
Terence Hampson | df1d4de | 2012-11-05 17:06:02 -0500 | [diff] [blame] | 116 | enum vcap_stride { |
| 117 | VC_STRIDE_16, |
| 118 | VC_STRIDE_32, |
| 119 | }; |
| 120 | |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 121 | struct vcap_priv_fmt { |
| 122 | enum vcap_type type; |
Terence Hampson | df1d4de | 2012-11-05 17:06:02 -0500 | [diff] [blame] | 123 | enum vcap_stride stride; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 124 | union { |
| 125 | struct v4l2_format_vc_ext timing; |
Terence Hampson | aeb793e | 2012-05-11 11:41:16 -0400 | [diff] [blame] | 126 | struct v4l2_pix_format pix; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 127 | /* Once VP is created there will be another type in here */ |
| 128 | } u; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 129 | }; |
| 130 | #endif |