diff options
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index f2afc4e08379..30cc3347ae52 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -42,6 +42,12 @@ | |||
42 | printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ | 42 | printk(KERN_DEBUG "%s: " fmt, vfd->name, ## arg);\ |
43 | } while (0) | 43 | } while (0) |
44 | 44 | ||
45 | #define dbgarg3(fmt, arg...) \ | ||
46 | do { \ | ||
47 | if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) \ | ||
48 | printk(KERN_CONT "%s: " fmt, vfd->name, ## arg);\ | ||
49 | } while (0) | ||
50 | |||
45 | /* Zero out the end of the struct pointed to by p. Everthing after, but | 51 | /* Zero out the end of the struct pointed to by p. Everthing after, but |
46 | * not including, the specified field is cleared. */ | 52 | * not including, the specified field is cleared. */ |
47 | #define CLEAR_AFTER_FIELD(p, field) \ | 53 | #define CLEAR_AFTER_FIELD(p, field) \ |
@@ -507,11 +513,12 @@ static inline void v4l_print_ext_ctrls(unsigned int cmd, | |||
507 | dbgarg(cmd, ""); | 513 | dbgarg(cmd, ""); |
508 | printk(KERN_CONT "class=0x%x", c->ctrl_class); | 514 | printk(KERN_CONT "class=0x%x", c->ctrl_class); |
509 | for (i = 0; i < c->count; i++) { | 515 | for (i = 0; i < c->count; i++) { |
510 | if (show_vals) | 516 | if (show_vals && !c->controls[i].size) |
511 | printk(KERN_CONT " id/val=0x%x/0x%x", | 517 | printk(KERN_CONT " id/val=0x%x/0x%x", |
512 | c->controls[i].id, c->controls[i].value); | 518 | c->controls[i].id, c->controls[i].value); |
513 | else | 519 | else |
514 | printk(KERN_CONT " id=0x%x", c->controls[i].id); | 520 | printk(KERN_CONT " id=0x%x,size=%u", |
521 | c->controls[i].id, c->controls[i].size); | ||
515 | } | 522 | } |
516 | printk(KERN_CONT "\n"); | 523 | printk(KERN_CONT "\n"); |
517 | }; | 524 | }; |
@@ -522,10 +529,9 @@ static inline int check_ext_ctrls(struct v4l2_ext_controls *c, int allow_priv) | |||
522 | 529 | ||
523 | /* zero the reserved fields */ | 530 | /* zero the reserved fields */ |
524 | c->reserved[0] = c->reserved[1] = 0; | 531 | c->reserved[0] = c->reserved[1] = 0; |
525 | for (i = 0; i < c->count; i++) { | 532 | for (i = 0; i < c->count; i++) |
526 | c->controls[i].reserved2[0] = 0; | 533 | c->controls[i].reserved2[0] = 0; |
527 | c->controls[i].reserved2[1] = 0; | 534 | |
528 | } | ||
529 | /* V4L2_CID_PRIVATE_BASE cannot be used as control class | 535 | /* V4L2_CID_PRIVATE_BASE cannot be used as control class |
530 | when using extended controls. | 536 | when using extended controls. |
531 | Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL | 537 | Only when passed in through VIDIOC_G_CTRL and VIDIOC_S_CTRL |
@@ -1726,24 +1732,29 @@ static long __video_do_ioctl(struct file *file, | |||
1726 | 1732 | ||
1727 | ret = ops->vidioc_enum_framesizes(file, fh, p); | 1733 | ret = ops->vidioc_enum_framesizes(file, fh, p); |
1728 | dbgarg(cmd, | 1734 | dbgarg(cmd, |
1729 | "index=%d, pixelformat=%d, type=%d ", | 1735 | "index=%d, pixelformat=%c%c%c%c, type=%d ", |
1730 | p->index, p->pixel_format, p->type); | 1736 | p->index, |
1737 | (p->pixel_format & 0xff), | ||
1738 | (p->pixel_format >> 8) & 0xff, | ||
1739 | (p->pixel_format >> 16) & 0xff, | ||
1740 | (p->pixel_format >> 24) & 0xff, | ||
1741 | p->type); | ||
1731 | switch (p->type) { | 1742 | switch (p->type) { |
1732 | case V4L2_FRMSIZE_TYPE_DISCRETE: | 1743 | case V4L2_FRMSIZE_TYPE_DISCRETE: |
1733 | dbgarg2("width = %d, height=%d\n", | 1744 | dbgarg3("width = %d, height=%d\n", |
1734 | p->discrete.width, p->discrete.height); | 1745 | p->discrete.width, p->discrete.height); |
1735 | break; | 1746 | break; |
1736 | case V4L2_FRMSIZE_TYPE_STEPWISE: | 1747 | case V4L2_FRMSIZE_TYPE_STEPWISE: |
1737 | dbgarg2("min %dx%d, max %dx%d, step %dx%d\n", | 1748 | dbgarg3("min %dx%d, max %dx%d, step %dx%d\n", |
1738 | p->stepwise.min_width, p->stepwise.min_height, | 1749 | p->stepwise.min_width, p->stepwise.min_height, |
1739 | p->stepwise.step_width, p->stepwise.step_height, | 1750 | p->stepwise.step_width, p->stepwise.step_height, |
1740 | p->stepwise.max_width, p->stepwise.max_height); | 1751 | p->stepwise.max_width, p->stepwise.max_height); |
1741 | break; | 1752 | break; |
1742 | case V4L2_FRMSIZE_TYPE_CONTINUOUS: | 1753 | case V4L2_FRMSIZE_TYPE_CONTINUOUS: |
1743 | dbgarg2("continuous\n"); | 1754 | dbgarg3("continuous\n"); |
1744 | break; | 1755 | break; |
1745 | default: | 1756 | default: |
1746 | dbgarg2("- Unknown type!\n"); | 1757 | dbgarg3("- Unknown type!\n"); |
1747 | } | 1758 | } |
1748 | 1759 | ||
1749 | break; | 1760 | break; |