diff options
author | Andrew Lewycky <Andrew.Lewycky@amd.com> | 2014-09-09 16:22:05 +0400 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2015-05-19 13:02:29 +0300 |
commit | 8377396b5db166c56a90b400317f26954901c994 (patch) | |
tree | 932ddf201238dc8ef7079dc1fad506477d8a00fc /drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | |
parent | 81663016dbfd53e29d1b5c5ddbc9b12ae1d66474 (diff) | |
download | linux-8377396b5db166c56a90b400317f26954901c994.tar.xz |
drm/amdkfd: Implement events IOCTLs
Signed-off-by: Andrew Lewycky <Andrew.Lewycky@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_chardev.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 6dd89481b42d..b2c6109bd7af 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -519,31 +519,57 @@ static int kfd_ioctl_get_process_apertures(struct file *filp, static int kfd_ioctl_create_event(struct file *filp, struct kfd_process *p, void *data) { - return -ENODEV; + struct kfd_ioctl_create_event_args *args = data; + int err; + + err = kfd_event_create(filp, p, args->event_type, + args->auto_reset != 0, args->node_id, + &args->event_id, &args->event_trigger_data, + &args->event_page_offset, + &args->event_slot_index); + + return err; } static int kfd_ioctl_destroy_event(struct file *filp, struct kfd_process *p, void *data) { - return -ENODEV; + struct kfd_ioctl_destroy_event_args *args = data; + + return kfd_event_destroy(p, args->event_id); } static int kfd_ioctl_set_event(struct file *filp, struct kfd_process *p, void *data) { - return -ENODEV; + struct kfd_ioctl_set_event_args *args = data; + + return kfd_set_event(p, args->event_id); } static int kfd_ioctl_reset_event(struct file *filp, struct kfd_process *p, void *data) { - return -ENODEV; + struct kfd_ioctl_reset_event_args *args = data; + + return kfd_reset_event(p, args->event_id); } static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p, void *data) { - return -ENODEV; + struct kfd_ioctl_wait_events_args *args = data; + enum kfd_event_wait_result wait_result; + int err; + + err = kfd_wait_on_events(p, args->num_events, + (void __user *)args->events_ptr, + (args->wait_for_all != 0), + args->timeout, &wait_result); + + args->wait_result = wait_result; + + return err; } #define AMDKFD_IOCTL_DEF(ioctl, _func, _flags) \ |