diff options
author | Andrey Utkin <andrey.utkin@corp.bluecherry.net> | 2016-09-21 21:04:20 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-24 18:02:54 -0200 |
commit | 6dfcd296576a14bc52d0453e4ba7ed09323a26dc (patch) | |
tree | 020f0235799ae99d9ef7003087e6438179df4164 /drivers/media/pci/tw5864/tw5864-video.c | |
parent | e546b1ef22850d53a9e21c4d0bcf9a6057cd9293 (diff) | |
download | lwn-6dfcd296576a14bc52d0453e4ba7ed09323a26dc.tar.gz lwn-6dfcd296576a14bc52d0453e4ba7ed09323a26dc.zip |
[media] tw5864: crop picture width to 704
Previously, width of 720 was used, but it gives 16-pixel wide black bar
at right side of encoded picture.
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/tw5864/tw5864-video.c')
-rw-r--r-- | drivers/media/pci/tw5864/tw5864-video.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index 652a059b2e0a..9421216bb942 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -330,6 +330,15 @@ static int tw5864_enable_input(struct tw5864_input *input) tw_indir_writeb(TW5864_INDIR_OUT_PIC_WIDTH(nr), input->width / 4); tw_indir_writeb(TW5864_INDIR_OUT_PIC_HEIGHT(nr), input->height / 4); + /* + * Crop width from 720 to 704. + * Above register settings need value 720 involved. + */ + input->width = 704; + tw_indir_writeb(TW5864_INDIR_CROP_ETC, + tw_indir_readb(TW5864_INDIR_CROP_ETC) | + TW5864_INDIR_CROP_ETC_CROP_EN); + tw_writel(TW5864_DSP_PIC_MAX_MB, ((input->width / 16) << 8) | (input->height / 16)); @@ -532,7 +541,7 @@ static int tw5864_fmt_vid_cap(struct file *file, void *priv, { struct tw5864_input *input = video_drvdata(file); - f->fmt.pix.width = 720; + f->fmt.pix.width = 704; switch (input->std) { default: WARN_ON_ONCE(1); @@ -738,7 +747,7 @@ static int tw5864_enum_framesizes(struct file *file, void *priv, return -EINVAL; fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; - fsize->discrete.width = 720; + fsize->discrete.width = 704; fsize->discrete.height = input->std == STD_NTSC ? 480 : 576; return 0; |