mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] [media] vb2: include lengths in dmabuf qbuf debug message
@ 2016-07-20 16:07 Javier Martinez Canillas
  2016-07-20 19:52 ` Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-07-20 16:07 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sakari Ailus, Marek Szyprowski, Mauro Carvalho Chehab,
	Kyungmin Park, Pawel Osciak, linux-media,
	Javier Martinez Canillas

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 <javier@osg.samsung.com>

---

Changes in v2:
- Use %u instead of %d (Sakari Ailus)
- Include min_length (Sakari Ailus)

 drivers/media/v4l2-core/videobuf2-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index b6fbc04f9699..bbba50d6e1ad 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1227,8 +1227,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;
-- 
2.5.5

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-20 23:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-20 16:07 [PATCH v2] [media] vb2: include lengths in dmabuf qbuf debug message Javier Martinez Canillas
2016-07-20 19:52 ` Sakari Ailus
2016-07-20 22:56   ` Javier Martinez Canillas
2016-07-20 23:08     ` Sakari Ailus
2016-07-20 23:23       ` Javier Martinez Canillas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®