dma-buf/sync_file: Register the merged fence for callbacks

If the merged fence is a fence array, register it for callbacks.
This makes sure that the fence array is notified whenever the
component fences are signaled, and update its internal counter
of pending fences. Without this the fence array will never know
when its fences are signaled.

Change-Id: I69cae79a5e4814f2a6e809abaa1ee8dd34f4b635
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index b29a9e8..8a9cf92 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -158,6 +158,12 @@
 			return -ENOMEM;
 
 		sync_file->fence = &array->base;
+
+		/*
+		 * Register for callbacks so that we know when each fence
+		 * in the array is signaled
+		 */
+		fence_enable_sw_signaling(sync_file->fence);
 	}
 
 	return 0;