aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Foss2018-01-16 11:07:15 -0600
committerRobert Foss2018-02-14 10:33:58 -0600
commite75e0ea2e3e29aa65dff868b1088bd41d9405781 (patch)
treeb44f5a6fdc6e1b22026f780f5c0844709aaa145a /android
parent8e00d5ffbda7ae7ef6e33aa51aa71a0bf347f488 (diff)
downloadexternal-libdrm-e75e0ea2e3e29aa65dff868b1088bd41d9405781.tar.gz
external-libdrm-e75e0ea2e3e29aa65dff868b1088bd41d9405781.tar.xz
external-libdrm-e75e0ea2e3e29aa65dff868b1088bd41d9405781.zip
android: Change gralloc_handle_t members to be fixed width
In order to lessen future alignment issues, lets switch to fixed width integers where possible. This excludes the data_owner since it is a pid_t which in theory could be larger than 32 bits. 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.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h
index 9648b006..b47bee19 100644
--- a/android/gralloc_handle.h
+++ b/android/gralloc_handle.h
@@ -51,15 +51,15 @@ struct gralloc_handle_t {
51 int prime_fd; 51 int prime_fd;
52 52
53 /* api variables */ 53 /* api variables */
54 const int magic; /* differentiate between allocator impls */ 54 const uint32_t magic; /* differentiate between allocator impls */
55 const uint32_t version; /* api version */ 55 const uint32_t version; /* api version */
56 56
57 int width; /* width of buffer in pixels */ 57 uint32_t width; /* width of buffer in pixels */
58 int height; /* height of buffer in pixels */ 58 uint32_t height; /* height of buffer in pixels */
59 int format; /* pixel format (Android) */ 59 uint32_t format; /* pixel format (Android) */
60 int usage; /* android libhardware usage flags */ 60 uint32_t usage; /* android libhardware usage flags */
61 61
62 int stride; /* the stride in bytes */ 62 uint32_t stride; /* the stride in bytes */
63 uint64_t modifier; /* buffer modifiers */ 63 uint64_t modifier; /* buffer modifiers */
64 64
65 int data_owner; /* owner of data (for validation) */ 65 int data_owner; /* owner of data (for validation) */
@@ -69,7 +69,7 @@ struct gralloc_handle_t {
69 } __attribute__((aligned(8))); 69 } __attribute__((aligned(8)));
70}; 70};
71 71
72#define GRALLOC_HANDLE_VERSION 2 72#define GRALLOC_HANDLE_VERSION 3
73#define GRALLOC_HANDLE_MAGIC 0x60585350 73#define GRALLOC_HANDLE_MAGIC 0x60585350
74#define GRALLOC_HANDLE_NUM_FDS 1 74#define GRALLOC_HANDLE_NUM_FDS 1
75#define GRALLOC_HANDLE_NUM_INTS ( \ 75#define GRALLOC_HANDLE_NUM_INTS ( \
@@ -79,8 +79,10 @@ struct gralloc_handle_t {
79/** 79/**
80 * Create a buffer handle. 80 * Create a buffer handle.
81 */ 81 */
82static struct gralloc_handle_t gralloc_handle_create(int width, int height, 82static struct gralloc_handle_t gralloc_handle_create(int32_t width,
83 int format, int usage) 83 int32_t height,
84 int32_t format,
85 int32_t usage)
84{ 86{
85 struct alloc_handle_t handle = { 87 struct alloc_handle_t handle = {
86 .magic = GRALLOC_HANDLE_MAGIC, 88 .magic = GRALLOC_HANDLE_MAGIC,