blob: 8e9aedfab5dfa141f569e4720f2c1fe4ab99522f [file] [log] [blame]
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -08001#ifndef __MSMB_PPROC_H
2#define __MSMB_PPROC_H
3
4#ifdef MSM_CAMERA_BIONIC
5#include <sys/types.h>
6#endif
7#include <linux/videodev2.h>
8#include <linux/types.h>
9
10/* Should be same as VIDEO_MAX_PLANES in videodev2.h */
11#define MAX_PLANES VIDEO_MAX_PLANES
12
13#define MAX_NUM_CPP_STRIPS 8
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070014#define MSM_CPP_MAX_NUM_PLANES 3
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080015
16enum msm_cpp_frame_type {
17 MSM_CPP_OFFLINE_FRAME,
18 MSM_CPP_REALTIME_FRAME,
19};
20
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -070021enum msm_vpe_frame_type {
22 MSM_VPE_OFFLINE_FRAME,
23 MSM_VPE_REALTIME_FRAME,
24};
25
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080026struct msm_cpp_frame_strip_info {
27 int scale_v_en;
28 int scale_h_en;
29
30 int upscale_v_en;
31 int upscale_h_en;
32
33 int src_start_x;
34 int src_end_x;
35 int src_start_y;
36 int src_end_y;
37
38 /* Padding is required for upscaler because it does not
39 * pad internally like other blocks, also needed for rotation
40 * rotation expects all the blocks in the stripe to be the same size
41 * Padding is done such that all the extra padded pixels
42 * are on the right and bottom
43 */
44 int pad_bottom;
45 int pad_top;
46 int pad_right;
47 int pad_left;
48
49 int v_init_phase;
50 int h_init_phase;
51 int h_phase_step;
52 int v_phase_step;
53
54 int prescale_crop_width_first_pixel;
55 int prescale_crop_width_last_pixel;
56 int prescale_crop_height_first_line;
57 int prescale_crop_height_last_line;
58
59 int postscale_crop_height_first_line;
60 int postscale_crop_height_last_line;
61 int postscale_crop_width_first_pixel;
62 int postscale_crop_width_last_pixel;
63
64 int dst_start_x;
65 int dst_end_x;
66 int dst_start_y;
67 int dst_end_y;
68
69 int bytes_per_pixel;
70 unsigned int source_address;
71 unsigned int destination_address;
Iliya Varadzhakov31752fd2013-04-21 08:54:33 -070072 unsigned int compl_destination_address;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080073 unsigned int src_stride;
74 unsigned int dst_stride;
75 int rotate_270;
76 int horizontal_flip;
77 int vertical_flip;
78 int scale_output_width;
79 int scale_output_height;
80 int prescale_crop_en;
81 int postscale_crop_en;
82};
83
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070084struct msm_cpp_buffer_info_t {
85 int fd;
86 uint32_t index;
87 uint32_t offset;
88 uint8_t native_buff;
89 uint8_t processed_divert;
90};
91
92struct msm_cpp_stream_buff_info_t {
93 uint32_t identity;
94 uint32_t num_buffs;
95 struct msm_cpp_buffer_info_t *buffer_info;
96};
97
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080098struct msm_cpp_frame_info_t {
99 int32_t frame_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700100 struct timeval timestamp;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800101 uint32_t inst_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700102 uint32_t identity;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800103 uint32_t client_id;
104 enum msm_cpp_frame_type frame_type;
105 uint32_t num_strips;
106 struct msm_cpp_frame_strip_info *strip_info;
107 uint32_t msg_len;
108 uint32_t *cpp_cmd_msg;
109 int src_fd;
110 int dst_fd;
Rajakumar Govindaram0b6b2452013-03-01 13:35:03 -0800111 struct ion_handle *src_ion_handle;
112 struct ion_handle *dest_ion_handle;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700113 struct timeval in_time, out_time;
114 void *cookie;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700115 int32_t *status;
Punit Soni3a124902013-04-29 19:01:55 -0700116 int32_t duplicate_output;
117 uint32_t duplicate_identity;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700118 struct msm_cpp_buffer_info_t input_buffer_info;
Punit Soni3a124902013-04-29 19:01:55 -0700119 struct msm_cpp_buffer_info_t output_buffer_info[2];
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800120};
121
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800122struct cpp_hw_info {
123 uint32_t cpp_hw_version;
124 uint32_t cpp_hw_caps;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800125};
126
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700127struct msm_vpe_frame_strip_info {
128 uint32_t src_w;
129 uint32_t src_h;
130 uint32_t dst_w;
131 uint32_t dst_h;
132 uint32_t src_x;
133 uint32_t src_y;
134 uint32_t phase_step_x;
135 uint32_t phase_step_y;
136 uint32_t phase_init_x;
137 uint32_t phase_init_y;
138};
139
140struct msm_vpe_buffer_info_t {
141 int fd;
142 uint32_t index;
143 uint32_t offset;
144 uint8_t native_buff;
145 uint8_t processed_divert;
146};
147
148struct msm_vpe_stream_buff_info_t {
149 uint32_t identity;
150 uint32_t num_buffs;
151 struct msm_vpe_buffer_info_t *buffer_info;
152};
153
154struct msm_vpe_frame_info_t {
155 int32_t frame_id;
156 struct timeval timestamp;
157 uint32_t inst_id;
158 uint32_t identity;
159 uint32_t client_id;
160 enum msm_vpe_frame_type frame_type;
161 struct msm_vpe_frame_strip_info strip_info;
162 int src_fd;
163 int dst_fd;
164 struct ion_handle *src_ion_handle;
165 struct ion_handle *dest_ion_handle;
166 unsigned long src_phyaddr;
167 unsigned long dest_phyaddr;
168 unsigned long src_chroma_plane_offset;
169 unsigned long dest_chroma_plane_offset;
170 struct timeval in_time, out_time;
171 void *cookie;
172
173 struct msm_vpe_buffer_info_t input_buffer_info;
174 struct msm_vpe_buffer_info_t output_buffer_info;
175};
176
177
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800178#define VIDIOC_MSM_CPP_CFG \
179 _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
180
181#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
182 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
183
184#define VIDIOC_MSM_CPP_GET_INST_INFO \
185 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
186
Rajakumar Govindarama27ed752013-02-01 01:18:12 -0800187#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
188 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
189
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800190#define VIDIOC_MSM_CPP_GET_HW_INFO \
191 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
192
Rajakumar Govindaram4358df92013-03-17 20:35:50 -0700193#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
194 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
195
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700196#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
197 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
198
199#define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
200 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
201
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700202
203#define VIDIOC_MSM_VPE_CFG \
204 _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
205
206#define VIDIOC_MSM_VPE_TRANSACTION_SETUP \
207 _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
208
209#define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD \
210 _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
211
212#define VIDIOC_MSM_VPE_GET_INST_INFO \
213 _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
214
215#define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO \
216 _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
217
218#define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO \
219 _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
220
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800221#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700222#define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800223
224struct msm_camera_v4l2_ioctl_t {
225 uint32_t id;
226 uint32_t len;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700227 int32_t trans_code;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800228 void __user *ioctl_ptr;
229};
230
231#endif /* __MSMB_PPROC_H */