Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 1 | #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 Govindaram | 48abf18 | 2013-06-20 18:12:11 -0700 | [diff] [blame] | 9 | #include <media/msmb_generic_buf_mgr.h> |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 10 | |
| 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 Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 15 | #define MSM_CPP_MAX_NUM_PLANES 3 |
Hariram Purushothaman | ac811f8 | 2013-07-17 15:55:30 -0700 | [diff] [blame] | 16 | #define MSM_CPP_MAX_FRAME_LENGTH 1024 |
| 17 | #define MSM_CPP_MAX_FW_NAME_LEN 32 |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 18 | |
| 19 | enum msm_cpp_frame_type { |
| 20 | MSM_CPP_OFFLINE_FRAME, |
| 21 | MSM_CPP_REALTIME_FRAME, |
| 22 | }; |
| 23 | |
Mitchel Humpherys | d73fe5b | 2013-04-10 17:37:19 -0700 | [diff] [blame] | 24 | enum msm_vpe_frame_type { |
| 25 | MSM_VPE_OFFLINE_FRAME, |
| 26 | MSM_VPE_REALTIME_FRAME, |
| 27 | }; |
| 28 | |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 29 | struct 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 Varadzhakov | 31752fd | 2013-04-21 08:54:33 -0700 | [diff] [blame] | 75 | unsigned int compl_destination_address; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 76 | 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 Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 87 | struct 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 Varadzhakov | 2bd5174 | 2013-10-08 08:10:11 -0700 | [diff] [blame] | 93 | uint32_t identity; |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | struct 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 Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 102 | struct msm_cpp_frame_info_t { |
| 103 | int32_t frame_id; |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 104 | struct timeval timestamp; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 105 | uint32_t inst_id; |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 106 | uint32_t identity; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 107 | 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 Govindaram | 0b6b245 | 2013-03-01 13:35:03 -0800 | [diff] [blame] | 115 | struct ion_handle *src_ion_handle; |
| 116 | struct ion_handle *dest_ion_handle; |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 117 | struct timeval in_time, out_time; |
| 118 | void *cookie; |
Rajakumar Govindaram | 3b7fbd3 | 2013-04-01 19:37:20 -0700 | [diff] [blame] | 119 | int32_t *status; |
Punit Soni | 3a12490 | 2013-04-29 19:01:55 -0700 | [diff] [blame] | 120 | int32_t duplicate_output; |
| 121 | uint32_t duplicate_identity; |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 122 | struct msm_cpp_buffer_info_t input_buffer_info; |
Punit Soni | 3a12490 | 2013-04-29 19:01:55 -0700 | [diff] [blame] | 123 | struct msm_cpp_buffer_info_t output_buffer_info[2]; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 124 | }; |
| 125 | |
Rajakumar Govindaram | d359e4f | 2013-03-06 03:11:57 -0800 | [diff] [blame] | 126 | struct cpp_hw_info { |
| 127 | uint32_t cpp_hw_version; |
| 128 | uint32_t cpp_hw_caps; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 129 | }; |
| 130 | |
Mitchel Humpherys | d73fe5b | 2013-04-10 17:37:19 -0700 | [diff] [blame] | 131 | struct 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 | |
| 144 | struct 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 | |
| 152 | struct 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 | |
| 158 | struct 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 Govindaram | 48abf18 | 2013-06-20 18:12:11 -0700 | [diff] [blame] | 181 | struct msm_pproc_queue_buf_info { |
| 182 | struct msm_buf_mngr_info buff_mgr_info; |
| 183 | uint8_t is_buf_dirty; |
| 184 | }; |
Mitchel Humpherys | d73fe5b | 2013-04-10 17:37:19 -0700 | [diff] [blame] | 185 | |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 186 | #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 Govindaram | a27ed75 | 2013-02-01 01:18:12 -0800 | [diff] [blame] | 195 | #define VIDIOC_MSM_CPP_LOAD_FIRMWARE \ |
| 196 | _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t) |
| 197 | |
Rajakumar Govindaram | d359e4f | 2013-03-06 03:11:57 -0800 | [diff] [blame] | 198 | #define VIDIOC_MSM_CPP_GET_HW_INFO \ |
| 199 | _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t) |
| 200 | |
Rajakumar Govindaram | 4358df9 | 2013-03-17 20:35:50 -0700 | [diff] [blame] | 201 | #define VIDIOC_MSM_CPP_FLUSH_QUEUE \ |
| 202 | _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t) |
| 203 | |
Rajakumar Govindaram | af9b20e | 2013-03-17 00:21:07 -0700 | [diff] [blame] | 204 | #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 Humpherys | d73fe5b | 2013-04-10 17:37:19 -0700 | [diff] [blame] | 210 | |
| 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 Govindaram | 48abf18 | 2013-06-20 18:12:11 -0700 | [diff] [blame] | 229 | #define VIDIOC_MSM_CPP_QUEUE_BUF \ |
Rajakumar Govindaram | 478fdbc | 2013-05-04 20:45:42 -0700 | [diff] [blame] | 230 | _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t) |
| 231 | |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 232 | #define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0) |
Mitchel Humpherys | d73fe5b | 2013-04-10 17:37:19 -0700 | [diff] [blame] | 233 | #define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1) |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 234 | |
| 235 | struct msm_camera_v4l2_ioctl_t { |
| 236 | uint32_t id; |
| 237 | uint32_t len; |
Rajakumar Govindaram | 3b7fbd3 | 2013-04-01 19:37:20 -0700 | [diff] [blame] | 238 | int32_t trans_code; |
Sreesudhan Ramakrish Ramkumar | 9f79f60 | 2012-11-21 18:26:40 -0800 | [diff] [blame] | 239 | void __user *ioctl_ptr; |
| 240 | }; |
| 241 | |
| 242 | #endif /* __MSMB_PPROC_H */ |