diff options
author | Oded Gabbay | 2014-12-29 13:20:05 +0100 |
---|---|---|
committer | Oded Gabbay | 2015-01-06 18:44:36 +0100 |
commit | 76baee6c733bfef30fcf86cbd121e336b839e408 (patch) | |
tree | 1ba6313aa81b5c69ed5591e0cb8598c2fd69434b /drivers/gpu/drm/amd/amdkfd/kfd_priv.h | |
parent | drm/amdkfd: reformat IOCTL definitions to drm-style (diff) | |
download | kernel-qcow2-linux-76baee6c733bfef30fcf86cbd121e336b839e408.tar.gz kernel-qcow2-linux-76baee6c733bfef30fcf86cbd121e336b839e408.tar.xz kernel-qcow2-linux-76baee6c733bfef30fcf86cbd121e336b839e408.zip |
drm/amdkfd: rewrite kfd_ioctl() according to drm_ioctl()
This patch changes kfd_ioctl() to be very similar to drm_ioctl().
The patch defines an array of amdkfd_ioctls, which maps IOCTL definition to the
ioctl function.
The kfd_ioctl() uses that mapping to call the appropriate ioctl function,
through a function pointer.
This patch also declares a new typedef for the ioctl function pointer.
v2: Renamed KFD_COMMAND_(START|END) to AMDKFD_...
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index f9fb81e3bb09..a5edb29507e3 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -463,6 +463,24 @@ struct kfd_process { bool is_32bit_user_mode; }; +/** + * Ioctl function type. + * + * \param filep pointer to file structure. + * \param p amdkfd process pointer. + * \param data pointer to arg that was copied from user. + */ +typedef int amdkfd_ioctl_t(struct file *filep, struct kfd_process *p, + void *data); + +struct amdkfd_ioctl_desc { + unsigned int cmd; + int flags; + amdkfd_ioctl_t *func; + unsigned int cmd_drv; + const char *name; +}; + void kfd_process_create_wq(void); void kfd_process_destroy_wq(void); struct kfd_process *kfd_create_process(const struct task_struct *); |