blob: ed4ffa2f72e289cbd2559d983658de5c0358da53 [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;
Iliya Varadzhakov2bd51742013-10-08 08:10:11 -070093 uint32_t identity;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070094};
95
96struct msm_cpp_stream_buff_info_t {
97 uint32_t identity;
98 uint32_t num_buffs;
99 struct msm_cpp_buffer_info_t *buffer_info;
100};
101
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800102struct msm_cpp_frame_info_t {
103 int32_t frame_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700104 struct timeval timestamp;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800105 uint32_t inst_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700106 uint32_t identity;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800107 uint32_t client_id;
108 enum msm_cpp_frame_type frame_type;
109 uint32_t num_strips;
110 struct msm_cpp_frame_strip_info *strip_info;
111 uint32_t msg_len;
112 uint32_t *cpp_cmd_msg;
113 int src_fd;
114 int dst_fd;
Rajakumar Govindaram0b6b2452013-03-01 13:35:03 -0800115 struct ion_handle *src_ion_handle;
116 struct ion_handle *dest_ion_handle;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700117 struct timeval in_time, out_time;
118 void *cookie;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700119 int32_t *status;
Punit Soni3a124902013-04-29 19:01:55 -0700120 int32_t duplicate_output;
121 uint32_t duplicate_identity;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700122 struct msm_cpp_buffer_info_t input_buffer_info;
Punit Soni3a124902013-04-29 19:01:55 -0700123 struct msm_cpp_buffer_info_t output_buffer_info[2];
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800124};
125
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800126struct cpp_hw_info {
127 uint32_t cpp_hw_version;
128 uint32_t cpp_hw_caps;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800129};
130
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700131struct msm_vpe_frame_strip_info {
132 uint32_t src_w;
133 uint32_t src_h;
134 uint32_t dst_w;
135 uint32_t dst_h;
136 uint32_t src_x;
137 uint32_t src_y;
138 uint32_t phase_step_x;
139 uint32_t phase_step_y;
140 uint32_t phase_init_x;
141 uint32_t phase_init_y;
142};
143
144struct msm_vpe_buffer_info_t {
145 int fd;
146 uint32_t index;
147 uint32_t offset;
148 uint8_t native_buff;
149 uint8_t processed_divert;
150};
151
152struct msm_vpe_stream_buff_info_t {
153 uint32_t identity;
154 uint32_t num_buffs;
155 struct msm_vpe_buffer_info_t *buffer_info;
156};
157
158struct msm_vpe_frame_info_t {
159 int32_t frame_id;
160 struct timeval timestamp;
161 uint32_t inst_id;
162 uint32_t identity;
163 uint32_t client_id;
164 enum msm_vpe_frame_type frame_type;
165 struct msm_vpe_frame_strip_info strip_info;
166 int src_fd;
167 int dst_fd;
168 struct ion_handle *src_ion_handle;
169 struct ion_handle *dest_ion_handle;
170 unsigned long src_phyaddr;
171 unsigned long dest_phyaddr;
172 unsigned long src_chroma_plane_offset;
173 unsigned long dest_chroma_plane_offset;
174 struct timeval in_time, out_time;
175 void *cookie;
176
177 struct msm_vpe_buffer_info_t input_buffer_info;
178 struct msm_vpe_buffer_info_t output_buffer_info;
179};
180
Rajakumar Govindaram48abf182013-06-20 18:12:11 -0700181struct msm_pproc_queue_buf_info {
182 struct msm_buf_mngr_info buff_mgr_info;
183 uint8_t is_buf_dirty;
184};
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700185
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800186#define VIDIOC_MSM_CPP_CFG \
187 _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
188
189#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
190 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
191
192#define VIDIOC_MSM_CPP_GET_INST_INFO \
193 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
194
Rajakumar Govindarama27ed752013-02-01 01:18:12 -0800195#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
196 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
197
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800198#define VIDIOC_MSM_CPP_GET_HW_INFO \
199 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
200
Rajakumar Govindaram4358df92013-03-17 20:35:50 -0700201#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
202 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
203
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700204#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
205 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
206
207#define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
208 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
209
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700210
211#define VIDIOC_MSM_VPE_CFG \
212 _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
213
214#define VIDIOC_MSM_VPE_TRANSACTION_SETUP \
215 _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
216
217#define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD \
218 _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
219
220#define VIDIOC_MSM_VPE_GET_INST_INFO \
221 _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
222
223#define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO \
224 _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
225
226#define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO \
227 _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
228
Rajakumar Govindaram48abf182013-06-20 18:12:11 -0700229#define VIDIOC_MSM_CPP_QUEUE_BUF \
Rajakumar Govindaram478fdbc2013-05-04 20:45:42 -0700230 _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t)
231
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800232#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700233#define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800234
235struct msm_camera_v4l2_ioctl_t {
236 uint32_t id;
237 uint32_t len;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700238 int32_t trans_code;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800239 void __user *ioctl_ptr;
240};
241
242#endif /* __MSMB_PPROC_H */