aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2011-11-02 22:26:18 +0800
committerEric Miao <eric.miao@canonical.com>2011-11-10 07:39:03 +0800
commit32be43d0091393882830c7edece7e67bc78c103c (patch)
treebda476fc470e0855979f9befc6f046f163a308c8
parent420d6df4dc07ae5bc09e27fb8b8a5e6ec551ff30 (diff)
downloadlinux-linaro-32be43d0091393882830c7edece7e67bc78c103c.tar.gz
ENGR00161215-2 vpu: Add ioctls for querying and setting bitwork memory
Add VPU_IOC_QUERY_BITWORK_MEM and VPU_IOC_SET_BITWORK_MEM ioctls implementation for registerring bitwork memory allocated from user space to vpu driver. Signed-off-by: Sammy He <r62914@freescale.com>
-rw-r--r--drivers/mxc/vpu/mxc_vpu.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/mxc/vpu/mxc_vpu.c b/drivers/mxc/vpu/mxc_vpu.c
index 8a11487fc0e..c2d40bbfa1e 100644
--- a/drivers/mxc/vpu/mxc_vpu.c
+++ b/drivers/mxc/vpu/mxc_vpu.c
@@ -480,6 +480,26 @@ static long vpu_ioctl(struct file *filp, u_int cmd,
}
break;
}
+ /*
+ * The following two ioctl is used when user allocates working buffer
+ * and register it to vpu driver.
+ */
+ case VPU_IOC_QUERY_BITWORK_MEM:
+ {
+ if (copy_to_user((void __user *)arg,
+ &bitwork_mem,
+ sizeof(struct vpu_mem_desc)))
+ ret = -EFAULT;
+ break;
+ }
+ case VPU_IOC_SET_BITWORK_MEM:
+ {
+ if (copy_from_user(&bitwork_mem,
+ (struct vpu_mem_desc *)arg,
+ sizeof(struct vpu_mem_desc)))
+ ret = -EFAULT;
+ break;
+ }
case VPU_IOC_SYS_SW_RESET:
{
if (vpu_plat->reset)