Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef VCAP_FMT_H |
| 15 | #define VCAP_FMT_H |
Terence Hampson | d75869e | 2012-09-21 11:13:04 -0400 | [diff] [blame] | 16 | #include <linux/videodev2.h> |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 17 | |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 18 | #define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE) |
Terence Hampson | 98d1180 | 2012-06-06 18:18:43 -0400 | [diff] [blame] | 19 | |
| 20 | #define VCAP_GENERIC_NOTIFY_EVENT 0 |
| 21 | #define VCAP_VC_PIX_ERR_EVENT 1 |
| 22 | #define VCAP_VC_LINE_ERR_EVENT 2 |
| 23 | #define VCAP_VC_VSYNC_ERR_EVENT 3 |
| 24 | #define VCAP_VC_NPL_OFLOW_ERR_EVENT 4 |
| 25 | #define VCAP_VC_LBUF_OFLOW_ERR_EVENT 5 |
| 26 | #define VCAP_VC_BUF_OVERWRITE_EVENT 6 |
Terence Hampson | aa64d3a | 2012-10-29 13:05:37 -0400 | [diff] [blame] | 27 | #define VCAP_VC_VSYNC_SEQ_ERR 7 |
| 28 | #define VCAP_VP_REG_R_ERR_EVENT 8 |
| 29 | #define VCAP_VP_REG_W_ERR_EVENT 9 |
| 30 | #define VCAP_VP_IN_HEIGHT_ERR_EVENT 10 |
| 31 | #define VCAP_VP_IN_WIDTH_ERR_EVENT 11 |
| 32 | #define VCAP_VC_UNEXPECT_BUF_DONE 12 |
| 33 | #define VCAP_MAX_NOTIFY_EVENT 13 |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 34 | |
| 35 | enum hal_vcap_mode { |
| 36 | HAL_VCAP_MODE_PRO = 0, |
| 37 | HAL_VCAP_MODE_INT, |
| 38 | }; |
| 39 | |
| 40 | enum hal_vcap_polar { |
| 41 | HAL_VCAP_POLAR_NEG = 0, |
| 42 | HAL_VCAP_POLAR_POS, |
| 43 | }; |
| 44 | |
| 45 | enum hal_vcap_color { |
| 46 | HAL_VCAP_YUV = 0, |
| 47 | HAL_VCAP_RGB, |
| 48 | }; |
| 49 | |
Terence Hampson | 3dff4ef | 2012-06-13 15:20:59 -0400 | [diff] [blame] | 50 | enum nr_mode { |
| 51 | NR_DISABLE = 0, |
| 52 | NR_AUTO, |
| 53 | NR_MANUAL, |
| 54 | }; |
| 55 | |
| 56 | enum nr_decay_ratio { |
| 57 | NR_Decay_Ratio_26 = 0, |
| 58 | NR_Decay_Ratio_25, |
| 59 | NR_Decay_Ratio_24, |
| 60 | NR_Decay_Ratio_23, |
| 61 | NR_Decay_Ratio_22, |
| 62 | NR_Decay_Ratio_21, |
| 63 | NR_Decay_Ratio_20, |
| 64 | NR_Decay_Ratio_19, |
| 65 | }; |
| 66 | |
| 67 | struct nr_config { |
| 68 | uint8_t max_blend_ratio; |
| 69 | uint8_t scale_diff_ratio; |
| 70 | uint8_t diff_limit_ratio; |
| 71 | uint8_t scale_motion_ratio; |
| 72 | uint8_t blend_limit_ratio; |
| 73 | }; |
| 74 | |
| 75 | struct nr_param { |
| 76 | enum nr_mode mode; |
| 77 | enum nr_decay_ratio decay_ratio; |
| 78 | uint8_t window; |
| 79 | struct nr_config luma; |
| 80 | struct nr_config chroma; |
| 81 | }; |
| 82 | |
| 83 | #define VCAPIOC_NR_S_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+0), struct nr_param) |
| 84 | |
| 85 | #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] | 86 | #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] | 87 | |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 88 | struct v4l2_format_vc_ext { |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 89 | enum hal_vcap_mode mode; |
| 90 | enum hal_vcap_polar h_polar; |
| 91 | enum hal_vcap_polar v_polar; |
| 92 | enum hal_vcap_polar d_polar; |
| 93 | enum hal_vcap_color color_space; |
| 94 | |
Terence Hampson | 779dc76 | 2012-06-07 15:59:27 -0400 | [diff] [blame] | 95 | uint32_t clk_freq; |
| 96 | uint32_t frame_rate; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 97 | uint32_t vtotal; |
| 98 | uint32_t htotal; |
| 99 | uint32_t hactive_start; |
| 100 | uint32_t hactive_end; |
| 101 | uint32_t vactive_start; |
| 102 | uint32_t vactive_end; |
| 103 | uint32_t vsync_start; |
| 104 | uint32_t vsync_end; |
| 105 | uint32_t hsync_start; |
| 106 | uint32_t hsync_end; |
| 107 | uint32_t f2_vactive_start; |
| 108 | uint32_t f2_vactive_end; |
| 109 | uint32_t f2_vsync_h_start; |
| 110 | uint32_t f2_vsync_h_end; |
| 111 | uint32_t f2_vsync_v_start; |
| 112 | uint32_t f2_vsync_v_end; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 113 | uint32_t sizeimage; |
| 114 | uint32_t bytesperline; |
| 115 | }; |
| 116 | |
| 117 | enum vcap_type { |
| 118 | VC_TYPE, |
| 119 | VP_IN_TYPE, |
| 120 | VP_OUT_TYPE, |
| 121 | }; |
| 122 | |
Terence Hampson | df1d4de | 2012-11-05 17:06:02 -0500 | [diff] [blame^] | 123 | enum vcap_stride { |
| 124 | VC_STRIDE_16, |
| 125 | VC_STRIDE_32, |
| 126 | }; |
| 127 | |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 128 | struct vcap_priv_fmt { |
| 129 | enum vcap_type type; |
Terence Hampson | df1d4de | 2012-11-05 17:06:02 -0500 | [diff] [blame^] | 130 | enum vcap_stride stride; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 131 | union { |
| 132 | struct v4l2_format_vc_ext timing; |
Terence Hampson | aeb793e | 2012-05-11 11:41:16 -0400 | [diff] [blame] | 133 | struct v4l2_pix_format pix; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 134 | /* Once VP is created there will be another type in here */ |
| 135 | } u; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 136 | }; |
| 137 | #endif |