blob: 6f8e865ea49b5707273d5afe450f385e0f40d2bd [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
14
15enum msm_cpp_frame_type {
16 MSM_CPP_OFFLINE_FRAME,
17 MSM_CPP_REALTIME_FRAME,
18};
19
20struct msm_cpp_frame_strip_info {
21 int scale_v_en;
22 int scale_h_en;
23
24 int upscale_v_en;
25 int upscale_h_en;
26
27 int src_start_x;
28 int src_end_x;
29 int src_start_y;
30 int src_end_y;
31
32 /* Padding is required for upscaler because it does not
33 * pad internally like other blocks, also needed for rotation
34 * rotation expects all the blocks in the stripe to be the same size
35 * Padding is done such that all the extra padded pixels
36 * are on the right and bottom
37 */
38 int pad_bottom;
39 int pad_top;
40 int pad_right;
41 int pad_left;
42
43 int v_init_phase;
44 int h_init_phase;
45 int h_phase_step;
46 int v_phase_step;
47
48 int prescale_crop_width_first_pixel;
49 int prescale_crop_width_last_pixel;
50 int prescale_crop_height_first_line;
51 int prescale_crop_height_last_line;
52
53 int postscale_crop_height_first_line;
54 int postscale_crop_height_last_line;
55 int postscale_crop_width_first_pixel;
56 int postscale_crop_width_last_pixel;
57
58 int dst_start_x;
59 int dst_end_x;
60 int dst_start_y;
61 int dst_end_y;
62
63 int bytes_per_pixel;
64 unsigned int source_address;
65 unsigned int destination_address;
66 unsigned int src_stride;
67 unsigned int dst_stride;
68 int rotate_270;
69 int horizontal_flip;
70 int vertical_flip;
71 int scale_output_width;
72 int scale_output_height;
73 int prescale_crop_en;
74 int postscale_crop_en;
75};
76
77struct msm_cpp_frame_info_t {
78 int32_t frame_id;
79 uint32_t inst_id;
80 uint32_t client_id;
81 enum msm_cpp_frame_type frame_type;
82 uint32_t num_strips;
83 struct msm_cpp_frame_strip_info *strip_info;
84 uint32_t msg_len;
85 uint32_t *cpp_cmd_msg;
86 int src_fd;
87 int dst_fd;
Rajakumar Govindaram0b6b2452013-03-01 13:35:03 -080088 struct ion_handle *src_ion_handle;
89 struct ion_handle *dest_ion_handle;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080090};
91
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -080092struct cpp_hw_info {
93 uint32_t cpp_hw_version;
94 uint32_t cpp_hw_caps;
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -080095};
96
97#define VIDIOC_MSM_CPP_CFG \
98 _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
99
100#define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \
101 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
102
103#define VIDIOC_MSM_CPP_GET_INST_INFO \
104 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
105
Rajakumar Govindarama27ed752013-02-01 01:18:12 -0800106#define VIDIOC_MSM_CPP_LOAD_FIRMWARE \
107 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
108
Rajakumar Govindaramd359e4f2013-03-06 03:11:57 -0800109#define VIDIOC_MSM_CPP_GET_HW_INFO \
110 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
111
Rajakumar Govindaram4358df92013-03-17 20:35:50 -0700112#define VIDIOC_MSM_CPP_FLUSH_QUEUE \
113 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
114
Sreesudhan Ramakrish Ramkumar9f79f602012-11-21 18:26:40 -0800115#define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
116
117struct msm_camera_v4l2_ioctl_t {
118 uint32_t id;
119 uint32_t len;
120 uint32_t trans_code;
121 void __user *ioctl_ptr;
122};
123
124#endif /* __MSMB_PPROC_H */