History

Revert "drm/xe/multi_queue: Support active group after primary is destroyed"

This reverts commit 3131a43ecb346ae3b5287ee195779fc38c6fcd11. There is no must have requirement for this feature from Compute UMD.

Niranjana Vishwanathapura committed 10 months ago

Commit caaed1d1 parent e70711b5 files · +3 −69Browse files

Unified · Split

5 files
  1. drivers/gpu/drm/xe/xe_device.c +1 −6
  2. drivers/gpu/drm/xe/xe_exec_queue.c +2 −53
  3. drivers/gpu/drm/xe/xe_exec_queue.h +0 −2
  4. drivers/gpu/drm/xe/xe_exec_queue_types.h +0 −4
  5. include/uapi/drm/xe_drm.h +0 −4
drivers/gpu/drm/xe/xe_device.c+1−6
@@ -180,12 +180,7 @@ static void xe_file_close(struct drm_device *dev, struct drm_file *file) · 179 unmodified lines
180 xa_for_each(&xef->exec_queue.xa, idx, q) {180 xa_for_each(&xef->exec_queue.xa, idx, q) {
181 if (q->vm && q->hwe->hw_engine_group)181 if (q->vm && q->hwe->hw_engine_group)
182 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);182 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
183 183 xe_exec_queue_kill(q);
184 if (xe_exec_queue_is_multi_queue_primary(q))
185 xe_exec_queue_group_kill_put(q->multi_queue.group);
186 else
187 xe_exec_queue_kill(q);
188
189 xe_exec_queue_put(q);184 xe_exec_queue_put(q);
190 }185 }
191 xa_for_each(&xef->vm.xa, idx, vm)186 xa_for_each(&xef->vm.xa, idx, vm)
drivers/gpu/drm/xe/xe_exec_queue.c+2−53
@@ -467,26 +467,6 @@ struct xe_exec_queue *xe_exec_queue_create_bind(struct xe_device *xe, · 466 unmodified lines
467}467}
468ALLOW_ERROR_INJECTION(xe_exec_queue_create_bind, ERRNO);468ALLOW_ERROR_INJECTION(xe_exec_queue_create_bind, ERRNO);
469 469
470static void xe_exec_queue_group_kill(struct kref *ref)
471{
472 struct xe_exec_queue_group *group = container_of(ref, struct xe_exec_queue_group,
473 kill_refcount);
474 xe_exec_queue_kill(group->primary);
475}
476
477static inline void xe_exec_queue_group_kill_get(struct xe_exec_queue_group *group)
478{
479 kref_get(&group->kill_refcount);
480}
481
482void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group)
483{
484 if (!group)
485 return;
486
487 kref_put(&group->kill_refcount, xe_exec_queue_group_kill);
488}
489
490void xe_exec_queue_destroy(struct kref *ref)470void xe_exec_queue_destroy(struct kref *ref)
491{471{
492 struct xe_exec_queue *q = container_of(ref, struct xe_exec_queue, refcount);472 struct xe_exec_queue *q = container_of(ref, struct xe_exec_queue, refcount);
@@ -716,7 +696,6 @@ static int xe_exec_queue_group_init(struct xe_device *xe, struct xe_exec_queue * · 223 unmodified lines
716 group->primary = q;696 group->primary = q;
717 group->cgp_bo = bo;697 group->cgp_bo = bo;
718 INIT_LIST_HEAD(&group->list);698 INIT_LIST_HEAD(&group->list);
719 kref_init(&group->kill_refcount);
720 xa_init_flags(&group->xa, XA_FLAGS_ALLOC1);699 xa_init_flags(&group->xa, XA_FLAGS_ALLOC1);
721 mutex_init(&group->list_lock);700 mutex_init(&group->list_lock);
722 q->multi_queue.group = group;701 q->multi_queue.group = group;
@@ -792,11 +771,6 @@ static int xe_exec_queue_group_add(struct xe_device *xe, struct xe_exec_queue *q · 69 unmodified lines
792 771
793 q->multi_queue.pos = pos;772 q->multi_queue.pos = pos;
794 773
795 if (group->primary->multi_queue.keep_active) {
796 xe_exec_queue_group_kill_get(group);
797 q->multi_queue.keep_active = true;
798 }
799
800 return 0;774 return 0;
801}775}
802 776
@@ -810,11 +784,6 @@ static void xe_exec_queue_group_delete(struct xe_device *xe, struct xe_exec_queu · 7 unmodified lines
810 lrc = xa_erase(&group->xa, q->multi_queue.pos);784 lrc = xa_erase(&group->xa, q->multi_queue.pos);
811 xe_assert(xe, lrc);785 xe_assert(xe, lrc);
812 xe_lrc_put(lrc);786 xe_lrc_put(lrc);
813
814 if (q->multi_queue.keep_active) {
815 xe_exec_queue_group_kill_put(group);
816 q->multi_queue.keep_active = false;
817 }
818}787}
819 788
820static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue *q,789static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue *q,
@@ -836,24 +805,12 @@ static int exec_queue_set_multi_group(struct xe_device *xe, struct xe_exec_queue · 15 unmodified lines
836 return -EINVAL;805 return -EINVAL;
837 806
838 if (value & DRM_XE_MULTI_GROUP_CREATE) {807 if (value & DRM_XE_MULTI_GROUP_CREATE) {
839 if (XE_IOCTL_DBG(xe, value & ~(DRM_XE_MULTI_GROUP_CREATE |808 if (XE_IOCTL_DBG(xe, value & ~DRM_XE_MULTI_GROUP_CREATE))
840 DRM_XE_MULTI_GROUP_KEEP_ACTIVE)))
841 return -EINVAL;
842
843 /*
844 * KEEP_ACTIVE is not supported in preempt fence mode as in that mode,
845 * VM_DESTROY ioctl expects all exec queues of that VM are already killed.
846 */
847 if (XE_IOCTL_DBG(xe, (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE) &&
848 xe_vm_in_preempt_fence_mode(q->vm)))
849 return -EINVAL;809 return -EINVAL;
850 810
851 q->multi_queue.valid = true;811 q->multi_queue.valid = true;
852 q->multi_queue.is_primary = true;812 q->multi_queue.is_primary = true;
853 q->multi_queue.pos = 0;813 q->multi_queue.pos = 0;
854 if (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE)
855 q->multi_queue.keep_active = true;
856
857 return 0;814 return 0;
858 }815 }
859 816
@@ -1419,11 +1376,6 @@ void xe_exec_queue_kill(struct xe_exec_queue *q) · 559 unmodified lines
1419 1376
1420 q->ops->kill(q);1377 q->ops->kill(q);
1421 xe_vm_remove_compute_exec_queue(q->vm, q);1378 xe_vm_remove_compute_exec_queue(q->vm, q);
1422
1423 if (!xe_exec_queue_is_multi_queue_primary(q) && q->multi_queue.keep_active) {
1424 xe_exec_queue_group_kill_put(q->multi_queue.group);
1425 q->multi_queue.keep_active = false;
1426 }
1427}1379}
1428 1380
1429int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,1381int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data,
@@ -1450,10 +1402,7 @@ int xe_exec_queue_destroy_ioctl(struct drm_device *dev, void *data, · 20 unmodified lines
1450 if (q->vm && q->hwe->hw_engine_group)1402 if (q->vm && q->hwe->hw_engine_group)
1451 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);1403 xe_hw_engine_group_del_exec_queue(q->hwe->hw_engine_group, q);
1452 1404
1453 if (xe_exec_queue_is_multi_queue_primary(q))1405 xe_exec_queue_kill(q);
1454 xe_exec_queue_group_kill_put(q->multi_queue.group);
1455 else
1456 xe_exec_queue_kill(q);
1457 1406
1458 trace_xe_exec_queue_close(q);1407 trace_xe_exec_queue_close(q);
1459 xe_exec_queue_put(q);1408 xe_exec_queue_put(q);
drivers/gpu/drm/xe/xe_exec_queue.h+0−2
@@ -113,8 +113,6 @@ static inline struct xe_exec_queue *xe_exec_queue_multi_queue_primary(struct xe_ · 112 unmodified lines
113 return xe_exec_queue_is_multi_queue(q) ? q->multi_queue.group->primary : q;113 return xe_exec_queue_is_multi_queue(q) ? q->multi_queue.group->primary : q;
114}114}
115 115
116void xe_exec_queue_group_kill_put(struct xe_exec_queue_group *group);
117
118bool xe_exec_queue_is_lr(struct xe_exec_queue *q);116bool xe_exec_queue_is_lr(struct xe_exec_queue *q);
119 117
120bool xe_exec_queue_is_idle(struct xe_exec_queue *q);118bool xe_exec_queue_is_idle(struct xe_exec_queue *q);
drivers/gpu/drm/xe/xe_exec_queue_types.h+0−4
@@ -62,8 +62,6 @@ struct xe_exec_queue_group { · 61 unmodified lines
62 struct list_head list;62 struct list_head list;
63 /** @list_lock: Secondary queue list lock */63 /** @list_lock: Secondary queue list lock */
64 struct mutex list_lock;64 struct mutex list_lock;
65 /** @kill_refcount: ref count to kill primary queue */
66 struct kref kill_refcount;
67 /** @sync_pending: CGP_SYNC_DONE g2h response pending */65 /** @sync_pending: CGP_SYNC_DONE g2h response pending */
68 bool sync_pending;66 bool sync_pending;
69 /** @banned: Group banned */67 /** @banned: Group banned */
@@ -163,8 +161,6 @@ struct xe_exec_queue { · 93 unmodified lines
163 u8 valid:1;161 u8 valid:1;
164 /** @multi_queue.is_primary: Is primary queue (Q0) of the group */162 /** @multi_queue.is_primary: Is primary queue (Q0) of the group */
165 u8 is_primary:1;163 u8 is_primary:1;
166 /** @multi_queue.keep_active: Keep the group active after primary is destroyed */
167 u8 keep_active:1;
168 } multi_queue;164 } multi_queue;
169 165
170 /** @sched_props: scheduling properties */166 /** @sched_props: scheduling properties */
include/uapi/drm/xe_drm.h+0−4
@@ -1280,9 +1280,6 @@ struct drm_xe_vm_bind { · 1279 unmodified lines
1280 * then a new multi-queue group is created with this queue as the primary queue1280 * then a new multi-queue group is created with this queue as the primary queue
1281 * (Q0). Otherwise, the queue gets added to the multi-queue group whose primary1281 * (Q0). Otherwise, the queue gets added to the multi-queue group whose primary
1282 * queue's exec_queue_id is specified in the lower 32 bits of the 'value' field.1282 * queue's exec_queue_id is specified in the lower 32 bits of the 'value' field.
1283 * If the extension's 'value' field has %DRM_XE_MULTI_GROUP_KEEP_ACTIVE flag
1284 * set, then the multi-queue group is kept active after the primary queue is
1285 * destroyed.
1286 * All the other non-relevant bits of extension's 'value' field while adding the1283 * All the other non-relevant bits of extension's 'value' field while adding the
1287 * primary or the secondary queues of the group must be set to 0.1284 * primary or the secondary queues of the group must be set to 0.
1288 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY - Set the queue1285 * - %DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY - Set the queue
@@ -1331,7 +1328,6 @@ struct drm_xe_exec_queue_create { · 42 unmodified lines
1331#define DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE 31328#define DRM_XE_EXEC_QUEUE_SET_HANG_REPLAY_STATE 3
1332#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_GROUP 41329#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_GROUP 4
1333#define DRM_XE_MULTI_GROUP_CREATE (1ull << 63)1330#define DRM_XE_MULTI_GROUP_CREATE (1ull << 63)
1334#define DRM_XE_MULTI_GROUP_KEEP_ACTIVE (1ull << 62)
1335#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY 51331#define DRM_XE_EXEC_QUEUE_SET_PROPERTY_MULTI_QUEUE_PRIORITY 5
1336 /** @extensions: Pointer to the first extension struct, if any */1332 /** @extensions: Pointer to the first extension struct, if any */
1337 __u64 extensions;1333 __u64 extensions;