aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring2018-02-14 17:05:42 -0600
committerRob Herring2018-02-20 14:16:05 -0600
commit86c62e49c81eb56200ec72936462a9a8629d7d1d (patch)
tree9d83f40c8015f2c4fc56138e24521220820db09d
parent652bcea5a609ab6de1f54d2143968c954a37e959 (diff)
downloadexternal-libdrm-86c62e49c81eb56200ec72936462a9a8629d7d1d.tar.gz
external-libdrm-86c62e49c81eb56200ec72936462a9a8629d7d1d.tar.xz
external-libdrm-86c62e49c81eb56200ec72936462a9a8629d7d1d.zip
android: add helper to convert buffer_handle_t to gralloc_handle_t ptr
Clients frequently need to convert a buffer_handle_t (aka native_handle_t *) to a gralloc_handle_t ptr. This is a simple cast, but add an inline function to do the conversion. Reviewed-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--android/gralloc_handle.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/gralloc_handle.h b/android/gralloc_handle.h
index b0f5048c..43255ba5 100644
--- a/android/gralloc_handle.h
+++ b/android/gralloc_handle.h
@@ -76,6 +76,11 @@ struct gralloc_handle_t {
76 ((sizeof(struct gralloc_handle_t) - sizeof(native_handle_t))/sizeof(int)) \ 76 ((sizeof(struct gralloc_handle_t) - sizeof(native_handle_t))/sizeof(int)) \
77 - GRALLOC_HANDLE_NUM_FDS) 77 - GRALLOC_HANDLE_NUM_FDS)
78 78
79static inline struct gralloc_handle_t *gralloc_handle(buffer_handle_t handle)
80{
81 return (struct gralloc_handle_t *)handle;
82}
83
79/** 84/**
80 * Create a buffer handle. 85 * Create a buffer handle.
81 */ 86 */