Commit bbd52b61 authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi

drm/gpuva: Add drm_gpuva_for_each_op_reverse

Add a helper to walk op list in reverse. Xe will make use of this when
unwinding GPUVA operations.

v2: (Rodrigo) reword commit message
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 5ef091fc
......@@ -1007,6 +1007,16 @@ struct drm_gpuva_ops {
#define drm_gpuva_for_each_op_from_reverse(op, ops) \
list_for_each_entry_from_reverse(op, &(ops)->list, entry)
/**
* drm_gpuva_for_each_op_reverse - iterator to walk over &drm_gpuva_ops in reverse
* @op: &drm_gpuva_op to assign in each iteration step
* @ops: &drm_gpuva_ops to walk
*
* This iterator walks over all ops within a given list of operations in reverse
*/
#define drm_gpuva_for_each_op_reverse(op, ops) \
list_for_each_entry_reverse(op, &(ops)->list, entry)
/**
* drm_gpuva_first_op() - returns the first &drm_gpuva_op from &drm_gpuva_ops
* @ops: the &drm_gpuva_ops to get the fist &drm_gpuva_op from
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment