summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap/omap_vout.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-11 13:22:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-11 13:22:22 -0700
commitde34f4da7f62ff59ac6e1ef320b0fcfa3296fce3 (patch)
tree88b5db2fc7fbbb0353edd8447a832a5225a49d01 /drivers/media/platform/omap/omap_vout.c
parent56e520c7a0a490b63b042b047ec9659fc08762a4 (diff)
parent9fce0c226536fc36c7fb0a80000ca38a995be43e (diff)
downloadop-kernel-dev-de34f4da7f62ff59ac6e1ef320b0fcfa3296fce3.zip
op-kernel-dev-de34f4da7f62ff59ac6e1ef320b0fcfa3296fce3.tar.gz
Merge tag 'media/v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - Documentation improvements: conversion of all non-DocBook documents to Sphinx and lots of fixes to the uAPI media book - New PCI driver for Techwell TW5864 media grabber boards - New SoC driver for ATMEL Image Sensor Controller - Removal of some obsolete SoC drivers (s5p-tv driver and soc_camera drivers) - Addition of ST CEC driver - Lots of drivers fixes, improvements and additions * tag 'media/v4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (464 commits) [media] ttusb_dec: avoid the risk of go past buffer [media] cx23885: Fix some smatch warnings [media] si2165: switch to regmap [media] si2165: use i2c_client->dev instead of i2c_adapter->dev for logging [media] si2165: Remove legacy attach [media] cx231xx: attach si2165 driver via i2c_client [media] cx231xx: Prepare for attaching new style i2c_client DVB demod drivers [media] cx23885: attach si2165 driver via i2c_client [media] si2165: support i2c_client attach [media] si2165: avoid division by zero [media] rcar-vin: add R-Car gen2 fallback compatibility string [media] lgdt3306a: remove 20*50 msec unnecessary timeout [media] cx25821: Remove deprecated create_singlethread_workqueue [media] cx25821: Drop Freeing of Workqueue [media] cxd2841er: force 8MHz bandwidth for DVB-C if specified bw not supported [media] redrat3: hardware-specific parameters [media] redrat3: remove hw_timeout member [media] cxd2841er: BER and SNR reading for ISDB-T [media] dvb-usb: avoid link error with dib3000m{b,c| [media] dvb-usb: split out common parts of dibusb ...
Diffstat (limited to 'drivers/media/platform/omap/omap_vout.c')
-rw-r--r--drivers/media/platform/omap/omap_vout.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index 6b01e12..e668dde 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -1247,36 +1247,33 @@ static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh,
return 0;
}
-static int vidioc_cropcap(struct file *file, void *fh,
- struct v4l2_cropcap *cropcap)
+static int vidioc_g_selection(struct file *file, void *fh, struct v4l2_selection *sel)
{
struct omap_vout_device *vout = fh;
struct v4l2_pix_format *pix = &vout->pix;
- if (cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+ if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
return -EINVAL;
- /* Width and height are always even */
- cropcap->bounds.width = pix->width & ~1;
- cropcap->bounds.height = pix->height & ~1;
-
- omap_vout_default_crop(&vout->pix, &vout->fbuf, &cropcap->defrect);
- cropcap->pixelaspect.numerator = 1;
- cropcap->pixelaspect.denominator = 1;
- return 0;
-}
-
-static int vidioc_g_crop(struct file *file, void *fh, struct v4l2_crop *crop)
-{
- struct omap_vout_device *vout = fh;
-
- if (crop->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+ switch (sel->target) {
+ case V4L2_SEL_TGT_CROP:
+ sel->r = vout->crop;
+ break;
+ case V4L2_SEL_TGT_CROP_DEFAULT:
+ omap_vout_default_crop(&vout->pix, &vout->fbuf, &sel->r);
+ break;
+ case V4L2_SEL_TGT_CROP_BOUNDS:
+ /* Width and height are always even */
+ sel->r.width = pix->width & ~1;
+ sel->r.height = pix->height & ~1;
+ break;
+ default:
return -EINVAL;
- crop->c = vout->crop;
+ }
return 0;
}
-static int vidioc_s_crop(struct file *file, void *fh, const struct v4l2_crop *crop)
+static int vidioc_s_selection(struct file *file, void *fh, struct v4l2_selection *sel)
{
int ret = -EINVAL;
struct omap_vout_device *vout = fh;
@@ -1285,6 +1282,12 @@ static int vidioc_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr
struct omap_video_timings *timing;
struct omap_dss_device *dssdev;
+ if (sel->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
+ return -EINVAL;
+
+ if (sel->target != V4L2_SEL_TGT_CROP)
+ return -EINVAL;
+
if (vout->streaming)
return -EBUSY;
@@ -1309,9 +1312,8 @@ static int vidioc_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr
vout->fbuf.fmt.width = timing->x_res;
}
- if (crop->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
- ret = omap_vout_new_crop(&vout->pix, &vout->crop, &vout->win,
- &vout->fbuf, &crop->c);
+ ret = omap_vout_new_crop(&vout->pix, &vout->crop, &vout->win,
+ &vout->fbuf, &sel->r);
s_crop_err:
mutex_unlock(&vout->lock);
@@ -1780,9 +1782,8 @@ static const struct v4l2_ioctl_ops vout_ioctl_ops = {
.vidioc_try_fmt_vid_out_overlay = vidioc_try_fmt_vid_overlay,
.vidioc_s_fmt_vid_out_overlay = vidioc_s_fmt_vid_overlay,
.vidioc_g_fmt_vid_out_overlay = vidioc_g_fmt_vid_overlay,
- .vidioc_cropcap = vidioc_cropcap,
- .vidioc_g_crop = vidioc_g_crop,
- .vidioc_s_crop = vidioc_s_crop,
+ .vidioc_g_selection = vidioc_g_selection,
+ .vidioc_s_selection = vidioc_s_selection,
.vidioc_reqbufs = vidioc_reqbufs,
.vidioc_querybuf = vidioc_querybuf,
.vidioc_qbuf = vidioc_qbuf,
OpenPOWER on IntegriCloud