Commit ddc73c46 authored by Matthew Auld's avatar Matthew Auld Committed by Lucas De Marchi
Browse files

drm/xe/bo: add some annotations in bo_put()



If the put() triggers bo destroy then there is at least one potential
sleeping lock. Also annotate bos_lock and ggtt lock.

Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarTejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240911155527.178910-8-matthew.auld@intel.com


(cherry picked from commit 3b04c2cf)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 73d10c77
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2320,6 +2320,20 @@ void xe_bo_put_commit(struct llist_head *deferred)
		drm_gem_object_free(&bo->ttm.base.refcount);
}

void xe_bo_put(struct xe_bo *bo)
{
	might_sleep();
	if (bo) {
#ifdef CONFIG_PROC_FS
		if (bo->client)
			might_lock(&bo->client->bos_lock);
#endif
		if (bo->ggtt_node && bo->ggtt_node->ggtt)
			might_lock(&bo->ggtt_node->ggtt->lock);
		drm_gem_object_put(&bo->ttm.base);
	}
}

/**
 * xe_bo_dumb_create - Create a dumb bo as backing for a fb
 * @file_priv: ...
+1 −5
Original line number Diff line number Diff line
@@ -126,11 +126,7 @@ static inline struct xe_bo *xe_bo_get(struct xe_bo *bo)
	return bo;
}

static inline void xe_bo_put(struct xe_bo *bo)
{
	if (bo)
		drm_gem_object_put(&bo->ttm.base);
}
void xe_bo_put(struct xe_bo *bo);

static inline void __xe_bo_unset_bulk_move(struct xe_bo *bo)
{