diff options
Diffstat (limited to 'include/linux/dma-fence.h')
-rw-r--r-- | include/linux/dma-fence.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h index d51a7d23c358..19f7af905182 100644 --- a/include/linux/dma-fence.h +++ b/include/linux/dma-fence.h | |||
@@ -378,6 +378,30 @@ static inline struct dma_fence *dma_fence_later(struct dma_fence *f1, | |||
378 | return dma_fence_is_signaled(f2) ? NULL : f2; | 378 | return dma_fence_is_signaled(f2) ? NULL : f2; |
379 | } | 379 | } |
380 | 380 | ||
381 | /** | ||
382 | * dma_fence_get_status_locked - returns the status upon completion | ||
383 | * @fence: [in] the dma_fence to query | ||
384 | * | ||
385 | * Drivers can supply an optional error status condition before they signal | ||
386 | * the fence (to indicate whether the fence was completed due to an error | ||
387 | * rather than success). The value of the status condition is only valid | ||
388 | * if the fence has been signaled, dma_fence_get_status_locked() first checks | ||
389 | * the signal state before reporting the error status. | ||
390 | * | ||
391 | * Returns 0 if the fence has not yet been signaled, 1 if the fence has | ||
392 | * been signaled without an error condition, or a negative error code | ||
393 | * if the fence has been completed in err. | ||
394 | */ | ||
395 | static inline int dma_fence_get_status_locked(struct dma_fence *fence) | ||
396 | { | ||
397 | if (dma_fence_is_signaled_locked(fence)) | ||
398 | return fence->status < 0 ? fence->status : 1; | ||
399 | else | ||
400 | return 0; | ||
401 | } | ||
402 | |||
403 | int dma_fence_get_status(struct dma_fence *fence); | ||
404 | |||
381 | signed long dma_fence_wait_timeout(struct dma_fence *, | 405 | signed long dma_fence_wait_timeout(struct dma_fence *, |
382 | bool intr, signed long timeout); | 406 | bool intr, signed long timeout); |
383 | signed long dma_fence_wait_any_timeout(struct dma_fence **fences, | 407 | signed long dma_fence_wait_any_timeout(struct dma_fence **fences, |