mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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>
This commit is contained in:
parent
3856b0f71f
commit
c4991ee01d
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 @@ int xe_uc_init(struct xe_uc *uc)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user