aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-02-26 22:08:55 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-26 22:08:55 -0500
commit0bbb9c175211c2e114216978c9630d894c7760b3 (patch)
treeea70bb829debac1d37d84704f64dc66822a30f9d /drivers/media/video/v4l2-common.c
parent3ed33c31a7253f2b29a3813b66bf87985d3396ac (diff)
V4L/DVB (3373): Debug messages for ioctl improved
Adds field and type name to debug message. Also prints now format for type=capture. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 4908dab2df18..9e41ab7d5677 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -323,6 +323,16 @@ static const char *v4l2_int_ioctls[] = {
323}; 323};
324#define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls) 324#define V4L2_INT_IOCTLS ARRAY_SIZE(v4l2_int_ioctls)
325 325
326static void v4l_print_pix_fmt (char *s, struct v4l2_pix_format *fmt)
327{
328 printk ("%s: width=%d, height=%d, format=%d, field=%s, "
329 "bytesperline=%d sizeimage=%d, colorspace=%d\n", s,
330 fmt->width,fmt->height,fmt->pixelformat,
331 ((fmt->field>=0)&&(fmt->field<ARRAY_SIZE(v4l2_field_names)))?
332 v4l2_field_names[fmt->field]:"unknown",
333 fmt->bytesperline,fmt->sizeimage,fmt->colorspace);
334};
335
326/* Common ioctl debug function. This function can be used by 336/* Common ioctl debug function. This function can be used by
327 external ioctl messages as well as internal V4L ioctl */ 337 external ioctl messages as well as internal V4L ioctl */
328void v4l_printk_ioctl(unsigned int cmd) 338void v4l_printk_ioctl(unsigned int cmd)
@@ -449,15 +459,18 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
449 { 459 {
450 struct v4l2_buffer *p=arg; 460 struct v4l2_buffer *p=arg;
451 struct v4l2_timecode *tc=&p->timecode; 461 struct v4l2_timecode *tc=&p->timecode;
452 printk ("%s: %02ld:%02d:%02d.%08ld index=%d, type=%d, " 462 printk ("%s: %02ld:%02d:%02d.%08ld index=%d, type=%s, "
453 "bytesused=%d, flags=0x%08d, " 463 "bytesused=%d, flags=0x%08d, "
454 "field=%0d, sequence=%d, memory=%d, offset/userptr=0x%08lx,", 464 "field=%0d, sequence=%d, memory=%d, offset/userptr=0x%08lx\n",
455 s, 465 s,
456 (p->timestamp.tv_sec/3600), 466 (p->timestamp.tv_sec/3600),
457 (int)(p->timestamp.tv_sec/60)%60, 467 (int)(p->timestamp.tv_sec/60)%60,
458 (int)(p->timestamp.tv_sec%60), 468 (int)(p->timestamp.tv_sec%60),
459 p->timestamp.tv_usec, 469 p->timestamp.tv_usec,
460 p->index,p->type,p->bytesused,p->flags, 470 p->index,
471 ((p->type>=0)&&(p->type<ARRAY_SIZE(v4l2_type_names)))?
472 v4l2_type_names[p->type]:"unknown",
473 p->bytesused,p->flags,
461 p->field,p->sequence,p->memory,p->m.userptr); 474 p->field,p->sequence,p->memory,p->m.userptr);
462 printk ("%s: timecode= %02d:%02d:%02d type=%d, " 475 printk ("%s: timecode= %02d:%02d:%02d type=%d, "
463 "flags=0x%08d, frames=%d, userbits=0x%08x", 476 "flags=0x%08d, frames=%d, userbits=0x%08x",
@@ -522,17 +535,24 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
522 case VIDIOC_TRY_FMT: 535 case VIDIOC_TRY_FMT:
523 { 536 {
524 struct v4l2_format *p=arg; 537 struct v4l2_format *p=arg;
525 /* FIXME: Should be one dump per type*/ 538 printk ("%s: type=%s\n", s,
526 printk ("%s: type=%d\n", s,p->type); 539 ((p->type>=0)&&(p->type<ARRAY_SIZE(v4l2_type_names)))?
527 break; 540 v4l2_type_names[p->type]:"unknown");
541 switch (p->type) {
542 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
543 v4l_print_pix_fmt (s, &p->fmt.pix);
544 break;
545 default:
546 break;
547 }
528 } 548 }
529 case VIDIOC_G_FBUF: 549 case VIDIOC_G_FBUF:
530 case VIDIOC_S_FBUF: 550 case VIDIOC_S_FBUF:
531 { 551 {
532 struct v4l2_framebuffer *p=arg; 552 struct v4l2_framebuffer *p=arg;
533 /*FIXME: should show also struct v4l2_pix_format p->fmt field */
534 printk ("%s: capability=%d, flags=%d, base=0x%08lx\n", s, 553 printk ("%s: capability=%d, flags=%d, base=0x%08lx\n", s,
535 p->capability,p->flags, (unsigned long)p->base); 554 p->capability,p->flags, (unsigned long)p->base);
555 v4l_print_pix_fmt (s, &p->fmt);
536 break; 556 break;
537 } 557 }
538 case VIDIOC_G_FREQUENCY: 558 case VIDIOC_G_FREQUENCY: