[Intel-xe] [PATCH 3/4] drm/gpuva: Add drm_gpuva_for_each_op_reverse
Rodrigo Vivi
rodrigo.vivi at intel.com
Thu Aug 31 18:33:56 UTC 2023
On Thu, Aug 31, 2023 at 08:00:47AM -0700, Matthew Brost wrote:
> Xe will make use of this, add helper to walk op list in reverse when
> unwinding GPUVA operations.
I'm no native, but I got confused here. Would it be better if we
change the order like:
Add a helper to walk op list in reverse. Xe will make use of this
when unwinding GPUVA operations.
with the msg changed:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
This is a patch that is likely better to be propagated with
Xe and not earlier with drm-misc. We will need an explicit ack
from Dave/Daniel on this.
>
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
> include/drm/drm_gpuva_mgr.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/drm/drm_gpuva_mgr.h b/include/drm/drm_gpuva_mgr.h
> index ed8d50200cc3..b2024ae19fd4 100644
> --- a/include/drm/drm_gpuva_mgr.h
> +++ b/include/drm/drm_gpuva_mgr.h
> @@ -557,6 +557,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
> --
> 2.34.1
>
More information about the Intel-xe
mailing list