@@ -530,3 +530,20 @@ fence_init(struct fence *fence, const struct fence_ops *ops,
trace_fence_init(fence);
}
EXPORT_SYMBOL(fence_init);
+
+/**
+ * fence_collection_put - put all the fences in a collection
+ * @collection: [in] the collection to put fences
+ *
+ * This functions unrefs all fences in the collection.
+ */
+void fence_collection_put(struct fence_collection *collection)
+{
+ int i;
+
+ for (i = 0 ; i < collection->num_fences ; i++)
+ fence_put(collection->fences[i]);
+
+ collection->func(collection->user_data);
+}
+EXPORT_SYMBOL(fence_collection_put);
@@ -244,6 +244,8 @@ 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_put(struct fence_collection *collection);
+
/**
* fence_is_signaled_locked - Return an indication if the fence is signaled yet.
* @fence: [in] the fence to check