blob: 00bad1eebe01bc64c614b54315a998637ab9b6dc [file] [log] [blame]
Duy Truonge833aca2013-02-12 13:35:08 -08001/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
Terence Hampsona6914ca2012-04-09 14:06:50 -04002 *
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 Hampson7d5bfbc2012-05-08 13:33:48 -040017#define V4L2_BUF_TYPE_INTERLACED_IN_DECODER (V4L2_BUF_TYPE_PRIVATE)
Terence Hampson98d11802012-06-06 18:18:43 -040018
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 Hampsona6914ca2012-04-09 14:06:50 -040031
32enum hal_vcap_mode {
33 HAL_VCAP_MODE_PRO = 0,
34 HAL_VCAP_MODE_INT,
35};
36
37enum hal_vcap_polar {
38 HAL_VCAP_POLAR_NEG = 0,
39 HAL_VCAP_POLAR_POS,
40};
41
42enum hal_vcap_color {
43 HAL_VCAP_YUV = 0,
44 HAL_VCAP_RGB,
45};
46
Terence Hampson3dff4ef2012-06-13 15:20:59 -040047enum nr_mode {
48 NR_DISABLE = 0,
49 NR_AUTO,
50 NR_MANUAL,
51};
52
53enum 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
64struct 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
72struct 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 Hampsona6914ca2012-04-09 14:06:50 -040084struct v4l2_format_vc_ext {
Terence Hampsona6914ca2012-04-09 14:06:50 -040085 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 Hampson779dc762012-06-07 15:59:27 -040091 uint32_t clk_freq;
92 uint32_t frame_rate;
Terence Hampsona6914ca2012-04-09 14:06:50 -040093 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 Hampson7d5bfbc2012-05-08 13:33:48 -0400109 uint32_t sizeimage;
110 uint32_t bytesperline;
111};
112
113enum vcap_type {
114 VC_TYPE,
115 VP_IN_TYPE,
116 VP_OUT_TYPE,
117};
118
119struct vcap_priv_fmt {
120 enum vcap_type type;
121 union {
122 struct v4l2_format_vc_ext timing;
Terence Hampsonaeb793e2012-05-11 11:41:16 -0400123 struct v4l2_pix_format pix;
Terence Hampson7d5bfbc2012-05-08 13:33:48 -0400124 /* Once VP is created there will be another type in here */
125 } u;
Terence Hampsona6914ca2012-04-09 14:06:50 -0400126};
127#endif