Commit 5b993d00 authored by Matthew Brost's avatar Matthew Brost

drm/xe: Move ggtt_fini to devm managed

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: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240820172958.1095143-2-matthew.brost@intel.com
parent 25ebe10e
...@@ -166,7 +166,7 @@ static void ggtt_fini_early(struct drm_device *drm, void *arg) ...@@ -166,7 +166,7 @@ static void ggtt_fini_early(struct drm_device *drm, void *arg)
drm_mm_takedown(&ggtt->mm); 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; struct xe_ggtt *ggtt = arg;
...@@ -374,7 +374,7 @@ int xe_ggtt_init(struct xe_ggtt *ggtt) ...@@ -374,7 +374,7 @@ int xe_ggtt_init(struct xe_ggtt *ggtt)
xe_ggtt_initial_clear(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: err:
ggtt->scratch = NULL; ggtt->scratch = NULL;
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment