summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2011-04-07 08:41:35 +0100
committerAndy Green <andy.green@linaro.org>2011-04-07 08:41:35 +0100
commite994cdba14621ec608a7132723847fb73c8c4894 (patch)
tree51eca60cb928d0f6d4c209c4fc467c3d213c308c /drivers/media
parent0c2f31d6475056ae8ebc857c99eb20eb06c40902 (diff)
TILER: Make URBUF return the length of the buffer unregistered.
This is desired so that user-space components need not keep track of the size of the buffer for unmapping. Signed-off-by: Lajos Molnar <molnar@ti.com> Signed-off-by: David Sin <davidsin@ti.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/tiler/tiler-iface.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/tiler/tiler-iface.c b/drivers/media/video/tiler/tiler-iface.c
index 33c3c61a036..c2b6e025030 100644
--- a/drivers/media/video/tiler/tiler-iface.c
+++ b/drivers/media/video/tiler/tiler-iface.c
@@ -459,11 +459,17 @@ static s32 tiler_ioctl(struct inode *ip, struct file *filp, u32 cmd,
list_for_each_entry(_b, &pi->bufs, by_pid) {
if (buf_info.offset == _b->buf_info.offset) {
_m_unregister_buf(_b);
+ buf_info.length = _b->buf_info.length;
r = 0;
break;
}
}
mutex_unlock(&mtx);
+
+ if (copy_to_user((void __user *)arg, &buf_info,
+ sizeof(_b->buf_info)))
+ return -EFAULT;
+
return r;
break;
case TILIOC_PRBLK: