Skip to content

Commit 7c54886

Browse files
committed
Merge tag 'drm-xe-fixes-2024-02-22' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
UAPI Changes: - Remove support for persistent exec_queues - Drop a reduntant sysfs newline printout Cross-subsystem Changes: Core Changes: Driver Changes: - A three-patch fix for a VM_BIND rebind optimization path - Fix a modpost warning on an xe KUNIT module Signed-off-by: Dave Airlie <[email protected]> From: Thomas Hellstrom <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/ZdcsNrxdWMMM417v@fedora
2 parents bfc7746 + 6650d23 commit 7c54886

File tree

13 files changed

+28
-103
lines changed

13 files changed

+28
-103
lines changed

drivers/gpu/drm/xe/tests/xe_mocs_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ kunit_test_suite(xe_mocs_test_suite);
2121

2222
MODULE_AUTHOR("Intel Corporation");
2323
MODULE_LICENSE("GPL");
24+
MODULE_DESCRIPTION("xe_mocs kunit test");
2425
MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);

drivers/gpu/drm/xe/xe_device.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ static int xe_file_open(struct drm_device *dev, struct drm_file *file)
8383
return 0;
8484
}
8585

86-
static void device_kill_persistent_exec_queues(struct xe_device *xe,
87-
struct xe_file *xef);
88-
8986
static void xe_file_close(struct drm_device *dev, struct drm_file *file)
9087
{
9188
struct xe_device *xe = to_xe_device(dev);
@@ -102,8 +99,6 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file)
10299
mutex_unlock(&xef->exec_queue.lock);
103100
xa_destroy(&xef->exec_queue.xa);
104101
mutex_destroy(&xef->exec_queue.lock);
105-
device_kill_persistent_exec_queues(xe, xef);
106-
107102
mutex_lock(&xef->vm.lock);
108103
xa_for_each(&xef->vm.xa, idx, vm)
109104
xe_vm_close_and_put(vm);
@@ -255,9 +250,6 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
255250
xa_erase(&xe->usm.asid_to_vm, asid);
256251
}
257252

258-
drmm_mutex_init(&xe->drm, &xe->persistent_engines.lock);
259-
INIT_LIST_HEAD(&xe->persistent_engines.list);
260-
261253
spin_lock_init(&xe->pinned.lock);
262254
INIT_LIST_HEAD(&xe->pinned.kernel_bo_present);
263255
INIT_LIST_HEAD(&xe->pinned.external_vram);
@@ -570,37 +562,6 @@ void xe_device_shutdown(struct xe_device *xe)
570562
{
571563
}
572564

