OSDN Git Service

47595992da9cb61a45b7ebdb8005713af102c2ef
[android-x86/external-minigbm.git] / cros_gralloc / cros_gralloc_handle.h
1 /*
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.
5  */
6
7 #ifndef CROS_GRALLOC_HANDLE_H
8 #define CROS_GRALLOC_HANDLE_H
9
10 #include <cstdint>
11 #include <cutils/native_handle.h>
12
13 #define DRV_MAX_PLANES 4
14
15 /*
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).
18  */
19
20 struct cros_gralloc_handle {
21         native_handle_t base;
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];
27         uint32_t width;
28         uint32_t height;
29         uint32_t format;       /* DRM format */
30         uint32_t tiling_mode;
31         uint32_t use_flags[2]; /* Buffer creation flags */
32         uint32_t magic;
33         uint32_t pixel_stride;
34         int32_t droid_format;
35         int32_t usage; /* Android usage. */
36         uint32_t consumer_usage;
37         uint32_t producer_usage;
38         uint32_t yuv_color_range;   // YUV Color range.
39         uint32_t is_updated;        // frame updated flag
40         uint32_t is_encoded;        // frame encoded flag
41         uint32_t is_encrypted;
42         uint32_t is_key_frame;
43         uint32_t is_interlaced;
44         uint32_t is_mmc_capable;
45         uint32_t compression_mode;
46         uint32_t compression_hint;
47         uint32_t codec;
48 };
49
50 typedef const struct cros_gralloc_handle *cros_gralloc_handle_t;
51
52 #endif