aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-video.c
diff options
context:
space:
mode:
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>2010-03-19 14:58:23 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:57:13 -0300
commit0a062033f727dc041691bfd768f4cf0598f559a1 (patch)
tree8d909009ef123050590054de96458c4706a7c7c4 /drivers/media/video/saa7134/saa7134-video.c
parent2b0691cfc714a0f4dff582c913de1a3a68cb38a7 (diff)
downloadkernel_samsung_smdk4412-0a062033f727dc041691bfd768f4cf0598f559a1.zip
kernel_samsung_smdk4412-0a062033f727dc041691bfd768f4cf0598f559a1.tar.gz
kernel_samsung_smdk4412-0a062033f727dc041691bfd768f4cf0598f559a1.tar.bz2
Revert "V4L/DVB (11906): saa7134: Use v4l bounding/alignment function"
This reverts commit bc52d6eb44de8f19934768d4d10d19fdbdc99950. On newer kernels, a saa7134 board stopped to display TV video output properly. After a bisect, I found it as the commit causing the issue. Turns out that v4l_bound_align_image isn't doing the same bounding calculation as manually done previously in saa7134_try_fmt_vid_cap. What isn't equal is the calculation done in clamp align, while previously it did "f->fmt.pix.width &= ~0x03", clamp_align function does "Round to nearest aligned value" as stated in the comment, which yields a different result. If I comment the round calculation in clamp_align like this: "x = (x /*+ (1 << (align - 1))*/) & mask", I get it fixed too, because this way the calculation is the same then. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 31138d3..7806fb1 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1632,8 +1632,15 @@ static int saa7134_try_fmt_vid_cap(struct file *file, void *priv,
}
f->fmt.pix.field = field;
- v4l_bound_align_image(&f->fmt.pix.width, 48, maxw, 2,
- &f->fmt.pix.height, 32, maxh, 0, 0);
+ if (f->fmt.pix.width < 48)
+ f->fmt.pix.width = 48;
+ if (f->fmt.pix.height < 32)
+ f->fmt.pix.height = 32;
+ if (f->fmt.pix.width > maxw)
+ f->fmt.pix.width = maxw;
+ if (f->fmt.pix.height > maxh)
+ f->fmt.pix.height = maxh;
+ f->fmt.pix.width &= ~0x03;
f->fmt.pix.bytesperline =
(f->fmt.pix.width * fmt->depth) >> 3;
f->fmt.pix.sizeimage =