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> 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 14 #define MSM_CPP_MAX_NUM_PLANES 3 15 16 enum msm_cpp_frame_type { 17 MSM_CPP_OFFLINE_FRAME, 18 MSM_CPP_REALTIME_FRAME, 19 }; 20 21 enum msm_vpe_frame_type { 22 MSM_VPE_OFFLINE_FRAME, 23 MSM_VPE_REALTIME_FRAME, 24 }; 25 26 struct 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 compl_destination_address; 73 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 84 struct 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 92 struct 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 98 struct msm_cpp_frame_info_t { 99 int32_t frame_id; 100 struct timeval timestamp; 101 uint32_t inst_id; 102 uint32_t identity; 103 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; 111 struct ion_handle *src_ion_handle; 112 struct ion_handle *dest_ion_handle; 113 struct timeval in_time, out_time; 114 void *cookie; 115 int32_t *status; 116 int32_t duplicate_output; 117 uint32_t duplicate_identity; 118 struct msm_cpp_buffer_info_t input_buffer_info; 119 struct msm_cpp_buffer_info_t output_buffer_info[2]; 120 }; 121 122 struct cpp_hw_info { 123 uint32_t cpp_hw_version; 124 uint32_t cpp_hw_caps; 125 }; 126 127 struct 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 140 struct 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 148 struct 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 154 struct 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 178 #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 187 #define VIDIOC_MSM_CPP_LOAD_FIRMWARE \ 188 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t) 189 190 #define VIDIOC_MSM_CPP_GET_HW_INFO \ 191 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t) 192 193 #define VIDIOC_MSM_CPP_FLUSH_QUEUE \ 194 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t) 195 196 #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 202 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 221 #define VIDIOC_MSM_CPP_SEND_BUF_DONE \ 222 _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t) 223 224 #define VIDIOC_MSM_CPP_POP_STREAM_BUFFER \ 225 _IOWR('V', BASE_VIDIOC_PRIVATE + 15, struct msm_camera_v4l2_ioctl_t) 226 227 #define VIDIOC_MSM_CPP_SET_CLOCK \ 228 _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_camera_v4l2_ioctl_t) 229 230 #define VIDIOC_MSM_CPP_APPEND_STREAM_BUFF_INFO \ 231 _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_camera_v4l2_ioctl_t) 232 233 #define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0) 234 #define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1) 235 236 struct msm_camera_v4l2_ioctl_t { 237 uint32_t id; 238 uint32_t len; 239 int32_t trans_code; 240 void __user *ioctl_ptr; 241 }; 242 243 #endif /* __MSMB_PPROC_H */ 244