On 1/26/2026 11:46 AM, Maarten Lankhorst wrote:
> This extra step is easier to handle inside xe_ggtt.c and makes
> xe_ggtt_node_allocated a simple null check instead, as the intermediate
> state 'allocated but not inserted' is no longer used.
>
> Privatize xe_ggtt_node_fini() and init() as they're no longer used
> outside of xe_ggtt.c
>
> Signed-off-by: Maarten Lankhorst <[email protected]>
> Reviewed-by: Matthew Brost <[email protected]> #v1
Reviewed-by: Michal Wajdeczko <[email protected]>
with one nit below
> ---
> Changelog:
> - rename xe_ggtt_node_insert(,_transform) to
> xe_ggtt_insert_node(,_transform)
> - remove xe prefix from ggtt_node_init/fini()
> - Update xe_ggtt_node doc to point to the correct
> allocation and removal functions
> - Use guard in xe_ggtt_insert_node().
> ---
...
> @@ -669,16 +637,31 @@ struct xe_ggtt_node *xe_ggtt_node_init(struct xe_ggtt
> *ggtt)
> }
>
> /**
> - * xe_ggtt_node_fini - Forcebly finalize %xe_ggtt_node struct
> - * @node: the &xe_ggtt_node to be freed
> + * xe_ggtt_insert_node - Insert a &xe_ggtt_node into the GGTT
> + * @ggtt: the @ggtt into which the node should be inserted.
@ggtt: the &xe_ggtt into which new node should be inserted
> + * @size: size of the node
> + * @align: alignment constrain of the node
> *
> - * If anything went wrong with either xe_ggtt_node_insert() and this @node is
> - * not going to be reused, then this function needs to be called to free the
> - * %xe_ggtt_node struct
> - **/
> -void xe_ggtt_node_fini(struct xe_ggtt_node *node)
> + * Return: &xe_ggtt_node on success or a ERR_PTR on failure.
> + */
> +struct xe_ggtt_node *xe_ggtt_insert_node(struct xe_ggtt *ggtt, u32 size, u32
> align)
> {