• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __LINUX_VIDEODEV2_EXYNOS_MEDIA_H
20 #define __LINUX_VIDEODEV2_EXYNOS_MEDIA_H
21 #include <linux/videodev2.h>
22 #define V4L2_CID_EXYNOS_BASE (V4L2_CTRL_CLASS_USER | 0x2000)
23 #define V4L2_CID_CACHEABLE (V4L2_CID_EXYNOS_BASE + 10)
24 #define V4L2_CID_CSC_EQ_MODE (V4L2_CID_EXYNOS_BASE + 100)
25 #define V4L2_CID_CSC_EQ (V4L2_CID_EXYNOS_BASE + 101)
26 #define V4L2_CID_CSC_RANGE (V4L2_CID_EXYNOS_BASE + 102)
27 #define V4L2_CID_CONTENT_PROTECTION (V4L2_CID_EXYNOS_BASE + 201)
28 #define V4L2_PIX_FMT_NV12N v4l2_fourcc('N', 'N', '1', '2')
29 #define V4L2_PIX_FMT_NV12NT v4l2_fourcc('T', 'N', '1', '2')
30 #define V4L2_PIX_FMT_YUV420N v4l2_fourcc('Y', 'N', '1', '2')
31 #define V4L2_PIX_FMT_NV12N_10B v4l2_fourcc('B', 'N', '1', '2')
32 #define V4L2_PIX_FMT_NV12M_S10B v4l2_fourcc('B', 'M', '1', '2')
33 #define V4L2_PIX_FMT_NV21M_S10B v4l2_fourcc('B', 'M', '2', '1')
34 #define V4L2_PIX_FMT_NV16M_S10B v4l2_fourcc('B', 'M', '1', '6')
35 #define V4L2_PIX_FMT_NV61M_S10B v4l2_fourcc('B', 'M', '6', '1')
36 #define V4L2_PIX_FMT_NV12M_P010 v4l2_fourcc('P', 'M', '1', '2')
37 #define V4L2_PIX_FMT_NV21M_P010 v4l2_fourcc('P', 'M', '2', '1')
38 #define V4L2_PIX_FMT_NV16M_P210 v4l2_fourcc('P', 'M', '1', '6')
39 #define V4L2_PIX_FMT_NV61M_P210 v4l2_fourcc('P', 'M', '6', '1')
40 #define V4L2_PIX_FMT_NV12N_P010 v4l2_fourcc('N', 'P', '1', '2')
41 #define V4L2_PIX_FMT_NV12_P010 v4l2_fourcc('P', 'N', '1', '2')
42 #define V4L2_PIX_FMT_NV12M_SBWC_8B v4l2_fourcc('M', '1', 'S', '8')
43 #define V4L2_PIX_FMT_NV12M_SBWC_10B v4l2_fourcc('M', '1', 'S', '1')
44 #define V4L2_PIX_FMT_NV21M_SBWC_8B v4l2_fourcc('M', '2', 'S', '8')
45 #define V4L2_PIX_FMT_NV21M_SBWC_10B v4l2_fourcc('M', '2', 'S', '1')
46 #define V4L2_PIX_FMT_NV12N_SBWC_8B v4l2_fourcc('N', '1', 'S', '8')
47 #define V4L2_PIX_FMT_NV12N_SBWC_10B v4l2_fourcc('N', '1', 'S', '1')
48 #define V4L2_PIX_FMT_NV12M_SBWCL_8B v4l2_fourcc('M', '1', 'L', '8')
49 #define V4L2_PIX_FMT_NV12M_SBWCL_10B v4l2_fourcc('M', '1', 'L', '1')
50 #define V4L2_PIX_FMT_NV12N_SBWCL_8B v4l2_fourcc('N', '1', 'L', '8')
51 #define V4L2_PIX_FMT_NV12N_SBWCL_10B v4l2_fourcc('N', '1', 'L', '1')
52 #define V4L2_PIX_FMT_NV12M_AFBC_8B v4l2_fourcc('M', '1', 'A', '8')
53 #define V4L2_PIX_FMT_NV12M_AFBC_10B v4l2_fourcc('M', '1', 'A', '1')
54 #ifndef __ALIGN_UP
55 #define __ALIGN_UP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
56 #endif
57 #define NV12N_STRIDE(w) (__ALIGN_UP((w), 64))
58 #define NV12N_Y_SIZE(w,h) (NV12N_STRIDE(w) * __ALIGN_UP((h), 16))
59 #define NV12N_CBCR_SIZE(w,h) (NV12N_STRIDE(w) * __ALIGN_UP((h), 16) / 2)
60 #define NV12N_CBCR_BASE(base,w,h) ((base) + NV12N_Y_SIZE((w), (h)))
61 #define NV12N_10B_Y_8B_SIZE(w,h) (__ALIGN_UP((w), 64) * __ALIGN_UP((h), 16) + 256)
62 #define NV12N_10B_Y_2B_SIZE(w,h) ((__ALIGN_UP((w) / 4, 16) * __ALIGN_UP((h), 16) + 64))
63 #define NV12N_10B_CBCR_8B_SIZE(w,h) \
64 (__ALIGN_UP((__ALIGN_UP((w), 64) * (__ALIGN_UP((h), 16) / 2) + 256), 16))
65 #define NV12N_10B_CBCR_2B_SIZE(w,h) ((__ALIGN_UP((w) / 4, 16) * (__ALIGN_UP((h), 16) / 2) + 64))
66 #define NV12N_10B_CBCR_BASE(base,w,h) ((base) + NV12N_10B_Y_8B_SIZE((w), (h)) + NV12N_10B_Y_2B_SIZE((w), (h)))
67 #define YUV420N_Y_SIZE(w,h) (__ALIGN_UP((w), 16) * __ALIGN_UP((h), 16) + 256)
68 #define YUV420N_CB_SIZE(w,h) \
69 (__ALIGN_UP((__ALIGN_UP((w) / 2, 16) * (__ALIGN_UP((h), 16) / 2) + 256), 16))
70 #define YUV420N_CR_SIZE(w,h) \
71 (__ALIGN_UP((__ALIGN_UP((w) / 2, 16) * (__ALIGN_UP((h), 16) / 2) + 256), 16))
72 #define YUV420N_CB_BASE(base,w,h) ((base) + YUV420N_Y_SIZE((w), (h)))
73 #define YUV420N_CR_BASE(base,w,h) (YUV420N_CB_BASE((base), (w), (h)) + YUV420N_CB_SIZE((w), (h)))
74 #define NV12M_Y_SIZE(w,h) (__ALIGN_UP((w), 64) * __ALIGN_UP((h), 16) + 256)
75 #define NV12M_CBCR_SIZE(w,h) ((__ALIGN_UP((w), 64) * __ALIGN_UP((h), 16) / 2) + 256)
76 #define NV12M_Y_2B_SIZE(w,h) (__ALIGN_UP((w / 4), 16) * __ALIGN_UP((h), 16) + 256)
77 #define NV12M_CBCR_2B_SIZE(w,h) ((__ALIGN_UP((w / 4), 16) * __ALIGN_UP((h), 16) / 2) + 256)
78 #define NV16M_Y_SIZE(w,h) (__ALIGN_UP((w), 64) * __ALIGN_UP((h), 16) + 256)
79 #define NV16M_CBCR_SIZE(w,h) (__ALIGN_UP((w), 64) * __ALIGN_UP((h), 16) + 256)
80 #define NV16M_Y_2B_SIZE(w,h) (__ALIGN_UP((w / 4), 16) * __ALIGN_UP((h), 16) + 256)
81 #define NV16M_CBCR_2B_SIZE(w,h) (__ALIGN_UP((w / 4), 16) * __ALIGN_UP((h), 16) + 256)
82 #define S10B_8B_STRIDE(w) (__ALIGN_UP((w), 64))
83 #define S10B_2B_STRIDE(w) (__ALIGN_UP(((w + 3) / 4), 16))
84 #define __COUNT_BLOCKS(x,a) (((x) + ((a) - 1)) / (a))
85 #define SBWC_HEADER_STRIDE_ALIGN 16
86 #define SBWC_PAYLOAD_STRIDE_ALIGN 64
87 #define SBWC_BLOCK_WIDTH 32
88 #define SBWC_BLOCK_HEIGHT 4
89 #define SBWC_ALIGNED_H(h,a) __ALIGN_UP((h), a)
90 #define SBWC_H_BLOCKS(w) __COUNT_BLOCKS((w), SBWC_BLOCK_WIDTH)
91 #define SBWC_8B_STRIDE(w) (__ALIGN_UP((8 / 2) * SBWC_BLOCK_WIDTH, SBWC_PAYLOAD_STRIDE_ALIGN) * SBWC_H_BLOCKS(w))
92 #define SBWC_10B_STRIDE(w) (__ALIGN_UP((10 / 2) * SBWC_BLOCK_WIDTH, SBWC_PAYLOAD_STRIDE_ALIGN) * SBWC_H_BLOCKS(w))
93 #define SBWC_HEADER_STRIDE(w) (__ALIGN_UP(__COUNT_BLOCKS(w, SBWC_BLOCK_WIDTH * 2), SBWC_HEADER_STRIDE_ALIGN))
94 #define SBWC_Y_VSTRIDE_BLOCKS(h,a) __COUNT_BLOCKS(SBWC_ALIGNED_H(h, a), SBWC_BLOCK_HEIGHT)
95 #define SBWC_CBCR_VSTRIDE_BLOCKS(h,a) __COUNT_BLOCKS(SBWC_ALIGNED_H(h, a) / 2, SBWC_BLOCK_HEIGHT)
96 #define SBWC_8B_Y_SIZE(w,h) ((SBWC_8B_STRIDE(w) * SBWC_Y_VSTRIDE_BLOCKS(h, 16)) + 64)
97 #define SBWC_8B_CBCR_SIZE(w,h) ((SBWC_8B_STRIDE(w) * SBWC_CBCR_VSTRIDE_BLOCKS(h, 16)) + 64)
98 #define SBWC_8B_Y_HEADER_SIZE(w,h) ((SBWC_HEADER_STRIDE(w) * SBWC_Y_VSTRIDE_BLOCKS(h, 16)) + 256)
99 #define SBWC_8B_CBCR_HEADER_SIZE(w,h) ((SBWC_HEADER_STRIDE(w) * SBWC_CBCR_VSTRIDE_BLOCKS(h, 16)) + 128)
100 #define SBWC_10B_Y_SIZE(w,h) ((SBWC_10B_STRIDE(w) * SBWC_Y_VSTRIDE_BLOCKS(h, 8)) + 64)
101 #define SBWC_10B_CBCR_SIZE(w,h) ((SBWC_10B_STRIDE(w) * SBWC_CBCR_VSTRIDE_BLOCKS(h, 8)) + 64)
102 #define SBWC_10B_Y_HEADER_SIZE(w,h) ((SBWC_HEADER_STRIDE(w) * SBWC_Y_VSTRIDE_BLOCKS(h, 8)) + 256)
103 #define SBWC_10B_CBCR_HEADER_SIZE(w,h) ((SBWC_HEADER_STRIDE(w) * SBWC_CBCR_VSTRIDE_BLOCKS(h, 8)) + 128)
104 #define SBWC_8B_CBCR_BASE(base,w,h) ((base) + SBWC_8B_Y_SIZE(w, h) + SBWC_8B_Y_HEADER_SIZE(w, h))
105 #define SBWC_10B_CBCR_BASE(base,w,h) ((base) + SBWC_10B_Y_SIZE(w, h) + SBWC_10B_Y_HEADER_SIZE(w, h))
106 #define SBWCL_8B_STRIDE(w,r) (((128 * (r)) / 100) * (((w) + 31) / 32))
107 #define SBWCL_10B_STRIDE(w,r) (((160 * (r)) / 100) * (((w) + 31) / 32))
108 #define SBWCL_8B_Y_SIZE(w,h,r) ((SBWCL_8B_STRIDE(w, r) * ((__ALIGN_UP((h), 16) + 3) / 4)) + 64)
109 #define SBWCL_8B_CBCR_SIZE(w,h,r) ((SBWCL_8B_STRIDE(w, r) * (((__ALIGN_UP((h), 16) / 2) + 3) / 4)) + 64)
110 #define SBWCL_10B_Y_SIZE(w,h,r) ((SBWCL_10B_STRIDE(w, r) * ((__ALIGN_UP((h), 16) + 3) / 4)) + 64)
111 #define SBWCL_10B_CBCR_SIZE(w,h,r) ((SBWCL_10B_STRIDE(w, r) * (((__ALIGN_UP((h), 16) / 2) + 3) / 4)) + 64)
112 #define SBWCL_8B_CBCR_BASE(base,w,h,r) ((base) + SBWCL_8B_Y_SIZE(w, h, r))
113 #define SBWCL_10B_CBCR_BASE(base,w,h,r) ((base) + SBWCL_10B_Y_SIZE(w, h, r))
114 #define AFBC_8B_STRIDE(w) __ALIGN_UP(w, 16)
115 #define AFBC_10B_STRIDE(w) __ALIGN_UP(w * 2, 16)
116 #define AFBC_8B_Y_SIZE(w,h) ((((((w) + 31) / 32) * (((h) + 7) / 8) * 16 + 127) / 128) * 128 + (((w) + 31) / 32) * (((h) + 7) / 8) * 384)
117 #define AFBC_10B_Y_SIZE(w,h) ((((((w) + 31) / 32) * (((h) + 7) / 8) * 16 + 127) / 128) * 128 + (((w) + 31) / 32) * (((h) + 7) / 8) * 512)
118 #endif
119