Commit 7c548869 authored by Dave Airlie's avatar Dave Airlie
Browse files

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: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZdcsNrxdWMMM417v@fedora
parents bfc7746a 6650d23f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@ kunit_test_suite(xe_mocs_test_suite);

MODULE_AUTHOR("Intel Corporation");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("xe_mocs kunit test");
MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);
+0 −39
Original line number Diff line number Diff line
@@ -83,9 +83,6 @@ static int xe_file_open(struct drm_device *dev, struct drm_file *file)
	return 0;
}

static void device_kill_persistent_exec_queues(struct xe_device *xe,
					       struct xe_file *xef);

static void xe_file_close(struct drm_device *dev, struct drm_file *file)
{
	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)
	mutex_unlock(&xef->exec_queue.lock);
	xa_destroy(&xef->exec_queue.xa);
	mutex_destroy(&xef->exec_queue.lock);
	device_kill_persistent_exec_queues(xe, xef);

	mutex_lock(&xef->vm.lock);
	xa_for_each(&xef->vm.xa, idx, vm)
		xe_vm_close_and_put(vm);
@@ -255,9 +250,6 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
			xa_erase(&xe->usm.asid_to_vm, asid);
	}

	drmm_mutex_init(&xe->drm, &xe->persistent_engines.lock);
	INIT_LIST_HEAD(&xe->persistent_engines.list);

	spin_lock_init(&xe->pinned.lock);
	INIT_LIST_HEAD(&xe->pinned.kernel_bo_present);
	INIT_LIST_HEAD(&xe->pinned.external_vram);
@@ -570,37 +562,6 @@ void xe_device_shutdown(struct xe_device *xe)
{
}

void xe_device_add_persistent_exec_queues(struct xe_device *xe, struct xe_exec_queue *q)
{
	mutex_lock(&xe->persistent_engines.lock);
	list_add_tail(&q->persistent.link, &xe->persistent_engines.list);
	mutex_unlock(&xe->persistent_engines.lock);
}

void xe_device_remove_persistent_exec_queues(struct xe_device *xe,
					     struct xe_exec_queue *q)
{
	mutex_lock(&xe->persistent_engines.lock);
	if (!list_empty(&q->persistent.link))
		list_del(&q->persistent.link);
	mutex_unlock(&xe->persistent_engines.lock);
}

static void device_kill_persistent_exec_queues(struct xe_device *xe,
					       struct xe_file *xef)
{
	struct xe_exec_queue *q, *next;

	mutex_lock(&xe->persistent_engines.lock);
	list_for_each_entry_safe(q, next, &xe->persistent_engines.list,
				 persistent.link)
		if (q->persistent.xef == xef) {
			xe_exec_queue_kill(q);
			list_del_init(&q->persistent.link);
		}
	mutex_unlock(&xe->persistent_engines.lock);
}

void xe_device_wmb(struct xe_device *xe)
{
	struct xe_gt *gt = xe_root_mmio_gt(xe);
+0 −4
Original line number Diff line number Diff line
@@ -42,10 +42,6 @@ int xe_device_probe(struct xe_device *xe);
void xe_device_remove(struct xe_device *xe);
void xe_device_shutdown(struct xe_device *xe);

void xe_device_add_persistent_exec_queues(struct xe_device *xe, struct xe_exec_queue *q);
void xe_device_remove_persistent_exec_queues(struct xe_device *xe,
					     struct xe_exec_queue *q);

void xe_device_wmb(struct xe_device *xe);

static inline struct xe_file *to_xe_file(const struct drm_file *file)
+0 −8
Original line number Diff line number Diff line
@@ -341,14 +341,6 @@ struct xe_device {
		struct mutex lock;
	} usm;

	/** @persistent_engines: engines that are closed but still running */
	struct {
		/** @lock: protects persistent engines */
		struct mutex lock;
		/** @list: list of persistent engines */
		struct list_head list;
	} persistent_engines;

	/** @pinned: pinned BO state */
	struct {
		/** @lock: protected pinned BO list state */
+5 −28
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ static struct xe_exec_queue *__xe_exec_queue_create(struct xe_device *xe,
	q->fence_irq = &gt->fence_irq[hwe->class];
	q->ring_ops = gt->ring_ops[hwe->class];
	q->ops = gt->exec_queue_ops;
	INIT_LIST_HEAD(&q->persistent.link);
	INIT_LIST_HEAD(&q->compute.link);
	INIT_LIST_HEAD(&q->multi_gt_link);

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

static int exec_queue_set_persistence(struct xe_device *xe, struct xe_exec_queue *q,
				      u64 value, bool create)
{
	if (XE_IOCTL_DBG(xe, !create))
		return -EINVAL;

	if (XE_IOCTL_DBG(xe, xe_vm_in_preempt_fence_mode(q->vm)))
		return -EINVAL;

	if (value)
		q->flags |= EXEC_QUEUE_FLAG_PERSISTENT;
	else
		q->flags &= ~EXEC_QUEUE_FLAG_PERSISTENT;

	return 0;
}

static int exec_queue_set_job_timeout(struct xe_device *xe, struct xe_exec_queue *q,
				      u64 value, bool create)
{
@@ -414,7 +396,6 @@ static const xe_exec_queue_set_property_fn exec_queue_set_property_funcs[] = {
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY] = exec_queue_set_priority,
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_TIMESLICE] = exec_queue_set_timeslice,
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PREEMPTION_TIMEOUT] = exec_queue_set_preemption_timeout,
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_PERSISTENCE] = exec_queue_set_persistence,
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_JOB_TIMEOUT] = exec_queue_set_job_timeout,
	[DRM_XE_EXEC_QUEUE_SET_PROPERTY_ACC_TRIGGER] = exec_queue_set_acc_trigger,
	[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,
		return -EINVAL;

	idx = array_index_nospec(ext.property, ARRAY_SIZE(exec_queue_set_property_funcs));
	if (!exec_queue_set_property_funcs[idx])
		return -EINVAL;

	return exec_queue_set_property_funcs[idx](xe, q, ext.value,  create);
}

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

		q = xe_exec_queue_create(xe, vm, logical_mask,
					 args->width, hwe,
					 xe_vm_in_lr_mode(vm) ? 0 :
					 EXEC_QUEUE_FLAG_PERSISTENT);
					 args->width, hwe, 0);
		up_read(&vm->lock);
		xe_vm_put(vm);
		if (IS_ERR(q))
@@ -728,8 +710,6 @@ int xe_exec_queue_create_ioctl(struct drm_device *dev, void *data,
			goto kill_exec_queue;
	}

	q->persistent.xef = xef;

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

	if (!(q->flags & EXEC_QUEUE_FLAG_PERSISTENT))
	xe_exec_queue_kill(q);
	else
		xe_device_add_persistent_exec_queues(xe, q);

	trace_xe_exec_queue_close(q);
	xe_exec_queue_put(q);
Loading