libhwjpeg: resolve compilation errors
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos.git] / include / exynos_ion.h
1 /*
2 * Copyright (C) 2014 Samsung Electronics Co., Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #ifndef _LIB_ION_H_
18 #define _LIB_ION_H_
19
20 #ifndef ION_HEAP_SYSTEM_MASK
21 #define ION_HEAP_SYSTEM_MASK (1 << 0)
22 #endif
23 #define ION_HEAP_EXYNOS_CONTIG_MASK (1 << 4)
24 #define ION_EXYNOS_VIDEO_EXT_MASK (1 << 31)
25 #define ION_EXYNOS_VIDEO_EXT2_MASK (1 << 29)
26 #define ION_EXYNOS_FIMD_VIDEO_MASK (1 << 28)
27 #define ION_EXYNOS_GSC_MASK (1 << 27)
28 #define ION_EXYNOS_MFC_OUTPUT_MASK (1 << 26)
29 #define ION_EXYNOS_MFC_INPUT_MASK (1 << 25)
30 #define ION_EXYNOS_G2D_WFD_MASK (1 << 22)
31 #define ION_EXYNOS_VIDEO_MASK (1 << 21)
32
33 enum {
34 ION_EXYNOS_HEAP_ID_CRYPTO = 1,
35 ION_EXYNOS_HEAP_ID_VIDEO_FW = 2,
36 ION_EXYNOS_HEAP_ID_VIDEO_STREAM = 3,
37 ION_EXYNOS_HEAP_ID_RESERVED = 4,
38 ION_EXYNOS_HEAP_ID_VIDEO_FRAME = 5,
39 ION_EXYNOS_HEAP_ID_VIDEO_SCALER = 6,
40 ION_EXYNOS_HEAP_ID_VIDEO_NFW = 7,
41 ION_EXYNOS_HEAP_ID_GPU_CRC = 8,
42 ION_EXYNOS_HEAP_ID_GPU_BUFFER = 9,
43 ION_EXYNOS_HEAP_ID_CAMERA = 10,
44 };
45
46 #define EXYNOS_ION_HEAP_CRYPTO_MASK (1 << ION_EXYNOS_HEAP_ID_CRYPTO)
47 #define EXYNOS_ION_HEAP_VIDEO_FW_MASK (1 << ION_EXYNOS_HEAP_ID_VIDEO_FW)
48 #define EXYNOS_ION_HEAP_VIDEO_STREAM_MASK (1 << ION_EXYNOS_HEAP_ID_VIDEO_STREAM)
49 #define EXYNOS_ION_HEAP_VIDEO_FRAME_MASK (1 << ION_EXYNOS_HEAP_ID_VIDEO_FRAME)
50 #define EXYNOS_ION_HEAP_VIDEO_SCALER_MASK (1 << ION_EXYNOS_HEAP_ID_VIDEO_SCALER)
51 #define EXYNOS_ION_HEAP_VIDEO_NFW_MASK (1 << ION_EXYNOS_HEAP_ID_VIDEO_NFW)
52 #define EXYNOS_ION_HEAP_GPU_CRC (1 << ION_EXYNOS_HEAP_ID_GPU_CRC)
53 #define EXYNOS_ION_HEAP_GPU_BUFFER (1 << ION_EXYNOS_HEAP_ID_GPU_BUFFER)
54 #define EXYNOS_ION_HEAP_CAMERA (1 << ION_EXYNOS_HEAP_ID_CAMERA)
55
56 /*
57 * Values taken from Linux kernel to keep /system/core clean.
58 * Normally, these would go into libion/kernel-headers/linux/ion.h.
59 */
60 #ifndef ION_FLAG_NOZEROED
61 #define ION_FLAG_NOZEROED 8 /* Allocated buffer is not initialized
62 with zero value and userspace is not
63 able to access the buffer
64 */
65 #endif
66 #ifndef ION_FLAG_PROTECTED
67 #define ION_FLAG_PROTECTED 16 /* this buffer would be used in secure
68 world. if this is set, all cpu accesses
69 are prohibited.
70 */
71 #endif
72 #ifndef ION_FLAG_SYNC_FORCE
73 #define ION_FLAG_SYNC_FORCE 32 /* cache sync forcely at allocation */
74 #endif
75
76 #endif /* _LIB_ION_H_ */