aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Foss2018-01-16 07:36:13 -0600
committerRobert Foss2018-02-14 10:33:57 -0600
commit76cd0af39960d0c36e7aacd4fe8d6a08f4af8ecc (patch)
treee097741a140aeac81590d68acdaa90a43293ceee /android
parenta4b6fd651f1b34f13eb3a3bc101a34adfa3b54a5 (diff)
downloadexternal-libgbm-76cd0af39960d0c36e7aacd4fe8d6a08f4af8ecc.tar.gz
external-libgbm-76cd0af39960d0c36e7aacd4fe8d6a08f4af8ecc.tar.xz
external-libgbm-76cd0af39960d0c36e7aacd4fe8d6a08f4af8ecc.zip
android: Add version variable to gralloc_handle_t
The version variable will be used for versioning of this struct and the corresponding accessor functions. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'android')
-rw-r--r--android/gralloc_handle.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h
index 45b9f2e9..7cbc8ee7 100644
--- a/android/gralloc_handle.h
+++ b/android/gralloc_handle.h
@@ -27,6 +27,7 @@
27#define __ANDROID_GRALLOC_HANDLE_H__ 27#define __ANDROID_GRALLOC_HANDLE_H__
28 28
29#include <cutils/native_handle.h> 29#include <cutils/native_handle.h>
30#include <stdint.h>
30 31
31/* support users of drm_gralloc/gbm_gralloc */ 32/* support users of drm_gralloc/gbm_gralloc */
32#define gralloc_gbm_handle_t gralloc_handle_t 33#define gralloc_gbm_handle_t gralloc_handle_t
@@ -49,7 +50,9 @@ struct gralloc_handle_t {
49 */ 50 */
50 int prime_fd; 51 int prime_fd;
51 52
53 /* api variables */
52 int magic; /* differentiate between allocator impls */ 54 int magic; /* differentiate between allocator impls */
55 const uint32_t version; /* api version */
53 56
54 int width; /* width of buffer in pixels */ 57 int width; /* width of buffer in pixels */
55 int height; /* height of buffer in pixels */ 58 int height; /* height of buffer in pixels */
@@ -67,6 +70,7 @@ struct gralloc_handle_t {
67 } __attribute__((aligned(8))); 70 } __attribute__((aligned(8)));
68}; 71};
69 72
73#define GRALLOC_HANDLE_VERSION 1
70#define GRALLOC_HANDLE_MAGIC 0x60585350 74#define GRALLOC_HANDLE_MAGIC 0x60585350
71#define GRALLOC_HANDLE_NUM_FDS 1 75#define GRALLOC_HANDLE_NUM_FDS 1
72#define GRALLOC_HANDLE_NUM_INTS ( \ 76#define GRALLOC_HANDLE_NUM_INTS ( \
@@ -79,7 +83,9 @@ struct gralloc_handle_t {
79static struct gralloc_handle_t gralloc_handle_create(int width, int height, 83static struct gralloc_handle_t gralloc_handle_create(int width, int height,
80 int format, int usage) 84 int format, int usage)
81{ 85{
82 struct gralloc_handle_t handle = { .magic = GRALLOC_HANDLE_MAGIC }; 86 struct alloc_handle_t handle = {
87 .magic = GRALLOC_HANDLE_MAGIC,
88 .version = GRALLOC_HANDLE_VERSION };
83 89
84 native_handle_t *nhandle = native_handle_create(GRALLOC_HANDLE_NUM_FDS, 90 native_handle_t *nhandle = native_handle_create(GRALLOC_HANDLE_NUM_FDS,
85 GRALLOC_HANDLE_NUM_INTS); 91 GRALLOC_HANDLE_NUM_INTS);