From: Javier Martinez Canillas Date: Wed, 20 Jul 2016 16:07:55 +0000 (-0300) Subject: [media] vb2: include lengths in dmabuf qbuf debug message X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=14150723659af133e4b205ccf6ff8d93c1384014;p=linux-beck.git [media] vb2: include lengths in dmabuf qbuf debug message If the VIDIOC_QBUF ioctl fails due a wrong dmabuf length, it's useful to get the invalid and minimum lengths as a debug info. Before this patch: vb2-core: __qbuf_dmabuf: invalid dmabuf length for plane 1 After this patch: vb2-core: __qbuf_dmabuf: invalid dmabuf length 221248 for plane 1, minimum length 410880 Signed-off-by: Javier Martinez Canillas Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index ca8ffeb56d72..3d595186309a 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1228,8 +1228,10 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) planes[plane].length = dbuf->size; if (planes[plane].length < vb->planes[plane].min_length) { - dprintk(1, "invalid dmabuf length for plane %d\n", - plane); + dprintk(1, "invalid dmabuf length %u for plane %d, " + "minimum length %u\n", + planes[plane].length, plane, + vb->planes[plane].min_length); dma_buf_put(dbuf); ret = -EINVAL; goto err;