@@ -345,6 +345,27 @@ int sync_fence_cancel_async(struct sync_fence *fence,
*/
int sync_fence_wait(struct sync_fence *fence, long timeout);
+/**
+ * sync_fence_is_signaled() - Return an indication if the fence is signaled
+ * @fence: fence to check
+ *
+ * returns 1 if fence is signaled
+ * returns 0 if fence is not signaled
+ * returns < 0 if fence is in error state
+ */
+static inline int
+sync_fence_is_signaled(struct sync_fence *fence)
+{
+ int status;
+
+ status = atomic_read(&fence->status);
+ if (status == 0)
+ return 1;
+ if (status > 0)
+ return 0;
+ return status;
+}
+
#ifdef CONFIG_DEBUG_FS
void sync_timeline_debug_add(struct sync_timeline *obj);