Commit 86c62e49 authored by Rob Herring's avatar Rob Herring
Browse files

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's avatarRobert Foss <robert.foss@collabora.com>
Signed-off-by: Rob Herring's avatarRob Herring <robh@kernel.org>
parent 652bcea5
......@@ -76,6 +76,11 @@ struct gralloc_handle_t {
((sizeof(struct gralloc_handle_t) - sizeof(native_handle_t))/sizeof(int)) \
- GRALLOC_HANDLE_NUM_FDS)
static inline struct gralloc_handle_t *gralloc_handle(buffer_handle_t handle)
{
return (struct gralloc_handle_t *)handle;
}
/**
* Create a buffer handle.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment