| @@ -467,26 +467,6 @@ struct xe_exec_queue *xe_exec_queue_create_bind(struct xe_device *xe, · 466 unmodified lines |
| 467 | 467 | } |
| 468 | 468 | ALLOW_ERROR_INJECTION(xe_exec_queue_create_bind, ERRNO); |
| 469 | 469 | |
| 470 | | −static 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 | | − |
| 477 | | −static inline void xe_exec_queue_group_kill_get(struct xe_exec_queue_group *group) |
| 478 | | −{ |
| 479 | | − kref_get(&group->kill_refcount); |
| 480 | | −} |
| 481 | | − |
| 482 | | −void 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 | | − |
| 490 | 470 | void xe_exec_queue_destroy(struct kref *ref) |
| 491 | 471 | { |
| 492 | 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 | 696 | group->primary = q; |
| 717 | 697 | group->cgp_bo = bo; |
| 718 | 698 | INIT_LIST_HEAD(&group->list); |
| 719 | | − kref_init(&group->kill_refcount); |
| 720 | 699 | xa_init_flags(&group->xa, XA_FLAGS_ALLOC1); |
| 721 | 700 | mutex_init(&group->list_lock); |
| 722 | 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 | 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 | 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 | 784 | lrc = xa_erase(&group->xa, q->multi_queue.pos); |
| 811 | 785 | xe_assert(xe, lrc); |
| 812 | 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 | |
| 820 | 789 | static 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 | 805 | return -EINVAL; |
| 837 | 806 | |
| 838 | 807 | if (value & DRM_XE_MULTI_GROUP_CREATE) { |
| 839 | | − 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))) |
| 808 | + if (XE_IOCTL_DBG(xe, value & ~DRM_XE_MULTI_GROUP_CREATE)) |
| 849 | 809 | return -EINVAL; |
| 850 | 810 | |
| 851 | 811 | q->multi_queue.valid = true; |
| 852 | 812 | q->multi_queue.is_primary = true; |
| 853 | 813 | q->multi_queue.pos = 0; |
| 854 | | − if (value & DRM_XE_MULTI_GROUP_KEEP_ACTIVE) |
| 855 | | − q->multi_queue.keep_active = true; |
| 856 | | − |
| 857 | 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 | 1377 | q->ops->kill(q); |
| 1421 | 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 | |
| 1429 | 1381 | int 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 | 1402 | if (q->vm && q->hwe->hw_engine_group) |
| 1451 | 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)) |
| 1454 | | − xe_exec_queue_group_kill_put(q->multi_queue.group); |
| 1455 | | − else |
| 1456 | | − xe_exec_queue_kill(q); |
| 1405 | + xe_exec_queue_kill(q); |
| 1457 | 1406 | |
| 1458 | 1407 | trace_xe_exec_queue_close(q); |
| 1459 | 1408 | xe_exec_queue_put(q); |