summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>2023-09-13 16:28:35 -0700
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:41:13 -0500
commitc4991ee01d480c45c789b43eb001a978bf016f58 (patch)
treebc58539225efd22759a61c8a6f0c5e0cd5807514
parent3856b0f71f52b8397887c1765e14d0245d722233 (diff)
drm/xe/uc: Rename guc_submission_enabled() to uc_enabled()
The guc_submission_enabled() function is being used as a boolean toggle for all firmwares and all related features, not just GuC submission. We could add additional flags/functions to distinguish and allow different use-cases (e.g. loading HuC but not using GuC submission), but given that not using GuC is a debug-only scenario having a global switch for all FWs is enough. However, we want to make it clear that this switch turns off everything, so rename it to uc_enabled(). v2: rebase on s/XE_WARN_ON/xe_assert Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: John Harrison <John.C.Harrison@Intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_device.h2
-rw-r--r--drivers/gpu/drm/xe/xe_exec_queue.c2
-rw-r--r--drivers/gpu/drm/xe/xe_execlist.c6
-rw-r--r--drivers/gpu/drm/xe/xe_ggtt.c2
-rw-r--r--drivers/gpu/drm/xe/xe_gt.c4
-rw-r--r--drivers/gpu/drm/xe/xe_guc_pc.c2
-rw-r--r--drivers/gpu/drm/xe/xe_guc_submit.c4
-rw-r--r--drivers/gpu/drm/xe/xe_hw_engine.c4
-rw-r--r--drivers/gpu/drm/xe/xe_irq.c2
-rw-r--r--drivers/gpu/drm/xe/xe_uc.c16
10 files changed, 22 insertions, 22 deletions
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 71582094834c..c4232de40ae0 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -114,7 +114,7 @@ static inline struct xe_gt *xe_root_mmio_gt(struct xe_device *xe)
return xe_device_get_root_tile(xe)->primary_gt;
}
-static inline bool xe_device_guc_submission_enabled(struct xe_device *xe)
+static inline bool xe_device_uc_enabled(struct xe_device *xe)
{
return !xe->info.force_execlist;
}
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index a0b5647923ac..23789122b5b1 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -585,7 +585,7 @@ static u32 calc_validate_logical_mask(struct xe_device *xe, struct xe_gt *gt,
u16 gt_id;
u32 return_mask = 0, prev_mask;
- if (XE_IOCTL_DBG(xe, !xe_device_guc_submission_enabled(xe) &&
+ if (XE_IOCTL_DBG(xe, !xe_device_uc_enabled(xe) &&
len > 1))
return 0;
diff --git a/drivers/gpu/drm/xe/xe_execlist.c b/drivers/gpu/drm/xe/xe_execlist.c
index 5b26b6e35afc..22dfe91b2b83 100644
--- a/drivers/gpu/drm/xe/xe_execlist.c
+++ b/drivers/gpu/drm/xe/xe_execlist.c
@@ -322,7 +322,7 @@ static int execlist_exec_queue_init(struct xe_exec_queue *q)
struct xe_device *xe = gt_to_xe(q->gt);
int err;
- xe_assert(xe, !xe_device_guc_submission_enabled(xe));
+ xe_assert(xe, !xe_device_uc_enabled(xe));
drm_info(&xe->drm, "Enabling execlist submission (GuC submission disabled)\n");
@@ -371,7 +371,7 @@ static void execlist_exec_queue_fini_async(struct work_struct *w)
struct xe_device *xe = gt_to_xe(q->gt);
unsigned long flags;
- xe_assert(xe, !xe_device_guc_submission_enabled(xe));
+ xe_assert(xe, !xe_device_uc_enabled(xe));
spin_lock_irqsave(&exl->port->lock, flags);
if (WARN_ON(exl->active_priority != XE_EXEC_QUEUE_PRIORITY_UNSET))
@@ -458,7 +458,7 @@ static const struct xe_exec_queue_ops execlist_exec_queue_ops = {
int xe_execlist_init(struct xe_gt *gt)
{
/* GuC submission enabled, nothing to do */
- if (xe_device_guc_submission_enabled(gt_to_xe(gt)))
+ if (xe_device_uc_enabled(gt_to_xe(gt)))
return 0;
gt->exec_queue_ops = &execlist_exec_queue_ops;
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c
index 03097f1b7f71..ba34b8784572 100644
--- a/drivers/gpu/drm/xe/xe_ggtt.c
+++ b/drivers/gpu/drm/xe/xe_ggtt.c
@@ -233,7 +233,7 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
xe_gt_assert(gt, seqno > 0);
if (seqno > 0)
xe_gt_tlb_invalidation_wait(gt, seqno);
- } else if (xe_device_guc_submission_enabled(gt_to_xe(gt))) {
+ } else if (xe_device_uc_enabled(gt_to_xe(gt))) {
struct xe_device *xe = gt_to_xe(gt);
if (xe->info.platform == XE_PVC) {
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 06147f26384f..1aa44d4f9ac1 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -549,7 +549,7 @@ static int gt_reset(struct xe_gt *gt)
int err;
/* We only support GT resets with GuC submission */
- if (!xe_device_guc_submission_enabled(gt_to_xe(gt)))
+ if (!xe_device_uc_enabled(gt_to_xe(gt)))
return -ENODEV;
xe_gt_info(gt, "reset started\n");
@@ -642,7 +642,7 @@ int xe_gt_suspend(struct xe_gt *gt)
int err;
/* For now suspend/resume is only allowed with GuC */
- if (!xe_device_guc_submission_enabled(gt_to_xe(gt)))
+ if (!xe_device_uc_enabled(gt_to_xe(gt)))
return -ENODEV;
xe_gt_sanitize(gt);
diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index 99d855680894..8a4d299d6cb0 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -816,7 +816,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data));
int ret;
- xe_gt_assert(gt, xe_device_guc_submission_enabled(xe));
+ xe_gt_assert(gt, xe_device_uc_enabled(xe));
xe_device_mem_access_get(pc_to_xe(pc));
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index f6b630f53928..fd120d8c0af2 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1138,7 +1138,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
long timeout;
int err;
- xe_assert(xe, xe_device_guc_submission_enabled(guc_to_xe(guc)));
+ xe_assert(xe, xe_device_uc_enabled(guc_to_xe(guc)));
ge = kzalloc(sizeof(*ge), GFP_KERNEL);
if (!ge)
@@ -1903,7 +1903,7 @@ void xe_guc_submit_print(struct xe_guc *guc, struct drm_printer *p)
struct xe_exec_queue *q;
unsigned long index;
- if (!xe_device_guc_submission_enabled(guc_to_xe(guc)))
+ if (!xe_device_uc_enabled(guc_to_xe(guc)))
return;
mutex_lock(&guc->submission_state.lock);
diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
index 9c2e212fa4cf..a8681089fb60 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
@@ -434,7 +434,7 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,
if (err)
goto err_hwsp;
- if (!xe_device_guc_submission_enabled(xe)) {
+ if (!xe_device_uc_enabled(xe)) {
hwe->exl_port = xe_execlist_port_create(xe, hwe);
if (IS_ERR(hwe->exl_port)) {
err = PTR_ERR(hwe->exl_port);
@@ -442,7 +442,7 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,
}
}
- if (xe_device_guc_submission_enabled(xe))
+ if (xe_device_uc_enabled(xe))
xe_hw_engine_enable_ring(hwe);
/* We reserve the highest BCS instance for USM */
diff --git a/drivers/gpu/drm/xe/xe_irq.c b/drivers/gpu/drm/xe/xe_irq.c
index 772b8006d98f..ff71a3aa08ce 100644
--- a/drivers/gpu/drm/xe/xe_irq.c
+++ b/drivers/gpu/drm/xe/xe_irq.c
@@ -142,7 +142,7 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
u32 ccs_mask, bcs_mask;
u32 irqs, dmask, smask;
- if (xe_device_guc_submission_enabled(xe)) {
+ if (xe_device_uc_enabled(xe)) {
irqs = GT_RENDER_USER_INTERRUPT |
GT_RENDER_PIPECTL_NOTIFY_INTERRUPT;
} else {
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index a8ecb5c6e01a..5b7d6177c1c2 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -32,7 +32,7 @@ int xe_uc_init(struct xe_uc *uc)
int ret;
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
ret = xe_guc_init(&uc->guc);
@@ -66,7 +66,7 @@ err:
int xe_uc_init_post_hwconfig(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
return xe_guc_init_post_hwconfig(&uc->guc);
@@ -110,7 +110,7 @@ int xe_uc_init_hwconfig(struct xe_uc *uc)
int ret;
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
ret = xe_guc_min_load_for_hwconfig(&uc->guc);
@@ -129,7 +129,7 @@ int xe_uc_init_hw(struct xe_uc *uc)
int ret;
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
ret = xe_uc_sanitize_reset(uc);
@@ -175,7 +175,7 @@ int xe_uc_fini_hw(struct xe_uc *uc)
int xe_uc_reset_prepare(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
return xe_guc_reset_prepare(&uc->guc);
@@ -194,7 +194,7 @@ void xe_uc_stop_prepare(struct xe_uc *uc)
int xe_uc_stop(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
return xe_guc_stop(&uc->guc);
@@ -203,7 +203,7 @@ int xe_uc_stop(struct xe_uc *uc)
int xe_uc_start(struct xe_uc *uc)
{
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
return xe_guc_start(&uc->guc);
@@ -226,7 +226,7 @@ int xe_uc_suspend(struct xe_uc *uc)
int ret;
/* GuC submission not enabled, nothing to do */
- if (!xe_device_guc_submission_enabled(uc_to_xe(uc)))
+ if (!xe_device_uc_enabled(uc_to_xe(uc)))
return 0;
uc_reset_wait(uc);