From: Hans Verkuil <hverkuil-ci...@xs4all.nl>

When debugging is on, log the new tag field of struct v4l2_buffer
as well.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
Reviewed-by: Paul Kocialkowski <paul.kocialkow...@bootlin.com>
Reviewed-by: Alexandre Courbot <acour...@chromium.org>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index e384142d2826..653497f31104 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -498,9 +498,12 @@ static void v4l_print_buffer(const void *arg, bool 
write_only)
                        p->bytesused, p->m.userptr, p->length);
        }
 
-       printk(KERN_DEBUG "timecode=%02d:%02d:%02d type=%d, flags=0x%08x, 
frames=%d, userbits=0x%08x\n",
-                       tc->hours, tc->minutes, tc->seconds,
-                       tc->type, tc->flags, tc->frames, *(__u32 
*)tc->userbits);
+       if (p->flags & V4L2_BUF_FLAG_TAG)
+               printk(KERN_DEBUG "tag=%x\n", p->tag);
+       else if (p->flags & V4L2_BUF_FLAG_TIMECODE)
+               printk(KERN_DEBUG "timecode=%02d:%02d:%02d type=%d, 
flags=0x%08x, frames=%d, userbits=0x%08x\n",
+                      tc->hours, tc->minutes, tc->seconds,
+                      tc->type, tc->flags, tc->frames, *(__u32 *)tc->userbits);
 }
 
 static void v4l_print_exportbuffer(const void *arg, bool write_only)
-- 
2.19.1

Reply via email to