573-
void xe_device_add_persistent_exec_queues(struct xe_device *xe, struct xe_exec_queue *q)
574-
{
575-
mutex_lock(&xe->persistent_engines.lock);
576-
list_add_tail(&q->persistent.link, &xe->persistent_engines.list);
577-
mutex_unlock(&xe->persistent_engines.lock);
578-
}
579-
580-
void xe_device_remove_persistent_exec_queues(struct xe_device *xe,
581-
struct xe_exec_queue *q)
582-
{
583-
mutex_lock(&xe->persistent_engines.lock);
584-
if (!list_empty(&q->persistent.link))
585-
list_del(&q->persistent.link);
586-
mutex_unlock(&xe->persistent_engines.lock);
587-
}
588-
589-
static void device_kill_persistent_exec_queues(struct xe_device *xe,
590-
struct xe_file *xef)
591-
{
592-
struct xe_exec_queue *q, *next;
593-
594-
mutex_lock(&xe->persistent_engines.lock);
595-
list_for_each_entry_safe(q, next, &xe->persistent_engines.list,
596-
persistent.link)
597-
if (q->persistent.xef == xef) {
598-
xe_exec_queue_kill(q);
599-
list_del_init(&q->persistent.link);
600-
}
601-
mutex_unlock(&xe->persistent_engines.lock);
602-
}
603-
604565
void xe_device_wmb(struct xe_device *xe)
605566
{
606567
struct xe_gt *gt = xe_root_mmio_gt(xe);

drivers/gpu/drm/xe/xe_device.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ int xe_device_probe(struct xe_device *xe);
4242
void xe_device_remove(struct xe_device *xe);
4343
void xe_device_shutdown(struct xe_device *xe);
4444

45-
void xe_device_add_persistent_exec_queues(struct xe_device *xe, struct xe_exec_queue *q);
46-
void xe_device_remove_persistent_exec_queues(struct xe_device *xe,
47-
struct xe_exec_queue *q);
48-
4945
void xe_device_wmb(struct xe_device *xe);
5046

5147
static inline struct xe_file *to_xe_file(const struct drm_file *file)

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,6 @@ struct xe_device {
341341
struct mutex lock;
342342
} usm;
343343

344-
/** @persistent_engines: engines that are closed but still running */
345-
struct {
346-
/** @lock: protects persistent engines */
347-
struct mutex lock;
348-
/** @list: list of persistent engines */
349-
struct list_head list;
350-
} persistent_engines;
351-
352344
/** @pinned: pinned BO state */
353345
struct {
354346
/** @lock: protected pinned BO list state */

drivers/gpu/drm/xe/xe_exec_queue.c

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ static struct xe_exec_queue *__xe_exec_queue_create(struct xe_device *xe,
6060
q->fence_irq = &gt->fence_irq[hwe->class];
6161
q->ring_ops = gt->ring_ops[hwe->class];
6262
q->ops = gt->exec_queue_ops;
63-
INIT_LIST_HEAD(&q->persistent.link);
6463
INIT_LIST_HEAD(&q->compute.link);
6564
INIT_LIST_HEAD(&q->multi_gt_link);
6665

@@ -326,23 +325,6 @@ static int exec_queue_set_preemption_timeout(struct xe_device *xe,
326325
return q->ops->set_preempt_timeout(q, value);
327326
}
328327

329-
static int exec_queue_set_persistence(struct xe_device *xe, struct xe_exec_queue *q,
330-
u64 value, bool create)
331-
{
332-
if (XE_IOCTL_DBG(xe, !create))
333-
return -EINVAL;
334-
335-
if (XE_IOCTL_DBG(xe, xe_vm_in_preempt_fence_mode(q->vm)))
336-
return -EINVAL;
337-
338-
if (value)
339-
q->flags |= EXEC_QUEUE_FLAG_PERSISTENT;
340-
else
341-
q->flags &= ~EXEC_QUEUE_FLAG_PERSISTENT;
342-
343-
return 0;
344-
}
345-
346328
static int exec_queue_set_job_timeout(struct xe_device *xe, struct xe_exec_queue *q,
347329
u64 value, bool create)
348330
{
@@ -414,7 +396,6 @@ static const xe_exec_queue_set_property_fn exec_queue_set_property_funcs[] = {
414396
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY] = exec_queue_set_priority,
415397
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE] = exec_queue_set_timeslice,
416398
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT] = exec_queue_set_preemption_timeout,
417-
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE] = exec_queue_set_persistence,
418399
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT] = exec_queue_set_job_timeout,
419400
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_TRIGGER] = exec_queue_set_acc_trigger,
420401
[DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_NOTIFY] = exec_queue_set_acc_notify,
@@ -441,6 +422,9 @@ static int exec_queue_user_ext_set_property(struct xe_device *xe,
441422
return -EINVAL;
442423

443424
idx = array_index_nospec(ext.property, ARRAY_SIZE(exec_queue_set_property_funcs));
425+
if (!exec_queue_set_property_funcs[idx])
426+
return -EINVAL;
427+
444428
return exec_queue_set_property_funcs[idx](xe, q, ext.value, create);
445429
}
446430

@@ -704,9 +688,7 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
704688
}
705689

706690
q = xe_exec_queue_create(xe, vm, logical_mask,
707-
args->width, hwe,
708-
xe_vm_in_lr_mode(vm) ? 0 :
709-
EXEC_QUEUE_FLAG_PERSISTENT);
691+
args->width, hwe, 0);
710692
up_read(&vm->lock);
711693
xe_vm_put(vm);
712694
if (IS_ERR(q))
@@ -728,8 +710,6 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
728710
goto kill_exec_queue;
729711
}
730712

731-
q->persistent.xef = xef;
732-
733713
mutex_lock(&xef->exec_queue.lock);
734714
err = xa_alloc(&xef->exec_queue.xa, &id, q, xa_limit_32b, GFP_KERNEL);
735715
mutex_unlock(&xef->exec_queue.lock);
@@ -872,10 +852,7 @@ int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,
872852
if (XE_IOCTL_DBG(xe, !q))
873853
return -ENOENT;
874854

875-
if (!(q->flags & EXEC_QUEUE_FLAG_PERSISTENT))
876-
xe_exec_queue_kill(q);
877-
else
878-
xe_device_add_persistent_exec_queues(xe, q);
855+
xe_exec_queue_kill(q);
879856

