From dea6686773eff15f7688da6c13ec48905afb3871 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Mon, 15 Dec 2014 17:27:44 +0200 Subject: yavta: Set plane size for mplane buffers in qbuf The plane size was left zero for mplane buffers when queueing a buffer. Fix this. Signed-off-by: Sakari Ailus [For consistency set buf.length for USERPTR buffers only] Signed-off-by: Laurent Pinchart --- yavta.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'yavta.c') diff --git a/yavta.c b/yavta.c index 7f9e814..d0bd932 100644 --- a/yavta.c +++ b/yavta.c @@ -973,16 +973,19 @@ static int video_queue_buffer(struct device *dev, int index, enum buffer_fill_mo if (video_is_mplane(dev)) { buf.m.planes = planes; buf.length = dev->num_planes; - } else { - buf.length = dev->buffers[index].size[0]; } if (dev->memtype == V4L2_MEMORY_USERPTR) { if (video_is_mplane(dev)) { - for (i = 0; i < dev->num_planes; i++) - buf.m.planes[i].m.userptr = (unsigned long)dev->buffers[index].mem[i]; + for (i = 0; i < dev->num_planes; i++) { + buf.m.planes[i].m.userptr = (unsigned long) + dev->buffers[index].mem[i]; + buf.m.planes[i].length = + dev->buffers[index].size[i]; + } } else { buf.m.userptr = (unsigned long)dev->buffers[index].mem[0]; + buf.length = dev->buffers[index].size[0]; } } -- cgit v1.2.3