On 1/26/2026 11:46 AM, Maarten Lankhorst wrote:
> Fix all functions that use node->start to use xe_ggtt_node_addr,
> and add ggtt->start to node->start.
>
> This will make node shifting for SR-IOV VF a one-liner, instead of
> manually changing each GGTT node's base address.
>
> Also convert some uses of mutex_lock/unlock to mutex guards.
>
> Signed-off-by: Maarten Lankhorst <[email protected]>
Reviewed-by: Michal Wajdeczko <[email protected]>
> ---
> Changes since last version:
> - xe_assert -> xe_tile_assert
> - remove extra null check
> - add guard(mutex) to commit message.
> ---
> drivers/gpu/drm/xe/xe_ggtt.c | 53 +++++++++++++++++++++---------------
> 1 file changed, 31 insertions(+), 22 deletions(-)
>
...
> @@ -1033,9 +1043,8 @@ static void xe_ggtt_assign_locked(struct xe_ggtt *ggtt,
> const struct drm_mm_node
> */
> void xe_ggtt_assign(const struct xe_ggtt_node *node, u16 vfid)
btw, we somehow missed to rename this one to xe_ggtt_node_assign(), but we
could fix that later
> {> - mutex_lock(&node->ggtt->lock);
> - xe_ggtt_assign_locked(node->ggtt, &node->base, vfid);
> - mutex_unlock(&node->ggtt->lock);
> + guard(mutex)(&node->ggtt->lock);
> + xe_ggtt_assign_locked(node, vfid);
> }
>
> /**