summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_lrc.h
diff options
context:
space:
mode:
authorNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>2024-05-29 20:22:10 -0700
committerMatthew Brost <matthew.brost@intel.com>2024-05-29 23:44:41 -0700
commit264eecdba211bbeb8c0ed313ffe03e9dd1e20262 (patch)
tree7fce4cfc2ca3a4f0f93084c7e554fcfa8840ec1f /drivers/gpu/drm/xe/xe_lrc.h
parent0568a4086a6c7386885eb2ac2dae3f7186eb503f (diff)
drm/xe: Decouple xe_exec_queue and xe_lrc
Decouple xe_lrc from xe_exec_queue and reference count xe_lrc. Removing hard coupling between xe_exec_queue and xe_lrc allows flexible design where the user interface xe_exec_queue can be destroyed independent of the hardware/firmware interface xe_lrc. v2: Fix lrc indexing in wq_item_append() Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240530032211.29299-1-niranjana.vishwanathapura@intel.com
Diffstat (limited to 'drivers/gpu/drm/xe/xe_lrc.h')
-rw-r--r--drivers/gpu/drm/xe/xe_lrc.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
index c2df6bfd1889..ebe0e362e434 100644
--- a/drivers/gpu/drm/xe/xe_lrc.h
+++ b/drivers/gpu/drm/xe/xe_lrc.h
@@ -7,6 +7,8 @@
#include <linux/types.h>
+#include "xe_lrc_types.h"
+
struct drm_printer;
struct xe_bb;
struct xe_device;
@@ -20,9 +22,20 @@ struct xe_vm;
#define LRC_PPHWSP_SCRATCH_ADDR (0x34 * 4)
-int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
- struct xe_exec_queue *q, struct xe_vm *vm, u32 ring_size);
-void xe_lrc_finish(struct xe_lrc *lrc);
+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);
+
+static inline struct xe_lrc *xe_lrc_get(struct xe_lrc *lrc)
+{
+ kref_get(&lrc->refcount);
+ return lrc;
+}
+
+static inline void xe_lrc_put(struct xe_lrc *lrc)
+{
+ kref_put(&lrc->refcount, xe_lrc_destroy);
+}
size_t xe_gt_lrc_size(struct xe_gt *gt, enum xe_engine_class class);
u32 xe_lrc_pphwsp_offset(struct xe_lrc *lrc);