summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorNiklas Söderlund2018-05-11 16:41:26 +0200
committerMauro Carvalho Chehab2018-05-11 17:39:51 +0200
commit3997716898a90954e00e4a5d5f1eacb94fbc41d9 (patch)
tree32447612d3264d8df981f47495729b817475f44e /drivers/media/platform
parentmedia: Revert "media: rcar-vin: enable field toggle after a set number of lin... (diff)
downloadkernel-qcow2-linux-3997716898a90954e00e4a5d5f1eacb94fbc41d9.tar.gz
kernel-qcow2-linux-3997716898a90954e00e4a5d5f1eacb94fbc41d9.tar.xz
kernel-qcow2-linux-3997716898a90954e00e4a5d5f1eacb94fbc41d9.zip
media: rcar-vin: fix crop and compose handling for Gen3
When refactoring the Gen3 enablement series crop and compose handling where broken. This went unnoticed but can result in writing out side the capture buffer. Fix this by restoring the crop and compose to reflect the format dimensions as we have not yet enabled the scaler for Gen3. Fixes: 5e7c623632fcf8f5 ("media: rcar-vin: use different v4l2 operations in media controller mode") Reported-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/rcar-vin/rcar-v4l2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 2fb8587116f2..e78fba84d590 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -702,6 +702,12 @@ static int rvin_mc_s_fmt_vid_cap(struct file *file, void *priv,
vin->format = f->fmt.pix;
+ vin->crop.top = 0;
+ vin->crop.left = 0;
+ vin->crop.width = vin->format.width;
+ vin->crop.height = vin->format.height;
+ vin->compose = vin->crop;
+
return 0;
}