This reverts commit 1a058c3376765ee31d65e28cbbb9d4ff15120056. This interface is still in too much flux. Revert until it's sorted out.
Unified · Split
| @@ -1567,32 +1567,6 @@ copy_from_user_failed: · 1566 unmodified lines | |||
| 1567 | return err; | 1567 | return err; |
| 1568 | } | 1568 | } |
| 1569 | 1569 | ||
| 1570 | static int kfd_ioctl_alloc_queue_gws(struct file *filep, | ||
| 1571 | struct kfd_process *p, void *data) | ||
| 1572 | { | ||
| 1573 | int retval; | ||
| 1574 | struct kfd_ioctl_alloc_queue_gws_args *args = data; | ||
| 1575 | struct kfd_dev *dev; | ||
| 1576 | |||
| 1577 | if (!hws_gws_support) | ||
| 1578 | return -ENODEV; | ||
| 1579 | |||
| 1580 | dev = kfd_device_by_id(args->gpu_id); | ||
| 1581 | if (!dev) { | ||
| 1582 | pr_debug("Could not find gpu id 0x%x\n", args->gpu_id); | ||
| 1583 | return -ENODEV; | ||
| 1584 | } | ||
| 1585 | if (dev->dqm->sched_policy == KFD_SCHED_POLICY_NO_HWS) | ||
| 1586 | return -ENODEV; | ||
| 1587 | |||
| 1588 | mutex_lock(&p->mutex); | ||
| 1589 | retval = pqm_set_gws(&p->pqm, args->queue_id, args->num_gws ? dev->gws : NULL); | ||
| 1590 | mutex_unlock(&p->mutex); | ||
| 1591 | |||
| 1592 | args->first_gws = 0; | ||
| 1593 | return retval; | ||
| 1594 | } | ||
| 1595 | |||
| 1596 | static int kfd_ioctl_get_dmabuf_info(struct file *filep, | 1570 | static int kfd_ioctl_get_dmabuf_info(struct file *filep, |
| 1597 | struct kfd_process *p, void *data) | 1571 | struct kfd_process *p, void *data) |
| 1598 | { | 1572 | { |
| @@ -1795,8 +1769,6 @@ static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = { · 196 unmodified lines | |||
| 1795 | AMDKFD_IOCTL_DEF(AMDKFD_IOC_IMPORT_DMABUF, | 1769 | AMDKFD_IOCTL_DEF(AMDKFD_IOC_IMPORT_DMABUF, |
| 1796 | kfd_ioctl_import_dmabuf, 0), | 1770 | kfd_ioctl_import_dmabuf, 0), |
| 1797 | 1771 | ||
| 1798 | AMDKFD_IOCTL_DEF(AMDKFD_IOC_ALLOC_QUEUE_GWS, | ||
| 1799 | kfd_ioctl_alloc_queue_gws, 0), | ||
| 1800 | }; | 1772 | }; |
| 1801 | 1773 | ||
| 1802 | #define AMDKFD_CORE_IOCTL_COUNT ARRAY_SIZE(amdkfd_ioctls) | 1774 | #define AMDKFD_CORE_IOCTL_COUNT ARRAY_SIZE(amdkfd_ioctls) |
| @@ -410,21 +410,6 @@ struct kfd_ioctl_unmap_memory_from_gpu_args { · 409 unmodified lines | |||
| 410 | __u32 n_success; /* to/from KFD */ | 410 | __u32 n_success; /* to/from KFD */ |
| 411 | }; | 411 | }; |
| 412 | 412 | ||
| 413 | /* Allocate GWS for specific queue | ||
| 414 | * | ||
| 415 | * @gpu_id: device identifier | ||
| 416 | * @queue_id: queue's id that GWS is allocated for | ||
| 417 | * @num_gws: how many GWS to allocate | ||
| 418 | * @first_gws: index of the first GWS allocated. | ||
| 419 | * only support contiguous GWS allocation | ||
| 420 | */ | ||
| 421 | struct kfd_ioctl_alloc_queue_gws_args { | ||
| 422 | __u32 gpu_id; /* to KFD */ | ||
| 423 | __u32 queue_id; /* to KFD */ | ||
| 424 | __u32 num_gws; /* to KFD */ | ||
| 425 | __u32 first_gws; /* from KFD */ | ||
| 426 | }; | ||
| 427 | |||
| 428 | struct kfd_ioctl_get_dmabuf_info_args { | 413 | struct kfd_ioctl_get_dmabuf_info_args { |
| 429 | __u64 size; /* from KFD */ | 414 | __u64 size; /* from KFD */ |
| 430 | __u64 metadata_ptr; /* to KFD */ | 415 | __u64 metadata_ptr; /* to KFD */ |
| @@ -544,10 +529,7 @@ enum kfd_mmio_remap { · 113 unmodified lines | |||
| 544 | #define AMDKFD_IOC_IMPORT_DMABUF \ | 529 | #define AMDKFD_IOC_IMPORT_DMABUF \ |
| 545 | AMDKFD_IOWR(0x1D, struct kfd_ioctl_import_dmabuf_args) | 530 | AMDKFD_IOWR(0x1D, struct kfd_ioctl_import_dmabuf_args) |
| 546 | 531 | ||
| 547 | #define AMDKFD_IOC_ALLOC_QUEUE_GWS \ | ||
| 548 | AMDKFD_IOWR(0x1E, struct kfd_ioctl_alloc_queue_gws_args) | ||
| 549 | |||
| 550 | #define AMDKFD_COMMAND_START 0x01 | 532 | #define AMDKFD_COMMAND_START 0x01 |
| 551 | #define AMDKFD_COMMAND_END 0x1F | 533 | #define AMDKFD_COMMAND_END 0x1E |
| 552 | 534 | ||
| 553 | #endif | 535 | #endif |