[PATCH v2 1/6] drm/xe: Move ggtt_fini to devm managed

Lucas De Marchi lucas.demarchi at intel.com
Fri Aug 23 13:43:14 UTC 2024


On Tue, Aug 20, 2024 at 10:29:53AM GMT, Matthew Brost wrote:
>ggtt->scratch is destroyed via devm, ggtt_fini sets ggtt->scratch to
>NULL, ggtt->scratch in GGTT clears, so ensure ggtt->scratch is set NULL
>before the BO is destroyed.
>
>Signed-off-by: Matthew Brost <matthew.brost at intel.com>

Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>

Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_ggtt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
>index 0cdbc1296e88..21cc9ffcef1c 100644
>--- a/drivers/gpu/drm/xe/xe_ggtt.c
>+++ b/drivers/gpu/drm/xe/xe_ggtt.c
>@@ -132,7 +132,7 @@ static void ggtt_fini_early(struct drm_device *drm, void *arg)
> 	drm_mm_takedown(&ggtt->mm);
> }
>
>-static void ggtt_fini(struct drm_device *drm, void *arg)
>+static void ggtt_fini(void *arg)
> {
> 	struct xe_ggtt *ggtt = arg;
>
>@@ -289,7 +289,7 @@ int xe_ggtt_init(struct xe_ggtt *ggtt)
>
> 	xe_ggtt_initial_clear(ggtt);
>
>-	return drmm_add_action_or_reset(&xe->drm, ggtt_fini, ggtt);
>+	return devm_add_action_or_reset(xe->drm.dev, ggtt_fini, ggtt);
> err:
> 	ggtt->scratch = NULL;
> 	return err;
>-- 
>2.34.1
>


More information about the Intel-xe mailing list