Commit c4991ee0 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Rodrigo Vivi

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: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 3856b0f7
...@@ -114,7 +114,7 @@ static inline struct xe_gt *xe_root_mmio_gt(struct xe_device *xe) ...@@ -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; 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; return !xe->info.force_execlist;
} }
......
...@@ -585,7 +585,7 @@ static u32 calc_validate_logical_mask(struct xe_device *xe, struct xe_gt *gt, ...@@ -585,7 +585,7 @@ static u32 calc_validate_logical_mask(struct xe_device *xe, struct xe_gt *gt,
u16 gt_id; u16 gt_id;
u32 return_mask = 0, prev_mask; 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)) len > 1))
return 0; return 0;
......
...@@ -322,7 +322,7 @@ static int execlist_exec_queue_init(struct xe_exec_queue *q) ...@@ -322,7 +322,7 @@ static int execlist_exec_queue_init(struct xe_exec_queue *q)
struct xe_device *xe = gt_to_xe(q->gt); struct xe_device *xe = gt_to_xe(q->gt);
int err; 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"); 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) ...@@ -371,7 +371,7 @@ static void execlist_exec_queue_fini_async(struct work_struct *w)
struct xe_device *xe = gt_to_xe(q->gt); struct xe_device *xe = gt_to_xe(q->gt);
unsigned long flags; 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); spin_lock_irqsave(&exl->port->lock, flags);
if (WARN_ON(exl->active_priority != XE_EXEC_QUEUE_PRIORITY_UNSET)) 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 = { ...@@ -458,7 +458,7 @@ static const struct xe_exec_queue_ops execlist_exec_queue_ops = {
int xe_execlist_init(struct xe_gt *gt) int xe_execlist_init(struct xe_gt *gt)
{ {
/* GuC submission enabled, nothing to do */ /* 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; return 0;
gt->exec_queue_ops = &execlist_exec_queue_ops; gt->exec_queue_ops = &execlist_exec_queue_ops;
......
...@@ -233,7 +233,7 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt) ...@@ -233,7 +233,7 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
xe_gt_assert(gt, seqno > 0); xe_gt_assert(gt, seqno > 0);
if (seqno > 0) if (seqno > 0)
xe_gt_tlb_invalidation_wait(gt, seqno); 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); struct xe_device *xe = gt_to_xe(gt);
if (xe->info.platform == XE_PVC) { if (xe->info.platform == XE_PVC) {
......
...@@ -549,7 +549,7 @@ static int gt_reset(struct xe_gt *gt) ...@@ -549,7 +549,7 @@ static int gt_reset(struct xe_gt *gt)
int err; int err;
/* We only support GT resets with GuC submission */ /* 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; return -ENODEV;
xe_gt_info(gt, "reset started\n"); xe_gt_info(gt, "reset started\n");
...@@ -642,7 +642,7 @@ int xe_gt_suspend(struct xe_gt *gt) ...@@ -642,7 +642,7 @@ int xe_gt_suspend(struct xe_gt *gt)
int err; int err;
/* For now suspend/resume is only allowed with GuC */ /* 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; return -ENODEV;
xe_gt_sanitize(gt); xe_gt_sanitize(gt);
......
...@@ -816,7 +816,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc) ...@@ -816,7 +816,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data)); u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data));
int ret; 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)); xe_device_mem_access_get(pc_to_xe(pc));
......
...@@ -1138,7 +1138,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q) ...@@ -1138,7 +1138,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
long timeout; long timeout;
int err; 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); ge = kzalloc(sizeof(*ge), GFP_KERNEL);
if (!ge) if (!ge)
...@@ -1903,7 +1903,7 @@ void xe_guc_submit_print(struct xe_guc *guc, struct drm_printer *p) ...@@ -1903,7 +1903,7 @@ void xe_guc_submit_print(struct xe_guc *guc, struct drm_printer *p)
struct xe_exec_queue *q; struct xe_exec_queue *q;
unsigned long index; unsigned long index;
if (!xe_device_guc_submission_enabled(guc_to_xe(guc))) if (!xe_device_uc_enabled(guc_to_xe(guc)))
return; return;
mutex_lock(&guc->submission_state.lock); mutex_lock(&guc->submission_state.lock);
......
...@@ -434,7 +434,7 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe, ...@@ -434,7 +434,7 @@ static int hw_engine_init(struct xe_gt *gt, struct xe_hw_engine *hwe,
if (err) if (err)
goto err_hwsp; 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); hwe->exl_port = xe_execlist_port_create(xe, hwe);
if (IS_ERR(hwe->exl_port)) { if (IS_ERR(hwe->exl_port)) {
err = PTR_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, ...@@ -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); xe_hw_engine_enable_ring(hwe);
/* We reserve the highest BCS instance for USM */ /* We reserve the highest BCS instance for USM */
......
...@@ -142,7 +142,7 @@ void xe_irq_enable_hwe(struct xe_gt *gt) ...@@ -142,7 +142,7 @@ void xe_irq_enable_hwe(struct xe_gt *gt)
u32 ccs_mask, bcs_mask; u32 ccs_mask, bcs_mask;
u32 irqs, dmask, smask; u32 irqs, dmask, smask;
if (xe_device_guc_submission_enabled(xe)) { if (xe_device_uc_enabled(xe)) {
irqs = GT_RENDER_USER_INTERRUPT | irqs = GT_RENDER_USER_INTERRUPT |
GT_RENDER_PIPECTL_NOTIFY_INTERRUPT; GT_RENDER_PIPECTL_NOTIFY_INTERRUPT;
} else { } else {
......
...@@ -32,7 +32,7 @@ int xe_uc_init(struct xe_uc *uc) ...@@ -32,7 +32,7 @@ int xe_uc_init(struct xe_uc *uc)
int ret; int ret;
/* GuC submission not enabled, nothing to do */ /* 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 0;
ret = xe_guc_init(&uc->guc); ret = xe_guc_init(&uc->guc);
...@@ -66,7 +66,7 @@ int xe_uc_init(struct xe_uc *uc) ...@@ -66,7 +66,7 @@ int xe_uc_init(struct xe_uc *uc)
int xe_uc_init_post_hwconfig(struct xe_uc *uc) int xe_uc_init_post_hwconfig(struct xe_uc *uc)
{ {
/* GuC submission not enabled, nothing to do */ /* 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 0;
return xe_guc_init_post_hwconfig(&uc->guc); return xe_guc_init_post_hwconfig(&uc->guc);
...@@ -110,7 +110,7 @@ int xe_uc_init_hwconfig(struct xe_uc *uc) ...@@ -110,7 +110,7 @@ int xe_uc_init_hwconfig(struct xe_uc *uc)
int ret; int ret;
/* GuC submission not enabled, nothing to do */ /* 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 0;
ret = xe_guc_min_load_for_hwconfig(&uc->guc); ret = xe_guc_min_load_for_hwconfig(&uc->guc);
...@@ -129,7 +129,7 @@ int xe_uc_init_hw(struct xe_uc *uc) ...@@ -129,7 +129,7 @@ int xe_uc_init_hw(struct xe_uc *uc)
int ret; int ret;
/* GuC submission not enabled, nothing to do */ /* 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 0;
ret = xe_uc_sanitize_reset(uc); ret = xe_uc_sanitize_reset(uc);
...@@ -175,7 +175,7 @@ int xe_uc_fini_hw(struct xe_uc *uc) ...@@ -175,7 +175,7 @@ int xe_uc_fini_hw(struct xe_uc *uc)
int xe_uc_reset_prepare(struct xe_uc *uc) int xe_uc_reset_prepare(struct xe_uc *uc)
{ {
/* GuC submission not enabled, nothing to do */ /* 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 0;
return xe_guc_reset_prepare(&uc->guc); return xe_guc_reset_prepare(&uc->guc);
...@@ -194,7 +194,7 @@ void xe_uc_stop_prepare(struct xe_uc *uc) ...@@ -194,7 +194,7 @@ void xe_uc_stop_prepare(struct xe_uc *uc)
int xe_uc_stop(struct xe_uc *uc) int xe_uc_stop(struct xe_uc *uc)
{ {
/* GuC submission not enabled, nothing to do */ /* 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 0;
return xe_guc_stop(&uc->guc); return xe_guc_stop(&uc->guc);
...@@ -203,7 +203,7 @@ int xe_uc_stop(struct xe_uc *uc) ...@@ -203,7 +203,7 @@ int xe_uc_stop(struct xe_uc *uc)
int xe_uc_start(struct xe_uc *uc) int xe_uc_start(struct xe_uc *uc)
{ {
/* GuC submission not enabled, nothing to do */ /* 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 0;
return xe_guc_start(&uc->guc); return xe_guc_start(&uc->guc);
...@@ -226,7 +226,7 @@ int xe_uc_suspend(struct xe_uc *uc) ...@@ -226,7 +226,7 @@ int xe_uc_suspend(struct xe_uc *uc)
int ret; int ret;
/* GuC submission not enabled, nothing to do */ /* 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 0;
uc_reset_wait(uc); uc_reset_wait(uc);
......
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