blob: de42c3853823a18ef79b8e52965cb2a0423bbdaf [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>
Rajakumar Govindaram48abf182013-06-20 18:12:11 -07009#include <media/msmb_generic_buf_mgr.h>
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080010
11/* Should be same as VIDEO_MAX_PLANES in videodev2.h */
12#define MAX_PLANES VIDEO_MAX_PLANES
13
14#define MAX_NUM_CPP_STRIPS 8
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070015#define MSM_CPP_MAX_NUM_PLANES 3
Hariram Purushothamanac811f82013-07-17 15:55:30 -070016#define MSM_CPP_MAX_FRAME_LENGTH 1024
17#define MSM_CPP_MAX_FW_NAME_LEN 32
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080018
19enum msm_cpp_frame_type {
20 MSM_CPP_OFFLINE_FRAME,
21 MSM_CPP_REALTIME_FRAME,
22};
23
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -070024enum msm_vpe_frame_type {
25 MSM_VPE_OFFLINE_FRAME,
26 MSM_VPE_REALTIME_FRAME,
27};
28
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080029struct msm_cpp_frame_strip_info {
30 int scale_v_en;
31 int scale_h_en;
32
33 int upscale_v_en;
34 int upscale_h_en;
35
36 int src_start_x;
37 int src_end_x;
38 int src_start_y;
39 int src_end_y;
40
41 /* Padding is required for upscaler because it does not
42 * pad internally like other blocks, also needed for rotation
43 * rotation expects all the blocks in the stripe to be the same size
44 * Padding is done such that all the extra padded pixels
45 * are on the right and bottom
46 */
47 int pad_bottom;
48 int pad_top;
49 int pad_right;
50 int pad_left;
51
52 int v_init_phase;
53 int h_init_phase;
54 int h_phase_step;
55 int v_phase_step;
56
57 int prescale_crop_width_first_pixel;
58 int prescale_crop_width_last_pixel;
59 int prescale_crop_height_first_line;
60 int prescale_crop_height_last_line;
61
62 int postscale_crop_height_first_line;
63 int postscale_crop_height_last_line;
64 int postscale_crop_width_first_pixel;
65 int postscale_crop_width_last_pixel;
66
67 int dst_start_x;
68 int dst_end_x;
69 int dst_start_y;
70 int dst_end_y;
71
72 int bytes_per_pixel;
73 unsigned int source_address;
74 unsigned int destination_address;
Iliya Varadzhakov31752fd2013-04-21 08:54:33 -070075 unsigned int compl_destination_address;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080076 unsigned int src_stride;
77 unsigned int dst_stride;
78 int rotate_270;
79 int horizontal_flip;
80 int vertical_flip;
81 int scale_output_width;
82 int scale_output_height;
83 int prescale_crop_en;
84 int postscale_crop_en;
85};
86
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070087struct msm_cpp_buffer_info_t {
88 int fd;
89 uint32_t index;
90 uint32_t offset;
91 uint8_t native_buff;
92 uint8_t processed_divert;
93};
94
95struct msm_cpp_stream_buff_info_t {
96 uint32_t identity;
97 uint32_t num_buffs;
98 struct msm_cpp_buffer_info_t *buffer_info;
99};
100
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800101struct msm_cpp_frame_info_t {
102 int32_t frame_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700103 struct timeval timestamp;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800104 uint32_t inst_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700105 uint32_t identity;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800106 uint32_t client_id;
107 enum msm_cpp_frame_type frame_type;
108 uint32_t num_strips;
109 struct msm_cpp_frame_strip_info *strip_info;
110 uint32_t msg_len;
111 uint32_t *cpp_cmd_msg;
112 int src_fd;
113 int dst_fd;
Rajakumar Govindaram0b6b2452013-03-01 13:35:03 -0800114 struct ion_handle *src_ion_handle;
115 struct ion_handle *dest_ion_handle;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700116 struct timeval in_time, out_time;
117 void *cookie;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700118 int32_t *status;
Punit Soni3a124902013-04-29 19:01:55 -0700119 int32_t duplicate_output;
120 uint32_t duplicate_identity;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700121 struct msm_cpp_buffer_info_t input_buffer_info;
Punit Soni3a124902013-04-29 19:01:55 -0700122 struct msm_cpp_buffer_info_t output_buffer_info[2];
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800123};
124
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800125struct cpp_hw_info {
126 uint32_t cpp_hw_version;
127 uint32_t cpp_hw_caps;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800128};
129
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700130struct msm_vpe_frame_strip_info {
131 uint32_t src_w;
132 uint32_t src_h;
133 uint32_t dst_w;
134 uint32_t dst_h;
135 uint32_t src_x;
136 uint32_t src_y;
137 uint32_t phase_step_x;
138 uint32_t phase_step_y;
139 uint32_t phase_init_x;
140 uint32_t phase_init_y;
141};
142
143struct msm_vpe_buffer_info_t {
144 int fd;
145 uint32_t index;
146 uint32_t offset;
147 uint8_t native_buff;
148 uint8_t processed_divert;
149};
150
151struct msm_vpe_stream_buff_info_t {
152 uint32_t identity;
153 uint32_t num_buffs;
154 struct msm_vpe_buffer_info_t *buffer_info;
155};
156
157struct msm_vpe_frame_info_t {
158 int32_t frame_id;
159 struct timeval timestamp;
160 uint32_t inst_id;
161 uint32_t identity;
162 uint32_t client_id;
163 enum msm_vpe_frame_type frame_type;
164 struct msm_vpe_frame_strip_info strip_info;
165 int src_fd;
166 int dst_fd;
167 struct ion_handle *src_ion_handle;
168 struct ion_handle *dest_ion_handle;
169 unsigned long src_phyaddr;
170 unsigned long dest_phyaddr;
171 unsigned long src_chroma_plane_offset;
172 unsigned long dest_chroma_plane_offset;
173 struct timeval in_time, out_time;
174 void *cookie;
175
176 struct msm_vpe_buffer_info_t input_buffer_info;
177 struct msm_vpe_buffer_info_t output_buffer_info;
178};
179
Rajakumar Govindaram48abf182013-06-20 18:12:11 -0700180struct msm_pproc_queue_buf_info {
181 struct msm_buf_mngr_info buff_mgr_info;
182 uint8_t is_buf_dirty;
183};
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700184
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800185#define VIDIOC_MSM_CPP_CFG \
186 _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
187
188#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
189 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
190
191#define VIDIOC_MSM_CPP_GET_INST_INFO \
192 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
193
Rajakumar Govindarama27ed752013-02-01 01:18:12 -0800194#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
195 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
196
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800197#define VIDIOC_MSM_CPP_GET_HW_INFO \
198 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
199
Rajakumar Govindaram4358df92013-03-17 20:35:50 -0700200#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
201 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
202
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700203#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
204 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
205
206#define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
207 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
208
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700209
210#define VIDIOC_MSM_VPE_CFG \
211 _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
212
213#define VIDIOC_MSM_VPE_TRANSACTION_SETUP \
214 _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
215
216#define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD \
217 _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
218
219#define VIDIOC_MSM_VPE_GET_INST_INFO \
220 _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
221
222#define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO \
223 _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
224
225#define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO \
226 _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
227
Rajakumar Govindaram48abf182013-06-20 18:12:11 -0700228#define VIDIOC_MSM_CPP_QUEUE_BUF \
Rajakumar Govindaram478fdbc2013-05-04 20:45:42 -0700229 _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t)
230
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800231#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700232#define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800233
234struct msm_camera_v4l2_ioctl_t {
235 uint32_t id;
236 uint32_t len;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700237 int32_t trans_code;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800238 void __user *ioctl_ptr;
239};
240
241#endif /* __MSMB_PPROC_H */