aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2010-07-08 09:10:11 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:59 -0400
commit0f0cbb2ac635158cfb0eb0abe4b0edec07428242 (patch)
tree3a94bccceb05bf354ca64702acb998f2a580e5ad
parent5615d0add1a8cd9f3ba3cd054da2c8563dea3145 (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>
-rw-r--r--arch/arm/mach-omap2/include/mach/tiler.h2
-rw-r--r--drivers/media/video/tiler/tiler-iface.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/include/mach/tiler.h b/arch/arm/mach-omap2/include/mach/tiler.h
index 7c62fe093a9..576b9344dc9 100644
--- a/arch/arm/mach-omap2/include/mach/tiler.h
+++ b/arch/arm/mach-omap2/include/mach/tiler.h
@@ -28,7 +28,7 @@
28#define TILIOC_UMBLK _IOW('z', 104, struct tiler_block_info) 28#define TILIOC_UMBLK _IOW('z', 104, struct tiler_block_info)
29#define TILIOC_QBUF _IOWR('z', 105, struct tiler_buf_info) 29#define TILIOC_QBUF _IOWR('z', 105, struct tiler_buf_info)
30#define TILIOC_RBUF _IOWR('z', 106, struct tiler_buf_info) 30#define TILIOC_RBUF _IOWR('z', 106, struct tiler_buf_info)
31#define TILIOC_URBUF _IOW('z', 107, struct tiler_buf_info) 31#define TILIOC_URBUF _IOWR('z', 107, struct tiler_buf_info)
32#define TILIOC_QBLK _IOWR('z', 108, struct tiler_block_info) 32#define TILIOC_QBLK _IOWR('z', 108, struct tiler_block_info)
33#define TILIOC_PRBLK _IOW('z', 109, struct tiler_block_info) 33#define TILIOC_PRBLK _IOW('z', 109, struct tiler_block_info)
34#define TILIOC_URBLK _IOW('z', 110, u32) 34#define TILIOC_URBLK _IOW('z', 110, u32)
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,
459 list_for_each_entry(_b, &pi->bufs, by_pid) { 459 list_for_each_entry(_b, &pi->bufs, by_pid) {
460 if (buf_info.offset == _b->buf_info.offset) { 460 if (buf_info.offset == _b->buf_info.offset) {
461 _m_unregister_buf(_b); 461 _m_unregister_buf(_b);
462 buf_info.length = _b->buf_info.length;
462 r = 0; 463 r = 0;
463 break; 464 break;
464 } 465 }
465 } 466 }
466 mutex_unlock(&mtx); 467 mutex_unlock(&mtx);
468
469 if (copy_to_user((void __user *)arg, &buf_info,
470 sizeof(_b->buf_info)))
471 return -EFAULT;
472
467 return r; 473 return r;
468 break; 474 break;
469 case TILIOC_PRBLK: 475 case TILIOC_PRBLK: