[PATCH 2/2] drm/xe: remove EXEC_QUEUE_FLAG_PERMANENT
Nitin Gote <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
EXEC_QUEUE_FLAG_PERMANENT used to mark kernel-owned exec queues that were only torn down at driver unload, so that guc_exec_queue_destroy() could take a synchronous teardown path for them while user queues went through the async destroy worker. Exec-queue teardown now routes every queue through the single message-based path (with the message layer gating any HW/H2G work behind drm_dev_enter()/drm_dev_exit() and taking a runtime-PM reference only while the device is bound), so the PERMANENT flag no longer has any effect. Drop it and all its users, and renumber the remaining flags to keep the bit range contiguous. Suggested-by: Matthew Brost <[email protected]> Cc: Matthew Brost <[email protected]> Signed-off-by: Nitin Gote <[email protected]> --- drivers/gpu/drm/xe/xe_exec_queue.c | 3 --- drivers/gpu/drm/xe/xe_exec_queue_types.h | 14 ++++++-------- drivers/gpu/drm/xe/xe_gsc.c | 3 +-- drivers/gpu/drm/xe/xe_migrate.c | 2 -- drivers/gpu/drm/xe/xe_pxp_submit.c | 5 ++--- drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 1 - drivers/gpu/drm/xe/xe_vm.c | 1 - 7 files changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c index 9f3d022a1463..c4213bb9c137 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue.c +++ b/drivers/gpu/drm/xe/xe_exec_queue.c @@ -207,9 +207,6 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe, struct xe_gt *gt = hwe->gt; int err; - /* only kernel queues can be permanent */ - XE_WARN_ON((flags & EXEC_QUEUE_FLAG_PERMANENT) && !(flags & EXEC_QUEUE_FLAG_KERNEL)); - q = kzalloc_flex(*q, lrc, width); if (!q) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/xe/xe_exec_queue_types.h b/drivers/gpu/drm/xe/xe_exec_queue_types.h index b2276559c2f6..95f75d61a647 100644 --- a/drivers/gpu/drm/xe/xe_exec_queue_types.h +++ b/drivers/gpu/drm/xe/xe_exec_queue_types.h @@ -135,20 +135,18 @@ struct xe_exec_queue { /* queue used for kernel submission only */ #define EXEC_QUEUE_FLAG_KERNEL BIT(0) -/* kernel engine only destroyed at driver unload */ -#define EXEC_QUEUE_FLAG_PERMANENT BIT(1) /* for VM jobs. Caller needs to hold rpm ref when creating queue with this flag */ -#define EXEC_QUEUE_FLAG_VM BIT(2) +#define EXEC_QUEUE_FLAG_VM BIT(1) /* child of VM queue for multi-tile VM jobs */ -#define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD BIT(3) +#define EXEC_QUEUE_FLAG_BIND_ENGINE_CHILD BIT(2) /* kernel exec_queue only, set priority to highest level */ -#define EXEC_QUEUE_FLAG_HIGH_PRIORITY BIT(4) +#define EXEC_QUEUE_FLAG_HIGH_PRIORITY BIT(3) /* flag to indicate low latency hint to guc */ -#define EXEC_QUEUE_FLAG_LOW_LATENCY BIT(5) +#define EXEC_QUEUE_FLAG_LOW_LATENCY BIT(4) /* for migration (kernel copy, clear, bind) jobs */ -#define EXEC_QUEUE_FLAG_MIGRATE BIT(6) +#define EXEC_QUEUE_FLAG_MIGRATE BIT(5) /* for programming COMMON_SLICE_CHICKEN3 on first submission */ -#define EXEC_QUEUE_FLAG_DISABLE_STATE_CACHE_PERF_FIX BIT(7) +#define EXEC_QUEUE_FLAG_DISABLE_STATE_CACHE_PERF_FIX BIT(6) /** * @flags: flags for this exec queue, should statically setup aside from ban diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c index aab59dc647fb..524ac56bdcc7 100644 --- a/drivers/gpu/drm/xe/xe_gsc.c +++ b/drivers/gpu/drm/xe/xe_gsc.c @@ -478,8 +478,7 @@ int xe_gsc_init_post_hwconfig(struct xe_gsc *gsc) q = xe_exec_queue_create(xe, NULL, BIT(hwe->logical_instance), 1, hwe, - EXEC_QUEUE_FLAG_KERNEL | - EXEC_QUEUE_FLAG_PERMANENT, 0); + EXEC_QUEUE_FLAG_KERNEL, 0); if (IS_ERR(q)) { xe_gt_err(gt, "Failed to create queue for GSC submission\n"); return PTR_ERR(q); diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c index f79d0047bec6..75b83687f1b5 100644 --- a/drivers/gpu/drm/xe/xe_migrate.c +++ b/drivers/gpu/drm/xe/xe_migrate.c @@ -493,7 +493,6 @@ int xe_migrate_init(struct xe_migrate *m) */ m->q = xe_exec_queue_create(xe, vm, logical_mask, 1, hwe0, EXEC_QUEUE_FLAG_KERNEL | - EXEC_QUEUE_FLAG_PERMANENT | EXEC_QUEUE_FLAG_HIGH_PRIORITY | EXEC_QUEUE_FLAG_MIGRATE | EXEC_QUEUE_FLAG_LOW_LATENCY, 0); @@ -501,7 +500,6 @@ int xe_migrate_init(struct xe_migrate *m) m->q = xe_exec_queue_create_class(xe, primary_gt, vm, XE_ENGINE_CLASS_COPY, EXEC_QUEUE_FLAG_KERNEL | - EXEC_QUEUE_FLAG_PERMANENT | EXEC_QUEUE_FLAG_MIGRATE, 0); } if (IS_ERR(m->q)) { diff --git a/drivers/gpu/drm/xe/xe_pxp_submit.c b/drivers/gpu/drm/xe/xe_pxp_submit.c index e60526e30030..5de86a8cf27d 100644 --- a/drivers/gpu/drm/xe/xe_pxp_submit.c +++ b/drivers/gpu/drm/xe/xe_pxp_submit.c @@ -46,7 +46,7 @@ static int allocate_vcs_execution_resources(struct xe_pxp *pxp) return -ENODEV; q = xe_exec_queue_create(xe, NULL, BIT(hwe->logical_instance), 1, hwe, - EXEC_QUEUE_FLAG_KERNEL | EXEC_QUEUE_FLAG_PERMANENT, 0); + EXEC_QUEUE_FLAG_KERNEL, 0); if (IS_ERR(q)) return PTR_ERR(q); @@ -144,8 +144,7 @@ static int allocate_gsc_client_resources(struct xe_gt *gt, } q = xe_exec_queue_create(xe, vm, BIT(hwe->logical_instance), 1, hwe, - EXEC_QUEUE_FLAG_KERNEL | - EXEC_QUEUE_FLAG_PERMANENT, 0); + EXEC_QUEUE_FLAG_KERNEL, 0); if (IS_ERR(q)) { err = PTR_ERR(q); goto bo_out; diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c index a8c831fbee3b..a54138461f44 100644 --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c @@ -354,7 +354,6 @@ int xe_sriov_vf_ccs_init(struct xe_device *xe) ctx->ctx_id = ctx_id; flags = EXEC_QUEUE_FLAG_KERNEL | - EXEC_QUEUE_FLAG_PERMANENT | EXEC_QUEUE_FLAG_MIGRATE; q = xe_exec_queue_create_bind(xe, tile, NULL, flags, 0); if (IS_ERR(q)) { diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 9e0176861cb6..cb6db353147e 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -4955,7 +4955,6 @@ void xe_vm_add_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) /* User VMs and queues only */ xe_assert(xe, !(q->flags & EXEC_QUEUE_FLAG_KERNEL)); - xe_assert(xe, !(q->flags & EXEC_QUEUE_FLAG_PERMANENT)); xe_assert(xe, !(q->flags & EXEC_QUEUE_FLAG_VM)); xe_assert(xe, !(q->flags & EXEC_QUEUE_FLAG_MIGRATE)); xe_assert(xe, vm->xef); -- 2.50.1