]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/xe: Add kernel-doc to some xe_lrc interfaces
authorNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Fri, 31 May 2024 16:12:30 +0000 (09:12 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 31 May 2024 19:59:23 +0000 (15:59 -0400)
Add kernel-doc to xe_lrc_create/destroy and xe_lrc_get/put
interfaces.

v2: Fix kernel-doc for xe_lrc_create(), drop Fixes tag.
    (Matt Brost, Michal Wajdeczko)

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240531161230.32317-1-niranjana.vishwanathapura@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_lrc.c
drivers/gpu/drm/xe/xe_lrc.h

index 26922e1bac82f4b54228829b92c5fd03055a10db..c1bb85d2e243f75d9ce79e418cf5c946e3ef64b0 100644 (file)
@@ -945,6 +945,17 @@ err_lrc_finish:
        return err;
 }
 
+/**
+ * xe_lrc_create - Create a LRC
+ * @hwe: Hardware Engine
+ * @vm: The VM (address space)
+ * @ring_size: LRC ring size
+ *
+ * Allocate and initialize the Logical Ring Context (LRC).
+ *
+ * Return pointer to created LRC upon success and an error pointer
+ * upon failure.
+ */
 struct xe_lrc *xe_lrc_create(struct xe_hw_engine *hwe, struct xe_vm *vm,
                             u32 ring_size)
 {
@@ -964,6 +975,13 @@ struct xe_lrc *xe_lrc_create(struct xe_hw_engine *hwe, struct xe_vm *vm,
        return lrc;
 }
 
+/**
+ * xe_lrc_destroy - Destroy the LRC
+ * @ref: reference to LRC
+ *
+ * Called when ref == 0, release resources held by the Logical Ring Context
+ * (LRC) and free the LRC memory.
+ */
 void xe_lrc_destroy(struct kref *ref)
 {
        struct xe_lrc *lrc = container_of(ref, struct xe_lrc, refcount);
index ebe0e362e43425f928a7f5a68ecc6138397271ca..882c3437ba5c45686b62d327f83f01846e01b69c 100644 (file)
@@ -26,12 +26,25 @@ struct xe_lrc *xe_lrc_create(struct xe_hw_engine *hwe, struct xe_vm *vm,
                             u32 ring_size);
 void xe_lrc_destroy(struct kref *ref);
 
+/**
+ * xe_lrc_get - Get reference to the LRC
+ * @lrc: Logical Ring Context
+ *
+ * Increment reference count of @lrc
+ */
 static inline struct xe_lrc *xe_lrc_get(struct xe_lrc *lrc)
 {
        kref_get(&lrc->refcount);
        return lrc;
 }
 
+/**
+ * xe_lrc_put - Put reference of the LRC
+ * @lrc: Logical Ring Context
+ *
+ * Decrement reference count of @lrc, call xe_lrc_destroy when
+ * reference count reaches 0.
+ */
 static inline void xe_lrc_put(struct xe_lrc *lrc)
 {
        kref_put(&lrc->refcount, xe_lrc_destroy);