1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __UAPI_MSMB_PPROC_H
20 #define __UAPI_MSMB_PPROC_H
21 #include <linux/videodev2.h>
22 #include <linux/types.h>
23 #include <media/msmb_generic_buf_mgr.h>
24 #define MAX_PLANES VIDEO_MAX_PLANES
25 #define PARTIAL_FRAME_STRIPE_COUNT 4
26 #define MAX_NUM_CPP_STRIPS 8
27 #define MSM_CPP_MAX_NUM_PLANES 3
28 #define MSM_CPP_MIN_FRAME_LENGTH 13
29 #define MSM_CPP_MAX_FRAME_LENGTH 4096
30 #define MSM_CPP_MAX_FW_NAME_LEN 32
31 #define MAX_FREQ_TBL 10
32 #define MSM_OUTPUT_BUF_CNT 8
33 enum msm_cpp_frame_type {
34   MSM_CPP_OFFLINE_FRAME,
35   MSM_CPP_REALTIME_FRAME,
36 };
37 enum msm_vpe_frame_type {
38   MSM_VPE_OFFLINE_FRAME,
39   MSM_VPE_REALTIME_FRAME,
40 };
41 struct msm_cpp_buffer_info_t {
42   int32_t fd;
43   uint32_t index;
44   uint32_t offset;
45   uint8_t native_buff;
46   uint8_t processed_divert;
47   uint32_t identity;
48 };
49 struct msm_cpp_stream_buff_info_t {
50   uint32_t identity;
51   uint32_t num_buffs;
52   struct msm_cpp_buffer_info_t * buffer_info;
53 };
54 enum msm_cpp_batch_mode_t {
55   BATCH_MODE_NONE,
56   BATCH_MODE_VIDEO,
57   BATCH_MODE_PREVIEW
58 };
59 struct msm_cpp_batch_info_t {
60   enum msm_cpp_batch_mode_t batch_mode;
61   uint32_t batch_size;
62   uint32_t intra_plane_offset[MAX_PLANES];
63   uint32_t pick_preview_idx;
64   uint32_t cont_idx;
65 };
66 struct msm_cpp_frame_info_t {
67   int32_t frame_id;
68   struct timeval timestamp;
69   uint32_t inst_id;
70   uint32_t identity;
71   uint32_t client_id;
72   enum msm_cpp_frame_type frame_type;
73   uint32_t num_strips;
74   uint32_t msg_len;
75   uint32_t * cpp_cmd_msg;
76   int src_fd;
77   int dst_fd;
78   struct timeval in_time, out_time;
79   void * cookie;
80   int32_t * status;
81   int32_t duplicate_output;
82   uint32_t duplicate_identity;
83   uint32_t feature_mask;
84   uint8_t we_disable;
85   struct msm_cpp_buffer_info_t input_buffer_info;
86   struct msm_cpp_buffer_info_t output_buffer_info[MSM_OUTPUT_BUF_CNT];
87   struct msm_cpp_buffer_info_t duplicate_buffer_info;
88   struct msm_cpp_buffer_info_t tnr_scratch_buffer_info[2];
89   uint32_t reserved;
90   uint8_t partial_frame_indicator;
91   uint8_t first_payload;
92   uint8_t last_payload;
93   uint32_t first_stripe_index;
94   uint32_t last_stripe_index;
95   uint32_t stripe_info_offset;
96   uint32_t stripe_info;
97   struct msm_cpp_batch_info_t batch_info;
98 };
99 struct msm_cpp_pop_stream_info_t {
100   int32_t frame_id;
101   uint32_t identity;
102 };
103 struct cpp_hw_info {
104   uint32_t cpp_hw_version;
105   uint32_t cpp_hw_caps;
106   unsigned long freq_tbl[MAX_FREQ_TBL];
107   uint32_t freq_tbl_count;
108 };
109 struct msm_vpe_frame_strip_info {
110   uint32_t src_w;
111   uint32_t src_h;
112   uint32_t dst_w;
113   uint32_t dst_h;
114   uint32_t src_x;
115   uint32_t src_y;
116   uint32_t phase_step_x;
117   uint32_t phase_step_y;
118   uint32_t phase_init_x;
119   uint32_t phase_init_y;
120 };
121 struct msm_vpe_buffer_info_t {
122   int32_t fd;
123   uint32_t index;
124   uint32_t offset;
125   uint8_t native_buff;
126   uint8_t processed_divert;
127 };
128 struct msm_vpe_stream_buff_info_t {
129   uint32_t identity;
130   uint32_t num_buffs;
131   struct msm_vpe_buffer_info_t * buffer_info;
132 };
133 struct msm_vpe_frame_info_t {
134   int32_t frame_id;
135   struct timeval timestamp;
136   uint32_t inst_id;
137   uint32_t identity;
138   uint32_t client_id;
139   enum msm_vpe_frame_type frame_type;
140   struct msm_vpe_frame_strip_info strip_info;
141   unsigned long src_fd;
142   unsigned long dst_fd;
143   struct ion_handle * src_ion_handle;
144   struct ion_handle * dest_ion_handle;
145   unsigned long src_phyaddr;
146   unsigned long dest_phyaddr;
147   unsigned long src_chroma_plane_offset;
148   unsigned long dest_chroma_plane_offset;
149   struct timeval in_time, out_time;
150   void * cookie;
151   struct msm_vpe_buffer_info_t input_buffer_info;
152   struct msm_vpe_buffer_info_t output_buffer_info;
153 };
154 struct msm_pproc_queue_buf_info {
155   struct msm_buf_mngr_info buff_mgr_info;
156   uint8_t is_buf_dirty;
157 };
158 struct msm_cpp_clock_settings_t {
159   unsigned long clock_rate;
160   uint64_t avg;
161   uint64_t inst;
162 };
163 #define VIDIOC_MSM_CPP_CFG _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t)
164 #define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t)
165 #define VIDIOC_MSM_CPP_GET_INST_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t)
166 #define VIDIOC_MSM_CPP_LOAD_FIRMWARE _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t)
167 #define VIDIOC_MSM_CPP_GET_HW_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t)
168 #define VIDIOC_MSM_CPP_FLUSH_QUEUE _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t)
169 #define VIDIOC_MSM_CPP_ENQUEUE_STREAM_BUFF_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_camera_v4l2_ioctl_t)
170 #define VIDIOC_MSM_CPP_DEQUEUE_STREAM_BUFF_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_v4l2_ioctl_t)
171 #define VIDIOC_MSM_VPE_CFG _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t)
172 #define VIDIOC_MSM_VPE_TRANSACTION_SETUP _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t)
173 #define VIDIOC_MSM_VPE_GET_EVENTPAYLOAD _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t)
174 #define VIDIOC_MSM_VPE_GET_INST_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_camera_v4l2_ioctl_t)
175 #define VIDIOC_MSM_VPE_ENQUEUE_STREAM_BUFF_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 12, struct msm_camera_v4l2_ioctl_t)
176 #define VIDIOC_MSM_VPE_DEQUEUE_STREAM_BUFF_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_camera_v4l2_ioctl_t)
177 #define VIDIOC_MSM_CPP_QUEUE_BUF _IOWR('V', BASE_VIDIOC_PRIVATE + 14, struct msm_camera_v4l2_ioctl_t)
178 #define VIDIOC_MSM_CPP_APPEND_STREAM_BUFF_INFO _IOWR('V', BASE_VIDIOC_PRIVATE + 15, struct msm_camera_v4l2_ioctl_t)
179 #define VIDIOC_MSM_CPP_SET_CLOCK _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_camera_v4l2_ioctl_t)
180 #define VIDIOC_MSM_CPP_POP_STREAM_BUFFER _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_camera_v4l2_ioctl_t)
181 #define VIDIOC_MSM_CPP_IOMMU_ATTACH _IOWR('V', BASE_VIDIOC_PRIVATE + 18, struct msm_camera_v4l2_ioctl_t)
182 #define VIDIOC_MSM_CPP_IOMMU_DETACH _IOWR('V', BASE_VIDIOC_PRIVATE + 19, struct msm_camera_v4l2_ioctl_t)
183 #define VIDIOC_MSM_CPP_DELETE_STREAM_BUFF _IOWR('V', BASE_VIDIOC_PRIVATE + 20, struct msm_camera_v4l2_ioctl_t)
184 #define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0)
185 #define V4L2_EVENT_VPE_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 1)
186 struct msm_camera_v4l2_ioctl_t {
187   uint32_t id;
188   size_t len;
189   int32_t trans_code;
190   void * ioctl_ptr;
191 };
192 #endif
193 
194