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>main
parent
652bcea5a6
commit
86c62e49c8
|
@ -76,6 +76,11 @@ struct gralloc_handle_t {
|
||||||
((sizeof(struct gralloc_handle_t) - sizeof(native_handle_t))/sizeof(int)) \
|
((sizeof(struct gralloc_handle_t) - sizeof(native_handle_t))/sizeof(int)) \
|
||||||
- GRALLOC_HANDLE_NUM_FDS)
|
- 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.
|
* Create a buffer handle.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue