dma-fence: Introduce drm_fence_set_error() helper
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 4 Jan 2017 14:12:22 +0000 (14:12 +0000)
committerSumit Semwal <sumit.semwal@linaro.org>
Mon, 9 Jan 2017 15:43:49 +0000 (21:13 +0530)
commita009e975da5c7d42a7f5eaadc54946eb5f76c9af
tree0ce04fe7768194d60fe9fac2a0baa5946869edd0
parentd6c99f4bf093a58d3ab47caaec74b81f18bc4e3f
dma-fence: Introduce drm_fence_set_error() helper

The dma_fence.error field (formerly known as dma_fence.status) is an
optional field that may be set by drivers before calling
dma_fence_signal(). The field can be used to indicate that the fence was
completed in err rather than with success, and is visible to other
consumers of the fence and to userspace via sync_file.

This patch renames the field from status to error so that its meaning is
hopefully more clear (and distinct from dma_fence_get_status() which is
a composite between the error state and signal state) and adds a helper
that validates the preconditions of when it is suitable to adjust the
error field.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170104141222.6992-3-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence.c
include/linux/dma-fence.h