1 #ifndef __UAPI_MSM_SDE_ROTATOR_H__
2 #define __UAPI_MSM_SDE_ROTATOR_H__
3 
4 #include <linux/videodev2.h>
5 #include <linux/types.h>
6 #include <linux/ioctl.h>
7 
8 /* SDE Rotator pixel format definitions */
9 #define SDE_PIX_FMT_XRGB_8888		V4L2_PIX_FMT_XBGR32
10 #define SDE_PIX_FMT_ARGB_8888		V4L2_PIX_FMT_ABGR32
11 #define SDE_PIX_FMT_ABGR_8888		v4l2_fourcc('R', 'A', '2', '4')
12 #define SDE_PIX_FMT_RGBA_8888		v4l2_fourcc('A', 'B', '2', '4')
13 #define SDE_PIX_FMT_BGRA_8888		V4L2_PIX_FMT_ARGB32
14 #define SDE_PIX_FMT_RGBX_8888		v4l2_fourcc('X', 'B', '2', '4')
15 #define SDE_PIX_FMT_BGRX_8888		V4L2_PIX_FMT_XRGB32
16 #define SDE_PIX_FMT_RGBA_5551		v4l2_fourcc('R', 'A', '1', '5')
17 #define SDE_PIX_FMT_ARGB_4444		V4L2_PIX_FMT_ARGB444
18 #define SDE_PIX_FMT_RGBA_4444		v4l2_fourcc('R', 'A', '1', '2')
19 #define SDE_PIX_FMT_RGB_888		V4L2_PIX_FMT_RGB24
20 #define SDE_PIX_FMT_BGR_888		V4L2_PIX_FMT_BGR24
21 #define SDE_PIX_FMT_RGB_565		V4L2_PIX_FMT_RGB565
22 #define SDE_PIX_FMT_BGR_565		v4l2_fourcc('B', 'G', '1', '6')
23 #define SDE_PIX_FMT_Y_CB_CR_H2V2	V4L2_PIX_FMT_YUV420
24 #define SDE_PIX_FMT_Y_CR_CB_H2V2	V4L2_PIX_FMT_YVU420
25 #define SDE_PIX_FMT_Y_CR_CB_GH2V2	v4l2_fourcc('Y', 'U', '4', '2')
26 #define SDE_PIX_FMT_Y_CBCR_H2V2		V4L2_PIX_FMT_NV12
27 #define SDE_PIX_FMT_Y_CRCB_H2V2		V4L2_PIX_FMT_NV21
28 #define SDE_PIX_FMT_Y_CBCR_H1V2		v4l2_fourcc('N', 'H', '1', '6')
29 #define SDE_PIX_FMT_Y_CRCB_H1V2		v4l2_fourcc('N', 'H', '6', '1')
30 #define SDE_PIX_FMT_Y_CBCR_H2V1		V4L2_PIX_FMT_NV16
31 #define SDE_PIX_FMT_Y_CRCB_H2V1		V4L2_PIX_FMT_NV61
32 #define SDE_PIX_FMT_YCBYCR_H2V1		V4L2_PIX_FMT_YUYV
33 #define SDE_PIX_FMT_Y_CBCR_H2V2_VENUS	v4l2_fourcc('Q', 'N', 'V', '2')
34 #define SDE_PIX_FMT_Y_CRCB_H2V2_VENUS	v4l2_fourcc('Q', 'N', 'V', '1')
35 #define SDE_PIX_FMT_RGBA_8888_UBWC	V4L2_PIX_FMT_RGBA8888_UBWC
36 #define SDE_PIX_FMT_RGBX_8888_UBWC	v4l2_fourcc('Q', 'X', 'B', '4')
37 #define SDE_PIX_FMT_RGB_565_UBWC	v4l2_fourcc('Q', 'R', 'G', '6')
38 #define SDE_PIX_FMT_Y_CBCR_H2V2_UBWC	V4L2_PIX_FMT_NV12_UBWC
39 #define SDE_PIX_FMT_RGBA_1010102	v4l2_fourcc('A', 'B', '3', '0')
40 #define SDE_PIX_FMT_RGBX_1010102	v4l2_fourcc('X', 'B', '3', '0')
41 #define SDE_PIX_FMT_ARGB_2101010	v4l2_fourcc('A', 'R', '3', '0')
42 #define SDE_PIX_FMT_XRGB_2101010	v4l2_fourcc('X', 'R', '3', '0')
43 #define SDE_PIX_FMT_BGRA_1010102	v4l2_fourcc('B', 'A', '3', '0')
44 #define SDE_PIX_FMT_BGRX_1010102	v4l2_fourcc('B', 'X', '3', '0')
45 #define SDE_PIX_FMT_ABGR_2101010	v4l2_fourcc('R', 'A', '3', '0')
46 #define SDE_PIX_FMT_XBGR_2101010	v4l2_fourcc('R', 'X', '3', '0')
47 #define SDE_PIX_FMT_RGBA_1010102_UBWC	v4l2_fourcc('Q', 'R', 'B', 'A')
48 #define SDE_PIX_FMT_RGBX_1010102_UBWC	v4l2_fourcc('Q', 'X', 'B', 'A')
49 #define SDE_PIX_FMT_Y_CBCR_H2V2_P010	v4l2_fourcc('P', '0', '1', '0')
50 #define SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC	V4L2_PIX_FMT_NV12_TP10_UBWC
51 
52 /**
53 * struct msm_sde_rotator_fence - v4l2 buffer fence info
54 * @index: id number of the buffer
55 * @type: enum v4l2_buf_type; buffer type
56 * @fd: file descriptor of the fence associated with this buffer
57 **/
58 struct msm_sde_rotator_fence {
59 	__u32	index;
60 	__u32	type;
61 	__s32	fd;
62 	__u32	reserved[5];
63 };
64 
65 /* SDE Rotator private ioctl ID */
66 #define VIDIOC_G_SDE_ROTATOR_FENCE \
67 	_IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct msm_sde_rotator_fence)
68 #define VIDIOC_S_SDE_ROTATOR_FENCE \
69 	_IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_sde_rotator_fence)
70 
71 /* SDE Rotator private control ID's */
72 #define V4L2_CID_SDE_ROTATOR_SECURE	(V4L2_CID_USER_BASE + 0x1000)
73 
74 #endif /* __UAPI_MSM_SDE_ROTATOR_H__ */
75