am 0d699de0: Merge "Add explicit sync call to ion library" into jb-mr1-dev
* commit '0d699de0fca487328e6dfc86847f33a0214ca253':
Add explicit sync call to ion library
diff --git a/include/ion/ion.h b/include/ion/ion.h
index 78a6e2e..018c0a1 100644
--- a/include/ion/ion.h
+++ b/include/ion/ion.h
@@ -31,6 +31,7 @@
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 164cec9..020c35b 100644
--- a/libion/ion.c
+++ b/libion/ion.c
@@ -146,3 +146,11 @@
*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);
+}