@@ -532,6 +532,22 @@ fence_init(struct fence *fence, const struct fence_ops *ops,
EXPORT_SYMBOL(fence_init);
/**
+ * fence_collection_wait - Wait for collection of fences to signal
+ * @collection: [in] the collection to wait on
+ *
+ * This functions simplifies the waiting process when one needs to
+ * wait for many fences at the same time.
+ */
+void fence_collection_wait(struct fence_collection *collection)
+{
+ int i;
+
+ for (i = 0 ; i < collection->num_fences ; i++)
+ fence_wait(collection->fences[i], false);
+}
+EXPORT_SYMBOL(fence_collection_wait);
+
+/**
* fence_collection_put - put all the fences in a collection
* @collection: [in] the collection to put fences
*
@@ -244,6 +244,7 @@ int fence_add_callback(struct fence *fence, struct fence_cb *cb,
bool fence_remove_callback(struct fence *fence, struct fence_cb *cb);
void fence_enable_sw_signaling(struct fence *fence);
+void fence_collection_wait(struct fence_collection *collection);
void fence_collection_put(struct fence_collection *collection);
/**