diff options
Diffstat (limited to 'drivers/media/video/vivi.c')
| -rw-r--r-- | drivers/media/video/vivi.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index a848bd2af97f..7d754fbcccbf 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
| @@ -650,9 +650,9 @@ static void vivi_stop_generating(struct vivi_dev *dev) | |||
| 650 | /* ------------------------------------------------------------------ | 650 | /* ------------------------------------------------------------------ |
| 651 | Videobuf operations | 651 | Videobuf operations |
| 652 | ------------------------------------------------------------------*/ | 652 | ------------------------------------------------------------------*/ |
| 653 | static int queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, | 653 | static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt, |
| 654 | unsigned int *nplanes, unsigned long sizes[], | 654 | unsigned int *nbuffers, unsigned int *nplanes, |
| 655 | void *alloc_ctxs[]) | 655 | unsigned int sizes[], void *alloc_ctxs[]) |
| 656 | { | 656 | { |
| 657 | struct vivi_dev *dev = vb2_get_drv_priv(vq); | 657 | struct vivi_dev *dev = vb2_get_drv_priv(vq); |
| 658 | unsigned long size; | 658 | unsigned long size; |
| @@ -766,7 +766,7 @@ static void buffer_queue(struct vb2_buffer *vb) | |||
| 766 | spin_unlock_irqrestore(&dev->slock, flags); | 766 | spin_unlock_irqrestore(&dev->slock, flags); |
| 767 | } | 767 | } |
| 768 | 768 | ||
| 769 | static int start_streaming(struct vb2_queue *vq) | 769 | static int start_streaming(struct vb2_queue *vq, unsigned int count) |
| 770 | { | 770 | { |
| 771 | struct vivi_dev *dev = vb2_get_drv_priv(vq); | 771 | struct vivi_dev *dev = vb2_get_drv_priv(vq); |
| 772 | dprintk(dev, 1, "%s\n", __func__); | 772 | dprintk(dev, 1, "%s\n", __func__); |
| @@ -852,6 +852,11 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, | |||
| 852 | (f->fmt.pix.width * dev->fmt->depth) >> 3; | 852 | (f->fmt.pix.width * dev->fmt->depth) >> 3; |
| 853 | f->fmt.pix.sizeimage = | 853 | f->fmt.pix.sizeimage = |
| 854 | f->fmt.pix.height * f->fmt.pix.bytesperline; | 854 | f->fmt.pix.height * f->fmt.pix.bytesperline; |
| 855 | if (dev->fmt->fourcc == V4L2_PIX_FMT_YUYV || | ||
| 856 | dev->fmt->fourcc == V4L2_PIX_FMT_UYVY) | ||
| 857 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; | ||
| 858 | else | ||
| 859 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; | ||
| 855 | return 0; | 860 | return 0; |
| 856 | } | 861 | } |
| 857 | 862 | ||
| @@ -885,6 +890,11 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
| 885 | (f->fmt.pix.width * fmt->depth) >> 3; | 890 | (f->fmt.pix.width * fmt->depth) >> 3; |
| 886 | f->fmt.pix.sizeimage = | 891 | f->fmt.pix.sizeimage = |
| 887 | f->fmt.pix.height * f->fmt.pix.bytesperline; | 892 | f->fmt.pix.height * f->fmt.pix.bytesperline; |
| 893 | if (fmt->fourcc == V4L2_PIX_FMT_YUYV || | ||
| 894 | fmt->fourcc == V4L2_PIX_FMT_UYVY) | ||
| 895 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; | ||
| 896 | else | ||
| 897 | f->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; | ||
| 888 | return 0; | 898 | return 0; |
| 889 | } | 899 | } |
| 890 | 900 | ||
| @@ -948,6 +958,14 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) | |||
| 948 | return vb2_streamoff(&dev->vb_vidq, i); | 958 | return vb2_streamoff(&dev->vb_vidq, i); |
| 949 | } | 959 | } |
| 950 | 960 | ||
| 961 | static int vidioc_log_status(struct file *file, void *priv) | ||
| 962 | { | ||
| 963 | struct vivi_dev *dev = video_drvdata(file); | ||
| 964 | |||
| 965 | v4l2_ctrl_handler_log_status(&dev->ctrl_handler, dev->v4l2_dev.name); | ||
| 966 | return 0; | ||
| 967 | } | ||
| 968 | |||
| 951 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i) | 969 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i) |
| 952 | { | 970 | { |
| 953 | return 0; | 971 | return 0; |
| @@ -1191,6 +1209,7 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = { | |||
| 1191 | .vidioc_s_input = vidioc_s_input, | 1209 | .vidioc_s_input = vidioc_s_input, |
| 1192 | .vidioc_streamon = vidioc_streamon, | 1210 | .vidioc_streamon = vidioc_streamon, |
| 1193 | .vidioc_streamoff = vidioc_streamoff, | 1211 | .vidioc_streamoff = vidioc_streamoff, |
| 1212 | .vidioc_log_status = vidioc_log_status, | ||
| 1194 | .vidioc_subscribe_event = vidioc_subscribe_event, | 1213 | .vidioc_subscribe_event = vidioc_subscribe_event, |
| 1195 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, | 1214 | .vidioc_unsubscribe_event = v4l2_event_unsubscribe, |
| 1196 | }; | 1215 | }; |
