blob: aead2d2bd5aef14ff0e2ca05c692ff38178a9dbc [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;
72 unsigned int src_stride;
73 unsigned int dst_stride;
74 int rotate_270;
75 int horizontal_flip;
76 int vertical_flip;
77 int scale_output_width;
78 int scale_output_height;
79 int prescale_crop_en;
80 int postscale_crop_en;
81};
82
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070083struct msm_cpp_buffer_info_t {
84 int fd;
85 uint32_t index;
86 uint32_t offset;
87 uint8_t native_buff;
88 uint8_t processed_divert;
89};
90
91struct msm_cpp_stream_buff_info_t {
92 uint32_t identity;
93 uint32_t num_buffs;
94 struct msm_cpp_buffer_info_t *buffer_info;
95};
96
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080097struct msm_cpp_frame_info_t {
98 int32_t frame_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -070099 struct timeval timestamp;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800100 uint32_t inst_id;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700101 uint32_t identity;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800102 uint32_t client_id;
103 enum msm_cpp_frame_type frame_type;
104 uint32_t num_strips;
105 struct msm_cpp_frame_strip_info *strip_info;
106 uint32_t msg_len;
107 uint32_t *cpp_cmd_msg;
108 int src_fd;
109 int dst_fd;
Rajakumar Govindaram0b6b2452013-03-01 13:35:03 -0800110 struct ion_handle *src_ion_handle;
111 struct ion_handle *dest_ion_handle;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700112 struct timeval in_time, out_time;
113 void *cookie;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700114 int32_t *status;
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700115
116 struct msm_cpp_buffer_info_t input_buffer_info;
117 struct msm_cpp_buffer_info_t output_buffer_info;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800118};
119
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800120struct cpp_hw_info {
121 uint32_t cpp_hw_version;
122 uint32_t cpp_hw_caps;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800123};
124
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700125struct msm_vpe_frame_strip_info {
126 uint32_t src_w;
127 uint32_t src_h;
128 uint32_t dst_w;
129 uint32_t dst_h;
130 uint32_t src_x;
131 uint32_t src_y;
132 uint32_t phase_step_x;
133 uint32_t phase_step_y;
134 uint32_t phase_init_x;
135 uint32_t phase_init_y;
136};
137
138struct msm_vpe_buffer_info_t {
139 int fd;
140 uint32_t index;
141 uint32_t offset;
142 uint8_t native_buff;
143 uint8_t processed_divert;
144};
145
146struct msm_vpe_stream_buff_info_t {
147 uint32_t identity;
148 uint32_t num_buffs;
149 struct msm_vpe_buffer_info_t *buffer_info;
150};
151
152struct msm_vpe_frame_info_t {
153 int32_t frame_id;
154 struct timeval timestamp;
155 uint32_t inst_id;
156 uint32_t identity;
157 uint32_t client_id;
158 enum msm_vpe_frame_type frame_type;
159 struct msm_vpe_frame_strip_info strip_info;
160 int src_fd;
161 int dst_fd;
162 struct ion_handle *src_ion_handle;
163 struct ion_handle *dest_ion_handle;
164 unsigned long src_phyaddr;
165 unsigned long dest_phyaddr;
166 unsigned long src_chroma_plane_offset;
167 unsigned long dest_chroma_plane_offset;
168 struct timeval in_time, out_time;
169 void *cookie;
170
171 struct msm_vpe_buffer_info_t input_buffer_info;
172 struct msm_vpe_buffer_info_t output_buffer_info;
173};
174
175
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800176#define VIDIOC_MSM_CPP_CFG \
177 _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
178
179#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
180 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
181
182#define VIDIOC_MSM_CPP_GET_INST_INFO \
183 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
184
Rajakumar Govindarama27ed752013-02-01 01:18:12 -0800185#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
186 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
187
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800188#define VIDIOC_MSM_CPP_GET_HW_INFO \
189 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
190
Rajakumar Govindaram4358df92013-03-17 20:35:50 -0700191#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
192 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
193
Rajakumar Govindaramaf9b20e2013-03-17 00:21:07 -0700194#define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO \
195 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
196
197#define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO \
198 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
199
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700200
201#define VIDIOC_MSM_VPE_CFG \
202 _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
203
204#define VIDIOC_MSM_VPE_TRANSACTION_SETUP \
205 _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
206
207#define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD \
208 _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
209
210#define VIDIOC_MSM_VPE_GET_INST_INFO \
211 _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
212
213#define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO \
214 _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
215
216#define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO \
217 _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
218
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800219#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
Mitchel Humpherysd73fe5b2013-04-10 17:37:19 -0700220#define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800221
222struct msm_camera_v4l2_ioctl_t {
223 uint32_t id;
224 uint32_t len;
Rajakumar Govindaram3b7fbd32013-04-01 19:37:20 -0700225 int32_t trans_code;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800226 void __user *ioctl_ptr;
227};
228
229#endif /* __MSMB_PPROC_H */