diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-10-04 17:38:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-11-20 13:57:21 -0500 |
commit | 5200ab6a32d6055428896a49ec9e3b1652c1a100 (patch) | |
tree | a8f3b7f3b74ced922396877e58f4d1d24e43bd24 /drivers/media/pci | |
parent | ed3e2749ff4a94e35de653f9bbce407eb25ae363 (diff) |
media: vidioc_cropcap -> vidioc_g_pixelaspect
Now vidioc_cropcap is only used to return the pixelaspect, so
rename it accordingly.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 12 | ||||
-rw-r--r-- | drivers/media/pci/cobalt/cobalt-v4l2.c | 10 | ||||
-rw-r--r-- | drivers/media/pci/cx18/cx18-ioctl.c | 13 | ||||
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-video.c | 12 | ||||
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 17 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-video.c | 21 |
6 files changed, 43 insertions, 42 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index d4906c04dc6e..d09785fd37a8 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -2792,19 +2792,17 @@ static int bttv_g_tuner(struct file *file, void *priv, return 0; } -static int bttv_cropcap(struct file *file, void *priv, - struct v4l2_cropcap *cap) +static int bttv_g_pixelaspect(struct file *file, void *priv, + int type, struct v4l2_fract *f) { struct bttv_fh *fh = priv; struct bttv *btv = fh->btv; - if (cap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && - cap->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; /* defrect and bounds are set via g_selection */ - cap->pixelaspect = bttv_tvnorms[btv->tvnorm].cropcap.pixelaspect; - + *f = bttv_tvnorms[btv->tvnorm].cropcap.pixelaspect; return 0; } @@ -3162,7 +3160,7 @@ static const struct v4l2_ioctl_ops bttv_ioctl_ops = { .vidioc_g_fmt_vbi_cap = bttv_g_fmt_vbi_cap, .vidioc_try_fmt_vbi_cap = bttv_try_fmt_vbi_cap, .vidioc_s_fmt_vbi_cap = bttv_s_fmt_vbi_cap, - .vidioc_cropcap = bttv_cropcap, + .vidioc_g_pixelaspect = bttv_g_pixelaspect, .vidioc_reqbufs = bttv_reqbufs, .vidioc_querybuf = bttv_querybuf, .vidioc_qbuf = bttv_qbuf, diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 4a0205aae4b4..c088de551081 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -1077,20 +1077,22 @@ static int cobalt_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a) return 0; } -static int cobalt_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cc) +static int cobalt_g_pixelaspect(struct file *file, void *fh, + int type, struct v4l2_fract *f) { struct cobalt_stream *s = video_drvdata(file); struct v4l2_dv_timings timings; int err = 0; - if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; + if (s->input == 1) timings = cea1080p60; else err = v4l2_subdev_call(s->sd, video, g_dv_timings, &timings); if (!err) - cc->pixelaspect = v4l2_dv_timings_aspect_ratio(&timings); + *f = v4l2_dv_timings_aspect_ratio(&timings); return err; } @@ -1132,7 +1134,7 @@ static const struct v4l2_ioctl_ops cobalt_ioctl_ops = { .vidioc_log_status = cobalt_log_status, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, - .vidioc_cropcap = cobalt_cropcap, + .vidioc_g_pixelaspect = cobalt_g_pixelaspect, .vidioc_g_selection = cobalt_g_selection, .vidioc_enum_input = cobalt_enum_input, .vidioc_g_input = cobalt_g_input, diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c index 854116375a7c..8c54b17f382a 100644 --- a/drivers/media/pci/cx18/cx18-ioctl.c +++ b/drivers/media/pci/cx18/cx18-ioctl.c @@ -441,15 +441,16 @@ static int cx18_enum_input(struct file *file, void *fh, struct v4l2_input *vin) return cx18_get_input(cx, vin->index, vin); } -static int cx18_cropcap(struct file *file, void *fh, - struct v4l2_cropcap *cropcap) +static int cx18_g_pixelaspect(struct file *file, void *fh, + int type, struct v4l2_fract *f) { struct cx18 *cx = fh2id(fh)->cx; - if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - cropcap->pixelaspect.numerator = cx->is_50hz ? 54 : 11; - cropcap->pixelaspect.denominator = cx->is_50hz ? 59 : 10; + + f->numerator = cx->is_50hz ? 54 : 11; + f->denominator = cx->is_50hz ? 59 : 10; return 0; } @@ -1079,7 +1080,7 @@ static const struct v4l2_ioctl_ops cx18_ioctl_ops = { .vidioc_g_audio = cx18_g_audio, .vidioc_enumaudio = cx18_enumaudio, .vidioc_enum_input = cx18_enum_input, - .vidioc_cropcap = cx18_cropcap, + .vidioc_g_pixelaspect = cx18_g_pixelaspect, .vidioc_g_selection = cx18_g_selection, .vidioc_g_input = cx18_g_input, .vidioc_s_input = cx18_s_input, diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index a9844c4020ff..168178c1e574 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -668,17 +668,17 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, return 0; } -static int vidioc_cropcap(struct file *file, void *priv, - struct v4l2_cropcap *cc) +static int vidioc_g_pixelaspect(struct file *file, void *priv, + int type, struct v4l2_fract *f) { struct cx23885_dev *dev = video_drvdata(file); bool is_50hz = dev->tvnorm & V4L2_STD_625_50; - if (cc->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; - cc->pixelaspect.numerator = is_50hz ? 54 : 11; - cc->pixelaspect.denominator = is_50hz ? 59 : 10; + f->numerator = is_50hz ? 54 : 11; + f->denominator = is_50hz ? 59 : 10; return 0; } @@ -1139,7 +1139,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_dqbuf = vb2_ioctl_dqbuf, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, - .vidioc_cropcap = vidioc_cropcap, + .vidioc_g_pixelaspect = vidioc_g_pixelaspect, .vidioc_g_selection = vidioc_g_selection, .vidioc_s_std = vidioc_s_std, .vidioc_g_std = vidioc_g_std, diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index a66f8b872520..6c269ecd8d05 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -829,17 +829,18 @@ static int ivtv_enum_output(struct file *file, void *fh, struct v4l2_output *vou return ivtv_get_output(itv, vout->index, vout); } -static int ivtv_cropcap(struct file *file, void *fh, struct v4l2_cropcap *cropcap) +static int ivtv_g_pixelaspect(struct file *file, void *fh, + int type, struct v4l2_fract *f) { struct ivtv_open_id *id = fh2id(fh); struct ivtv *itv = id->itv; - if (cropcap->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { - cropcap->pixelaspect.numerator = itv->is_50hz ? 54 : 11; - cropcap->pixelaspect.denominator = itv->is_50hz ? 59 : 10; - } else if (cropcap->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { - cropcap->pixelaspect.numerator = itv->is_out_50hz ? 54 : 11; - cropcap->pixelaspect.denominator = itv->is_out_50hz ? 59 : 10; + if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { + f->numerator = itv->is_50hz ? 54 : 11; + f->denominator = itv->is_50hz ? 59 : 10; + } else if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { + f->numerator = itv->is_out_50hz ? 54 : 11; + f->denominator = itv->is_out_50hz ? 59 : 10; } else { return -EINVAL; } @@ -1923,7 +1924,7 @@ static const struct v4l2_ioctl_ops ivtv_ioctl_ops = { .vidioc_enum_input = ivtv_enum_input, .vidioc_enum_output = ivtv_enum_output, .vidioc_enumaudout = ivtv_enumaudout, - .vidioc_cropcap = ivtv_cropcap, + .vidioc_g_pixelaspect = ivtv_g_pixelaspect, .vidioc_s_selection = ivtv_s_selection, .vidioc_g_selection = ivtv_g_selection, .vidioc_g_input = ivtv_g_input, diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index 8f28741ebb35..5bc4b8fc8ebf 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c @@ -1650,23 +1650,22 @@ int saa7134_querystd(struct file *file, void *priv, v4l2_std_id *std) } EXPORT_SYMBOL_GPL(saa7134_querystd); -static int saa7134_cropcap(struct file *file, void *priv, - struct v4l2_cropcap *cap) +static int saa7134_g_pixelaspect(struct file *file, void *priv, + int type, struct v4l2_fract *f) { struct saa7134_dev *dev = video_drvdata(file); - if (cap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && - cap->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + type != V4L2_BUF_TYPE_VIDEO_OVERLAY) return -EINVAL; - cap->pixelaspect.numerator = 1; - cap->pixelaspect.denominator = 1; + if (dev->tvnorm->id & V4L2_STD_525_60) { - cap->pixelaspect.numerator = 11; - cap->pixelaspect.denominator = 10; + f->numerator = 11; + f->denominator = 10; } if (dev->tvnorm->id & V4L2_STD_625_50) { - cap->pixelaspect.numerator = 54; - cap->pixelaspect.denominator = 59; + f->numerator = 54; + f->denominator = 59; } return 0; } @@ -1987,7 +1986,7 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = { .vidioc_g_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap, .vidioc_try_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap, .vidioc_s_fmt_vbi_cap = saa7134_try_get_set_fmt_vbi_cap, - .vidioc_cropcap = saa7134_cropcap, + .vidioc_g_pixelaspect = saa7134_g_pixelaspect, .vidioc_reqbufs = vb2_ioctl_reqbufs, .vidioc_querybuf = vb2_ioctl_querybuf, .vidioc_qbuf = vb2_ioctl_qbuf, |