diff options
author | Matthew Brost <matthew.brost@intel.com> | 2023-08-31 07:58:44 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:40:57 -0500 |
commit | bbd52b6153731908e52f68d7c797bef7c42af4f7 (patch) | |
tree | 942470523d8797bf3ae5e30f09f619e70580a324 /include/drm/drm_gpuvm.h | |
parent | 5ef091fc32a4fe7116a4ecc778369f161de9c11a (diff) |
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: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'include/drm/drm_gpuvm.h')
-rw-r--r-- | include/drm/drm_gpuvm.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 6258849382e1..48311e6d664c 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -1008,6 +1008,16 @@ struct drm_gpuva_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 */ |