880857
trace_xe_exec_queue_close(q);
881858
xe_exec_queue_put(q);

drivers/gpu/drm/xe/xe_exec_queue_types.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,6 @@ struct xe_exec_queue {
105105
struct xe_guc_exec_queue *guc;
106106
};
107107

108-
/**
109-
* @persistent: persistent exec queue state
110-
*/
111-
struct {
112-
/** @xef: file which this exec queue belongs to */
113-
struct xe_file *xef;
114-
/** @link: link in list of persistent exec queues */
115-
struct list_head link;
116-
} persistent;
117-
118108
union {
119109
/**
120110
* @parallel: parallel submission state

drivers/gpu/drm/xe/xe_execlist.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,6 @@ static void execlist_exec_queue_fini_async(struct work_struct *w)
378378
list_del(&exl->active_link);
379379
spin_unlock_irqrestore(&exl->port->lock, flags);
380380

381-
if (q->flags & EXEC_QUEUE_FLAG_PERSISTENT)
382-
xe_device_remove_persistent_exec_queues(xe, q);
383381
drm_sched_entity_fini(&exl->entity);
384382
drm_sched_fini(&exl->sched);
385383
kfree(exl);

drivers/gpu/drm/xe/xe_gt_idle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ void xe_gt_idle_sysfs_init(struct xe_gt_idle *gtidle)
145145
}
146146

147147
if (xe_gt_is_media_type(gt)) {
148-
sprintf(gtidle->name, "gt%d-mc\n", gt->info.id);
148+
sprintf(gtidle->name, "gt%d-mc", gt->info.id);
149149
gtidle->idle_residency = xe_guc_pc_mc6_residency;
150150
} else {
151-
sprintf(gtidle->name, "gt%d-rc\n", gt->info.id);
151+
sprintf(gtidle->name, "gt%d-rc", gt->info.id);
152152
gtidle->idle_residency = xe_guc_pc_rc6_residency;
153153
}
154154

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,8 +1028,6 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)
10281028

10291029
if (xe_exec_queue_is_lr(q))
10301030
cancel_work_sync(&ge->lr_tdr);
1031-
if (q->flags & EXEC_QUEUE_FLAG_PERSISTENT)
1032-
xe_device_remove_persistent_exec_queues(gt_to_xe(q->gt), q);
10331031
release_guc_id(guc, q);
10341032
xe_sched_entity_fini(&ge->entity);
10351033
xe_sched_fini(&ge->sched);

drivers/gpu/drm/xe/xe_pt.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,12 @@ xe_pt_stage_bind_entry(struct xe_ptw *parent, pgoff_t offset,
499499
* this device *requires* 64K PTE size for VRAM, fail.
500500
*/
501501
if (level == 0 && !xe_parent->is_compact) {
502-
if (xe_pt_is_pte_ps64K(addr, next, xe_walk))
502+
if (xe_pt_is_pte_ps64K(addr, next, xe_walk)) {
503+
xe_walk->vma->gpuva.flags |= XE_VMA_PTE_64K;
503504
pte |= XE_PTE_PS64;
504-
else if (XE_WARN_ON(xe_walk->needs_64K))
505+
} else if (XE_WARN_ON(xe_walk->needs_64K)) {
505506
return -EINVAL;
507+
}
506508
}
507509

508510
ret = xe_pt_insert_entry(xe_walk, xe_parent, offset, NULL, pte);
@@ -545,13 +547,16 @@ xe_pt_stage_bind_entry(struct xe_ptw *parent, pgoff_t offset,
545547
*child = &xe_child->base;
546548

547549
/*
548-
* Prefer the compact pagetable layout for L0 if possible.
550+
* Prefer the compact pagetable layout for L0 if possible. Only
551+
* possible if VMA covers entire 2MB region as compact 64k and
552+
* 4k pages cannot be mixed within a 2MB region.
549553
* TODO: Suballocate the pt bo to avoid wasting a lot of
550554
* memory.
551555
*/
552556
if (GRAPHICS_VERx100(tile_to_xe(xe_walk->tile)) >= 1250 && level == 1 &&
553557
covers && xe_pt_scan_64K(addr, next, xe_walk)) {
554558
walk->shifts = xe_compact_pt_shifts;
559+
xe_walk->vma->gpuva.flags |= XE_VMA_PTE_COMPACT;
555560
flags |= XE_PDE_64K;
556561
xe_child->is_compact = true;
557562
}

0 commit comments

Comments
 (0)