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 format_modifiers[2 * DRV_MAX_PLANES];
28 uint32_t format; /* DRM format */
29 uint32_t flags[2]; /* driver creation time flags */
31 uint32_t pixel_stride;
33 int32_t usage; /* Android usage. */
36 typedef const struct cros_gralloc_handle *cros_gralloc_handle_t;