From 3cfcc300058070f0873763abfa604e07ec536da3 Mon Sep 17 00:00:00 2001 From: Rebecca Schultz Zavin Date: Thu, 20 Sep 2012 09:46:19 -0700 Subject: [PATCH] Add explicit sync call to ion library Bug: 6854979 Change-Id: I535d55af897eeb4ed707b5da54f3fbf36afa452c Signed-off-by: Rebecca Schultz Zavin --- include/ion/ion.h | 1 + libion/ion.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/ion/ion.h b/include/ion/ion.h index 78a6e2e1c..018c0a1cb 100644 --- a/include/ion/ion.h +++ b/include/ion/ion.h @@ -31,6 +31,7 @@ int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, struct ion_handle **handle); int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, unsigned int flags, int *handle_fd); +int ion_sync_fd(int fd, int handle_fd); int ion_free(int fd, struct ion_handle *handle); int ion_map(int fd, struct ion_handle *handle, size_t length, int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd); diff --git a/libion/ion.c b/libion/ion.c index 164cec96e..020c35bc4 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -146,3 +146,11 @@ int ion_import(int fd, int share_fd, struct ion_handle **handle) *handle = data.handle; return ret; } + +int ion_sync_fd(int fd, int handle_fd) +{ + struct ion_fd_data data = { + .fd = handle_fd, + }; + return ion_ioctl(fd, ION_IOC_SYNC, &data); +}