• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016-2020 ARM Limited. All rights reserved.
3  *
4  * Copyright (C) 2008 The Android Open Source Project
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef MALI_GRALLOC_FORMATS_H_
20 #define MALI_GRALLOC_FORMATS_H_
21 
22 #include <system/graphics.h>
23 
24 #include "mali_gralloc_log.h"
25 
26 #include <aidl/android/hardware/graphics/common/PixelFormat.h>
27 
28 /* Internal formats are represented in gralloc as a 64bit identifier
29  * where the 32 lower bits are a base format and the 32 upper bits are modifiers.
30  *
31  * Modifier bits are divided into mutually exclusive ones and those that are not.
32  */
33 /* Internal format type */
34 typedef uint64_t mali_gralloc_internal_format;
35 
36 /* Internal format masks */
37 #define MALI_GRALLOC_INTFMT_FMT_MASK  0x00000000ffffffffULL
38 #define MALI_GRALLOC_INTFMT_EXT_MASK  0xffffffff00000000ULL
39 #define MALI_GRALLOC_INTFMT_FMT_WRAP_MASK 0x0000ffffULL
40 #define MALI_GRALLOC_INTFMT_EXT_WRAP_MASK 0xffff0000ULL
41 #define MALI_GRALLOC_INTFMT_EXT_WRAP_SHIFT 16
42 
43 /* Format Modifier Bits Locations */
44 #define MALI_GRALLOC_INTFMT_EXTENSION_BIT_START 32
45 
46 /* Internal base formats */
47 
48 /* Base formats that do not have an identical HAL match
49  * are defined starting at the Android private range
50  */
51 #define MALI_GRALLOC_FORMAT_INTERNAL_RANGE_BASE 0x1000
52 
53 typedef enum
54 {
55 	MALI_GRALLOC_FORMAT_TYPE_USAGE,
56 	MALI_GRALLOC_FORMAT_TYPE_INTERNAL,
57 } mali_gralloc_format_type;
58 
59 /*
60  * Internal formats defined to either match HAL_PIXEL_FORMAT_* or extend
61  * where missing. Private formats can be used where no CPU usage is requested.
62  * All pixel formats in this list must explicitly define a strict memory
63  * layout which can be allocated and used by producer(s) and consumer(s).
64  * Flex formats are therefore not included and will be mapped to suitable
65  * internal formats.
66  */
67 typedef enum
68 {
69 	/* Internal definitions for HAL formats. */
70 	MALI_GRALLOC_FORMAT_INTERNAL_UNDEFINED = 0,
71 	MALI_GRALLOC_FORMAT_INTERNAL_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888,
72 	MALI_GRALLOC_FORMAT_INTERNAL_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888,
73 	MALI_GRALLOC_FORMAT_INTERNAL_RGB_888 = HAL_PIXEL_FORMAT_RGB_888,
74 	MALI_GRALLOC_FORMAT_INTERNAL_RGB_565 = HAL_PIXEL_FORMAT_RGB_565,
75 	MALI_GRALLOC_FORMAT_INTERNAL_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888,
76 	MALI_GRALLOC_FORMAT_INTERNAL_RGBA_1010102 = HAL_PIXEL_FORMAT_RGBA_1010102,
77 	/* 16-bit floating point format. */
78 	MALI_GRALLOC_FORMAT_INTERNAL_RGBA_16161616 = HAL_PIXEL_FORMAT_RGBA_FP16,
79 	MALI_GRALLOC_FORMAT_INTERNAL_YV12 = HAL_PIXEL_FORMAT_YV12,
80 	MALI_GRALLOC_FORMAT_INTERNAL_Y8 = HAL_PIXEL_FORMAT_Y8,
81 	MALI_GRALLOC_FORMAT_INTERNAL_Y16 = HAL_PIXEL_FORMAT_Y16,
82 	MALI_GRALLOC_FORMAT_INTERNAL_NV16 = HAL_PIXEL_FORMAT_YCbCr_422_SP,
83 
84 	/* Camera specific HAL formats */
85 	MALI_GRALLOC_FORMAT_INTERNAL_RAW16 = HAL_PIXEL_FORMAT_RAW16,
86 	MALI_GRALLOC_FORMAT_INTERNAL_RAW12 = HAL_PIXEL_FORMAT_RAW12,
87 	MALI_GRALLOC_FORMAT_INTERNAL_RAW10 = HAL_PIXEL_FORMAT_RAW10,
88 	MALI_GRALLOC_FORMAT_INTERNAL_RAW_OPAQUE = HAL_PIXEL_FORMAT_RAW_OPAQUE,
89 	MALI_GRALLOC_FORMAT_INTERNAL_BLOB = HAL_PIXEL_FORMAT_BLOB,
90 
91 	/* Depth and stencil formats */
92 	MALI_GRALLOC_FORMAT_INTERNAL_DEPTH_16 = HAL_PIXEL_FORMAT_DEPTH_16,
93 	MALI_GRALLOC_FORMAT_INTERNAL_DEPTH_24 = HAL_PIXEL_FORMAT_DEPTH_24,
94 	MALI_GRALLOC_FORMAT_INTERNAL_DEPTH_24_STENCIL_8 = HAL_PIXEL_FORMAT_DEPTH_24_STENCIL_8,
95 	MALI_GRALLOC_FORMAT_INTERNAL_DEPTH_32F = HAL_PIXEL_FORMAT_DEPTH_32F,
96 	MALI_GRALLOC_FORMAT_INTERNAL_DEPTH_32F_STENCIL_8 = HAL_PIXEL_FORMAT_DEPTH_32F_STENCIL_8,
97 	MALI_GRALLOC_FORMAT_INTERNAL_STENCIL_8 = HAL_PIXEL_FORMAT_STENCIL_8,
98 
99 	/* Flexible YUV formats would be parsed but not have any representation as
100 	 * internal format itself but one of the ones below.
101 	 */
102 
103 	/* The internal private formats that have no HAL equivivalent are defined
104 	 * afterwards starting at a specific base range.
105 	 */
106 	MALI_GRALLOC_FORMAT_INTERNAL_NV12 = MALI_GRALLOC_FORMAT_INTERNAL_RANGE_BASE,
107 	MALI_GRALLOC_FORMAT_INTERNAL_NV21,
108 	MALI_GRALLOC_FORMAT_INTERNAL_YUV422_8BIT,
109 
110 	/* Extended YUV formats. */
111 	MALI_GRALLOC_FORMAT_INTERNAL_Y0L2,
112 	MALI_GRALLOC_FORMAT_INTERNAL_P010,
113 	MALI_GRALLOC_FORMAT_INTERNAL_P210,
114 	MALI_GRALLOC_FORMAT_INTERNAL_Y210,
115 	MALI_GRALLOC_FORMAT_INTERNAL_Y410,
116 
117 	/*
118 	 * Single-plane (I = interleaved) variants of 8/10-bit YUV formats,
119 	 * where previously not defined.
120 	 */
121 	MALI_GRALLOC_FORMAT_INTERNAL_YUV420_8BIT_I,
122 	MALI_GRALLOC_FORMAT_INTERNAL_YUV420_10BIT_I,
123 	MALI_GRALLOC_FORMAT_INTERNAL_YUV444_10BIT_I,
124 
125 	/* Add more internal formats here. */
126 	MALI_GRALLOC_FORMAT_INTERNAL_R_8 =
127 		static_cast<int>(aidl::android::hardware::graphics::common::PixelFormat::R_8),
128 
129 	/* These are legacy 0.3 gralloc formats used only by the wrap/unwrap macros. */
130 	MALI_GRALLOC_FORMAT_INTERNAL_YV12_WRAP,
131 	MALI_GRALLOC_FORMAT_INTERNAL_Y8_WRAP,
132 	MALI_GRALLOC_FORMAT_INTERNAL_Y16_WRAP,
133 
134 	MALI_GRALLOC_FORMAT_INTERNAL_RANGE_LAST,
135 } mali_gralloc_pixel_format;
136 
137 /*
138  * Compression type
139  */
140 
141 /* This format will use AFBC */
142 #define MALI_GRALLOC_INTFMT_AFBC_BASIC (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 0))
143 
144 
145 /*
146  * AFBC modifier bits (valid with MALI_GRALLOC_INTFMT_AFBC_BASIC)
147  */
148 
149 /* This format uses AFBC split block mode */
150 #define MALI_GRALLOC_INTFMT_AFBC_SPLITBLK (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 2))
151 
152 /* This format uses AFBC wide block mode */
153 #define MALI_GRALLOC_INTFMT_AFBC_WIDEBLK (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 3))
154 
155 /* This format uses AFBC tiled headers */
156 #define MALI_GRALLOC_INTFMT_AFBC_TILED_HEADERS (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 4))
157 
158 /* This format uses AFBC extra wide superblocks. */
159 #define MALI_GRALLOC_INTFMT_AFBC_EXTRAWIDEBLK (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 5))
160 
161 /* This format is AFBC with double body buffer (used as a frontbuffer) */
162 #define MALI_GRALLOC_INTFMT_AFBC_DOUBLE_BODY (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 6))
163 
164 /* This format uses AFBC buffer content hints in LSB of superblock offset. */
165 #define MALI_GRALLOC_INTFMT_AFBC_BCH (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 7))
166 
167 /* This format uses AFBC with YUV transform. */
168 #define MALI_GRALLOC_INTFMT_AFBC_YUV_TRANSFORM (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 8))
169 
170 /* This format uses Sparse allocated AFBC. */
171 #define MALI_GRALLOC_INTFMT_AFBC_SPARSE (1ULL << (MALI_GRALLOC_INTFMT_EXTENSION_BIT_START + 9))
172 
173 /* This mask should be used to check or clear support for AFBC for an internal format.
174  */
175 #define MALI_GRALLOC_INTFMT_AFBCENABLE_MASK (uint64_t)(MALI_GRALLOC_INTFMT_AFBC_BASIC)
176 
177 
178 /* These are legacy Gralloc 0.3 support macros for passing private formats through the 0.3 alloc interface.
179  * It packs modifier bits together with base format into a 32 bit format identifier.
180  * Gralloc 1.0 interface should use private functions to set private buffer format in the buffer descriptor.
181  *
182  * Packing:
183  *
184  * Bits 15-0:    mali_gralloc_pixel_format format
185  * Bits 31-16:   modifier bits
186  */
mali_gralloc_format_wrapper(int format,int modifiers)187 static inline int mali_gralloc_format_wrapper(int format, int modifiers)
188 {
189 	/* Internal formats that are identical to HAL formats
190 	 * have the same definition. This is convenient for
191 	 * client parsing code to not have to parse them separately.
192 	 *
193 	 * For 3 of the HAL YUV formats that have very large definitions
194 	 * this causes problems for packing in modifier bits.
195 	 * Because of this reason we redefine these three formats
196 	 * while packing/unpacking them.
197 	 */
198 	if (format == MALI_GRALLOC_FORMAT_INTERNAL_YV12)
199 	{
200 		format = MALI_GRALLOC_FORMAT_INTERNAL_YV12_WRAP;
201 	}
202 	else if (format == MALI_GRALLOC_FORMAT_INTERNAL_Y8)
203 	{
204 		format = MALI_GRALLOC_FORMAT_INTERNAL_Y8_WRAP;
205 	}
206 	else if (format == MALI_GRALLOC_FORMAT_INTERNAL_Y16)
207 	{
208 		format = MALI_GRALLOC_FORMAT_INTERNAL_Y16_WRAP;
209 	}
210 
211 	if (format & ~MALI_GRALLOC_INTFMT_FMT_WRAP_MASK)
212 	{
213 		format = MALI_GRALLOC_FORMAT_INTERNAL_UNDEFINED;
214 		MALI_GRALLOC_LOGE("Format is too large for private format wrapping");
215 	}
216 
217 	return (modifiers | format);
218 }
219 
mali_gralloc_format_unwrap(int x)220 static inline uint64_t mali_gralloc_format_unwrap(int x)
221 {
222 	uint64_t internal_format = (uint64_t)(((((uint64_t)(x)) & MALI_GRALLOC_INTFMT_EXT_WRAP_MASK) << MALI_GRALLOC_INTFMT_EXT_WRAP_SHIFT) | // Modifier bits
223 	                                       (((uint64_t)(x)) & MALI_GRALLOC_INTFMT_FMT_WRAP_MASK)); // Private format
224 
225 	uint64_t base_format = internal_format & MALI_GRALLOC_INTFMT_FMT_MASK;
226 	uint64_t modifiers = internal_format & MALI_GRALLOC_INTFMT_EXT_MASK;
227 
228 	if (base_format == MALI_GRALLOC_FORMAT_INTERNAL_YV12_WRAP)
229 	{
230 		base_format = MALI_GRALLOC_FORMAT_INTERNAL_YV12;
231 	}
232 	else if (base_format == MALI_GRALLOC_FORMAT_INTERNAL_Y8_WRAP)
233 	{
234 	 	base_format = MALI_GRALLOC_FORMAT_INTERNAL_Y8;
235 	}
236 	else if (base_format == MALI_GRALLOC_FORMAT_INTERNAL_Y16_WRAP)
237 	{
238 		base_format = MALI_GRALLOC_FORMAT_INTERNAL_Y16;
239 	}
240 
241 	return (modifiers | base_format);
242 }
243 
244 /*
245  * Macro to add additional modifier(s) to existing wrapped private format.
246  * Arguments include wrapped private format and new modifier(s) to add.
247  */
248 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(x, modifiers) \
249 	((int)((x) | ((unsigned)((modifiers) >> MALI_GRALLOC_INTFMT_EXT_WRAP_SHIFT))))
250 
251 /*
252  * Macro to remove modifier(s) to existing wrapped private format.
253  * Arguments include wrapped private format and modifier(s) to remove.
254  */
255 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_REMOVE_MODIFIER(x, modifiers) \
256 	((int)((x) & ~((unsigned)((modifiers) >> MALI_GRALLOC_INTFMT_EXT_WRAP_SHIFT))))
257 
258 #define GRALLOC_PRIVATE_FORMAT_WRAPPER(x) (mali_gralloc_format_wrapper(x, 0))
259 
260 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC(x)                                                           \
261 	mali_gralloc_format_wrapper(x, (MALI_GRALLOC_INTFMT_AFBC_BASIC | MALI_GRALLOC_INTFMT_AFBC_SPARSE) >> \
262 	                                   MALI_GRALLOC_INTFMT_EXT_WRAP_SHIFT)
263 
264 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_SPLITBLK(x)                                 \
265 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC(x), \
266 	                                            MALI_GRALLOC_INTFMT_AFBC_SPLITBLK)
267 
268 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_WIDEBLK(x)                                  \
269 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC(x), \
270 	                                            MALI_GRALLOC_INTFMT_AFBC_WIDEBLK)
271 
272 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_WIDE_SPLIT(x)                                        \
273 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_SPLITBLK(x), \
274 	                                            MALI_GRALLOC_INTFMT_AFBC_WIDEBLK)
275 
276 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_BASIC(x)                      \
277 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC(x), \
278 	                                            MALI_GRALLOC_INTFMT_AFBC_TILED_HEADERS)
279 
280 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_WIDE(x)                               \
281 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_WIDEBLK(x), \
282 	                                            MALI_GRALLOC_INTFMT_AFBC_TILED_HEADERS)
283 
284 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_SPLIT(x)                               \
285 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_SPLITBLK(x), \
286 	                                            MALI_GRALLOC_INTFMT_AFBC_TILED_HEADERS)
287 
288 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_WIDE_SPLIT(x)                            \
289 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_WIDE_SPLIT(x), \
290 	                                            MALI_GRALLOC_INTFMT_AFBC_TILED_HEADERS)
291 
292 /*
293  * AFBC format with extra-wide (64x4) superblocks.
294  *
295  * NOTE: Tiled headers are mandatory for this format.
296  */
297 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_EXTRAWIDEBLK(x)                                                 \
298 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_BASIC(x), \
299 	                                            MALI_GRALLOC_INTFMT_AFBC_EXTRAWIDEBLK)
300 
301 /*
302  * AFBC multi-plane YUV format where luma (wide, 32x8) and
303  * chroma (extra-wide, 64x4) planes are stored in separate AFBC buffers.
304  *
305  * NOTE: Tiled headers are mandatory for this format.
306  * NOTE: Base format (x) must be a multi-plane YUV format.
307  */
308 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_WIDE_EXTRAWIDE(x)                                        \
309 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_EXTRAWIDEBLK(x), \
310 	                                            MALI_GRALLOC_INTFMT_AFBC_WIDEBLK)
311 
312 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_DOUBLE_BODY(x)                                            \
313 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_BASIC(x), \
314 	                                            MALI_GRALLOC_INTFMT_AFBC_DOUBLE_BODY)
315 
316 #define GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_SPLIT_DOUBLE_BODY(x)                                      \
317 	GRALLOC_PRIVATE_FORMAT_WRAPPER_ADD_MODIFIER(GRALLOC_PRIVATE_FORMAT_WRAPPER_AFBC_TILED_HEADERS_SPLIT(x), \
318 	                                            MALI_GRALLOC_INTFMT_AFBC_DOUBLE_BODY)
319 
320 #define GRALLOC_PRIVATE_FORMAT_UNWRAP(x) mali_gralloc_format_unwrap(x)
321 
322 /* IP block capability masks */
323 #define MALI_GRALLOC_FORMAT_CAPABILITY_OPTIONS_PRESENT ((uint64_t)1 << 0)
324 
325 /* For IPs which can't read/write YUV with AFBC encoding use flag AFBC_YUV_READ/AFBC_YUV_WRITE */
326 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_BASIC ((uint64_t)1 << 1)
327 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_SPLITBLK ((uint64_t)1 << 2)
328 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_WIDEBLK ((uint64_t)1 << 3)
329 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_WRITE_NON_SPARSE ((uint64_t)1 << 4)
330 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_RESERVED_2 ((uint64_t)1 << 5)
331 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_RESERVED_3 ((uint64_t)1 << 6)
332 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_TILED_HEADERS ((uint64_t)1 << 7)
333 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_EXTRAWIDEBLK ((uint64_t)1 << 8)
334 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_MULTIPLANE_READ ((uint64_t)1 << 9)
335 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_DOUBLE_BODY ((uint64_t)1 << 10)
336 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_YUV_READ ((uint64_t)1 << 11)
337 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_YUV_WRITE ((uint64_t)1 << 12)
338 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_RGBA16161616 ((uint64_t)1 << 13)
339 
340 
341 #define MALI_GRALLOC_FORMAT_CAPABILITY_PIXFMT_RGBA1010102 ((uint64_t)1 << 32)
342 #define MALI_GRALLOC_FORMAT_CAPABILITY_PIXFMT_RGBA16161616 ((uint64_t)1 << 33)
343 
344 #define MALI_GRALLOC_FORMAT_CAPABILITY_AFBCENABLE_MASK                                                     \
345 	((uint64_t)(MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_BASIC | MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_SPLITBLK | \
346 	            MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_WIDEBLK | MALI_GRALLOC_FORMAT_CAPABILITY_AFBC_TILED_HEADERS))
347 
348 struct mali_gralloc_format_caps
349 {
350 	uint64_t caps_mask = 0;
351 };
352 typedef struct mali_gralloc_format_caps mali_gralloc_format_caps;
353 
354 #define MALI_GRALLOC_FORMATCAPS_SYM_NAME mali_gralloc_format_capabilities
355 #define MALI_GRALLOC_FORMATCAPS_SYM_NAME_STR "mali_gralloc_format_capabilities"
356 
357 /* Internal prototypes */
358 #if defined(GRALLOC_LIBRARY_BUILD)
359 
360 void mali_gralloc_adjust_dimensions(const uint64_t internal_format,
361                                     const uint64_t usage,
362                                     uint64_t* const width,
363                                     uint64_t* const height);
364 
365 uint64_t mali_gralloc_select_format(const uint64_t req_format,
366                                     const mali_gralloc_format_type type,
367                                     const uint64_t usage);
368 
369 bool is_subsampled_yuv(const uint32_t base_format);
370 #endif
371 
372 bool is_exynos_format(uint32_t base_format);
373 
374 uint8_t get_exynos_fd_count(uint32_t format);
375 
376 #endif /* MALI_GRALLOC_FORMATS_H_ */
377