diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-06 08:15:26 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-06 08:15:26 -0300 |
commit | a54e4ff7ad973562ecb961a02ea8da66e2334aef (patch) | |
tree | fe475f0216d4971e771364a4fce63e759fd858ac /linux/drivers/media/video/cx231xx/cx231xx-video.c | |
parent | ab62c90c3f2b6debe4c45c66aa08b5a65039e40e (diff) | |
parent | d336dddd42e43b5465cd58b5a4812011805905df (diff) | |
download | mediapointer-dvb-s2-a54e4ff7ad973562ecb961a02ea8da66e2334aef.tar.gz mediapointer-dvb-s2-a54e4ff7ad973562ecb961a02ea8da66e2334aef.tar.bz2 |
merge: http://kernellabs.com/hg/~dheitmueller/misc-fixes-2
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/cx231xx/cx231xx-video.c')
-rw-r--r-- | linux/drivers/media/video/cx231xx/cx231xx-video.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/linux/drivers/media/video/cx231xx/cx231xx-video.c b/linux/drivers/media/video/cx231xx/cx231xx-video.c index 638a8d3e4..e00edd0aa 100644 --- a/linux/drivers/media/video/cx231xx/cx231xx-video.c +++ b/linux/drivers/media/video/cx231xx/cx231xx-video.c @@ -893,9 +893,9 @@ static int check_dev(struct cx231xx *dev) return 0; } -void get_scale(struct cx231xx *dev, - unsigned int width, unsigned int height, - unsigned int *hscale, unsigned int *vscale) +static void get_scale(struct cx231xx *dev, + unsigned int width, unsigned int height, + unsigned int *hscale, unsigned int *vscale) { unsigned int maxw = norm_maxw(dev); unsigned int maxh = norm_maxh(dev); @@ -907,10 +907,6 @@ void get_scale(struct cx231xx *dev, *vscale = (((unsigned long)maxh) << 12) / height - 4096L; if (*vscale >= 0x4000) *vscale = 0x3fff; - - dev->hscale = *hscale; - dev->vscale = *vscale; - } /* ------------------------------------------------------------------ @@ -955,8 +951,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, { struct cx231xx_fh *fh = priv; struct cx231xx *dev = fh->dev; - int width = f->fmt.pix.width; - int height = f->fmt.pix.height; + unsigned int width = f->fmt.pix.width; + unsigned int height = f->fmt.pix.height; unsigned int maxw = norm_maxw(dev); unsigned int maxh = norm_maxh(dev); unsigned int hscale, vscale; @@ -971,17 +967,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, /* width must even because of the YUYV format height must be even because of interlacing */ - height &= 0xfffe; - width &= 0xfffe; - - if (unlikely(height < 32)) - height = 32; - if (unlikely(height > maxh)) - height = maxh; - if (unlikely(width < 48)) - width = 48; - if (unlikely(width > maxw)) - width = maxw; + v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0); get_scale(dev, width, height, &hscale, &vscale); |