1 #ifndef __UAPI_MEDIA_MSMB_BUF_MNGR_H__
2 #define __UAPI_MEDIA_MSMB_BUF_MNGR_H__
3 
4 #include <media/msmb_camera.h>
5 
6 enum msm_camera_buf_mngr_cmd {
7 	MSM_CAMERA_BUF_MNGR_CONT_MAP,
8 	MSM_CAMERA_BUF_MNGR_CONT_UNMAP,
9 	MSM_CAMERA_BUF_MNGR_CONT_MAX,
10 };
11 
12 enum msm_camera_buf_mngr_buf_type {
13 	MSM_CAMERA_BUF_MNGR_BUF_PLANAR,
14 	MSM_CAMERA_BUF_MNGR_BUF_USER,
15 	MSM_CAMERA_BUF_MNGR_BUF_INVALID,
16 };
17 
18 struct msm_buf_mngr_info {
19 	uint32_t session_id;
20 	uint32_t stream_id;
21 	uint32_t frame_id;
22 	struct timeval timestamp;
23 	uint32_t index;
24 	uint32_t reserved;
25 	enum msm_camera_buf_mngr_buf_type type;
26 	struct msm_camera_user_buf_cont_t user_buf;
27 };
28 
29 struct msm_buf_mngr_main_cont_info {
30 	uint32_t session_id;
31 	uint32_t stream_id;
32 	enum msm_camera_buf_mngr_cmd cmd;
33 	uint32_t cnt;
34 	int32_t cont_fd;
35 };
36 
37 struct v4l2_subdev *msm_buf_mngr_get_subdev(void);
38 
39 #define VIDIOC_MSM_BUF_MNGR_GET_BUF \
40 	_IOWR('V', BASE_VIDIOC_PRIVATE + 33, struct msm_buf_mngr_info)
41 
42 #define VIDIOC_MSM_BUF_MNGR_PUT_BUF \
43 	_IOWR('V', BASE_VIDIOC_PRIVATE + 34, struct msm_buf_mngr_info)
44 
45 #define VIDIOC_MSM_BUF_MNGR_BUF_DONE \
46 	_IOWR('V', BASE_VIDIOC_PRIVATE + 35, struct msm_buf_mngr_info)
47 
48 #define VIDIOC_MSM_BUF_MNGR_CONT_CMD \
49 	_IOWR('V', BASE_VIDIOC_PRIVATE + 36, struct msm_buf_mngr_main_cont_info)
50 
51 #define VIDIOC_MSM_BUF_MNGR_INIT \
52 	_IOWR('V', BASE_VIDIOC_PRIVATE + 37, struct msm_buf_mngr_info)
53 
54 #define VIDIOC_MSM_BUF_MNGR_DEINIT \
55 	_IOWR('V', BASE_VIDIOC_PRIVATE + 38, struct msm_buf_mngr_info)
56 
57 #define VIDIOC_MSM_BUF_MNGR_FLUSH \
58 	_IOWR('V', BASE_VIDIOC_PRIVATE + 39, struct msm_buf_mngr_info)
59 
60 #ifdef CONFIG_COMPAT
61 struct msm_buf_mngr_info32_t {
62 	uint32_t session_id;
63 	uint32_t stream_id;
64 	uint32_t frame_id;
65 	struct compat_timeval timestamp;
66 	uint32_t index;
67 	uint32_t reserved;
68 	enum msm_camera_buf_mngr_buf_type type;
69 	struct msm_camera_user_buf_cont_t user_buf;
70 };
71 
72 #define VIDIOC_MSM_BUF_MNGR_GET_BUF32 \
73 	_IOWR('V', BASE_VIDIOC_PRIVATE + 33, struct msm_buf_mngr_info32_t)
74 
75 #define VIDIOC_MSM_BUF_MNGR_PUT_BUF32 \
76 	_IOWR('V', BASE_VIDIOC_PRIVATE + 34, struct msm_buf_mngr_info32_t)
77 
78 #define VIDIOC_MSM_BUF_MNGR_BUF_DONE32 \
79 	_IOWR('V', BASE_VIDIOC_PRIVATE + 35, struct msm_buf_mngr_info32_t)
80 
81 #define VIDIOC_MSM_BUF_MNGR_FLUSH32 \
82 	_IOWR('V', BASE_VIDIOC_PRIVATE + 39, struct msm_buf_mngr_info32_t)
83 #endif
84 
85 #endif
86