Duy Truong | e833aca | 2013-02-12 13:35:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 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 |
| 16 | |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 17 | #define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE) |
Terence Hampson | 98d1180 | 2012-06-06 18:18:43 -0400 | [diff] [blame] | 18 | |
| 19 | #define VCAP_GENERIC_NOTIFY_EVENT 0 |
| 20 | #define VCAP_VC_PIX_ERR_EVENT 1 |
| 21 | #define VCAP_VC_LINE_ERR_EVENT 2 |
| 22 | #define VCAP_VC_VSYNC_ERR_EVENT 3 |
| 23 | #define VCAP_VC_NPL_OFLOW_ERR_EVENT 4 |
| 24 | #define VCAP_VC_LBUF_OFLOW_ERR_EVENT 5 |
| 25 | #define VCAP_VC_BUF_OVERWRITE_EVENT 6 |
| 26 | #define VCAP_VP_REG_R_ERR_EVENT 7 |
| 27 | #define VCAP_VP_REG_W_ERR_EVENT 8 |
| 28 | #define VCAP_VP_IN_HEIGHT_ERR_EVENT 9 |
| 29 | #define VCAP_VP_IN_WIDTH_ERR_EVENT 10 |
| 30 | #define VCAP_MAX_NOTIFY_EVENT 11 |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 31 | |
| 32 | enum hal_vcap_mode { |
| 33 | HAL_VCAP_MODE_PRO = 0, |
| 34 | HAL_VCAP_MODE_INT, |
| 35 | }; |
| 36 | |
| 37 | enum hal_vcap_polar { |
| 38 | HAL_VCAP_POLAR_NEG = 0, |
| 39 | HAL_VCAP_POLAR_POS, |
| 40 | }; |
| 41 | |
| 42 | enum hal_vcap_color { |
| 43 | HAL_VCAP_YUV = 0, |
| 44 | HAL_VCAP_RGB, |
| 45 | }; |
| 46 | |
Terence Hampson | 3dff4ef | 2012-06-13 15:20:59 -0400 | [diff] [blame] | 47 | enum nr_mode { |
| 48 | NR_DISABLE = 0, |
| 49 | NR_AUTO, |
| 50 | NR_MANUAL, |
| 51 | }; |
| 52 | |
| 53 | enum nr_decay_ratio { |
| 54 | NR_Decay_Ratio_26 = 0, |
| 55 | NR_Decay_Ratio_25, |
| 56 | NR_Decay_Ratio_24, |
| 57 | NR_Decay_Ratio_23, |
| 58 | NR_Decay_Ratio_22, |
| 59 | NR_Decay_Ratio_21, |
| 60 | NR_Decay_Ratio_20, |
| 61 | NR_Decay_Ratio_19, |
| 62 | }; |
| 63 | |
| 64 | struct nr_config { |
| 65 | uint8_t max_blend_ratio; |
| 66 | uint8_t scale_diff_ratio; |
| 67 | uint8_t diff_limit_ratio; |
| 68 | uint8_t scale_motion_ratio; |
| 69 | uint8_t blend_limit_ratio; |
| 70 | }; |
| 71 | |
| 72 | struct nr_param { |
| 73 | enum nr_mode mode; |
| 74 | enum nr_decay_ratio decay_ratio; |
| 75 | uint8_t window; |
| 76 | struct nr_config luma; |
| 77 | struct nr_config chroma; |
| 78 | }; |
| 79 | |
| 80 | #define VCAPIOC_NR_S_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+0), struct nr_param) |
| 81 | |
| 82 | #define VCAPIOC_NR_G_PARAMS _IOWR('V', (BASE_VIDIOC_PRIVATE+1), struct nr_param) |
| 83 | |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 84 | struct v4l2_format_vc_ext { |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 85 | enum hal_vcap_mode mode; |
| 86 | enum hal_vcap_polar h_polar; |
| 87 | enum hal_vcap_polar v_polar; |
| 88 | enum hal_vcap_polar d_polar; |
| 89 | enum hal_vcap_color color_space; |
| 90 | |
Terence Hampson | 779dc76 | 2012-06-07 15:59:27 -0400 | [diff] [blame] | 91 | uint32_t clk_freq; |
| 92 | uint32_t frame_rate; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 93 | uint32_t vtotal; |
| 94 | uint32_t htotal; |
| 95 | uint32_t hactive_start; |
| 96 | uint32_t hactive_end; |
| 97 | uint32_t vactive_start; |
| 98 | uint32_t vactive_end; |
| 99 | uint32_t vsync_start; |
| 100 | uint32_t vsync_end; |
| 101 | uint32_t hsync_start; |
| 102 | uint32_t hsync_end; |
| 103 | uint32_t f2_vactive_start; |
| 104 | uint32_t f2_vactive_end; |
| 105 | uint32_t f2_vsync_h_start; |
| 106 | uint32_t f2_vsync_h_end; |
| 107 | uint32_t f2_vsync_v_start; |
| 108 | uint32_t f2_vsync_v_end; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 109 | uint32_t sizeimage; |
| 110 | uint32_t bytesperline; |
| 111 | }; |
| 112 | |
| 113 | enum vcap_type { |
| 114 | VC_TYPE, |
| 115 | VP_IN_TYPE, |
| 116 | VP_OUT_TYPE, |
| 117 | }; |
| 118 | |
| 119 | struct vcap_priv_fmt { |
| 120 | enum vcap_type type; |
| 121 | union { |
| 122 | struct v4l2_format_vc_ext timing; |
Terence Hampson | aeb793e | 2012-05-11 11:41:16 -0400 | [diff] [blame] | 123 | struct v4l2_pix_format pix; |
Terence Hampson | 7d5bfbc | 2012-05-08 13:33:48 -0400 | [diff] [blame] | 124 | /* Once VP is created there will be another type in here */ |
| 125 | } u; |
Terence Hampson | a6914ca | 2012-04-09 14:06:50 -0400 | [diff] [blame] | 126 | }; |
| 127 | #endif |