mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
ion: export ion handle get/put
use ion handle get/put, we can easyly protect the buffer when we use it. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
This commit is contained in:
@@ -402,7 +402,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle)
|
||||
return handle->buffer;
|
||||
}
|
||||
|
||||
static void ion_handle_get(struct ion_handle *handle)
|
||||
void ion_handle_get(struct ion_handle *handle)
|
||||
{
|
||||
kref_get(&handle->ref);
|
||||
}
|
||||
|
||||
@@ -201,6 +201,15 @@ int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle);
|
||||
*/
|
||||
struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd);
|
||||
|
||||
/**
|
||||
* ion_handle_get() - ref ion buffer.
|
||||
*/
|
||||
void ion_handle_get(struct ion_handle *handle);
|
||||
/**
|
||||
* ion_handle_put() - unref ion buffer.
|
||||
*/
|
||||
int ion_handle_put(struct ion_handle *handle);
|
||||
|
||||
#ifdef CONFIG_ARCH_ROCKCHIP
|
||||
struct device;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user