libdmabufheap: add additional parameters for legacy sync callback

The legacy sync IOCTLs for some vendors take as an argument a structure
which controls the CMOs. Add a custom_data argument to CpySyncStart(),
CpuSyncEnd(), and all other sync functions accordingly.  Additionally, the
legacy-ION custom sync call-back currently doesn't take a dma_buf fd as an
argument, which is actually required (otherwise, what would you be applying
your CMO to?).  Add dma_buf fd argument for the call-back function
accordingly.

Change-Id: Icb85f241d20b36909e047940011219b58aa779ff
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
diff --git a/BufferAllocatorWrapper.cpp b/BufferAllocatorWrapper.cpp
index 5e0bc61..7c269f8 100644
--- a/BufferAllocatorWrapper.cpp
+++ b/BufferAllocatorWrapper.cpp
@@ -47,16 +47,18 @@
 }
 
 int DmabufHeapCpuSyncStart(BufferAllocator* buffer_allocator, unsigned int dmabuf_fd,
-                           SyncType sync_type, int (*legacy_ion_cpu_sync)(int)) {
+                           SyncType sync_type, int (*legacy_ion_cpu_sync)(int, int, void *),
+                           void *custom_data) {
     if (!buffer_allocator)
         return -EINVAL;
-    return buffer_allocator->CpuSyncStart(dmabuf_fd, sync_type, legacy_ion_cpu_sync);
+    return buffer_allocator->CpuSyncStart(dmabuf_fd, sync_type, legacy_ion_cpu_sync,
+                                          custom_data);
 }
 
 int DmabufHeapCpuSyncEnd(BufferAllocator* buffer_allocator, unsigned int dmabuf_fd,
-                         int (*legacy_ion_cpu_sync)(int)) {
+                         int (*legacy_ion_cpu_sync)(int, int, void *), void *custom_data) {
     if (!buffer_allocator)
         return -EINVAL;
-    return buffer_allocator->CpuSyncEnd(dmabuf_fd, legacy_ion_cpu_sync);
+    return buffer_allocator->CpuSyncEnd(dmabuf_fd, legacy_ion_cpu_sync, custom_data);
 }
 }