2 * Copyright 2016 The Chromium OS Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 #ifndef CROS_GRALLOC_HANDLE_H
8 #define CROS_GRALLOC_HANDLE_H
11 #include <cutils/native_handle.h>
13 #define DRV_MAX_PLANES 4
16 * Only use 32-bit integers in the handle. This guarantees that the handle is
17 * densely packed (i.e, the compiler does not insert any padding).
20 struct cros_gralloc_handle {
22 int32_t fds[DRV_MAX_PLANES];
23 uint32_t strides[DRV_MAX_PLANES];
24 uint32_t offsets[DRV_MAX_PLANES];
25 uint32_t sizes[DRV_MAX_PLANES];
26 uint32_t format_modifiers[2 * DRV_MAX_PLANES];
29 uint32_t format; /* DRM format */
30 uint32_t use_flags[2]; /* Buffer creation flags */
32 uint32_t pixel_stride;
34 int32_t usage; /* Android usage. */
35 uint32_t consumer_usage;
36 uint32_t producer_usage;
37 uint32_t yuv_color_range; // YUV Color range.
38 uint32_t is_updated; // frame updated flag
39 uint32_t is_encoded; // frame encoded flag
40 uint32_t is_encrypted;
41 uint32_t is_key_frame;
42 uint32_t is_interlaced;
43 uint32_t is_mmc_capable;
44 uint32_t compression_mode;
45 uint32_t compression_hint;
49 typedef const struct cros_gralloc_handle *cros_gralloc_handle_t;