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/zoran/zoran_driver.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/zoran/zoran_driver.c')
-rw-r--r-- | linux/drivers/media/video/zoran/zoran_driver.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c index 793395074..8c17d47b3 100644 --- a/linux/drivers/media/video/zoran/zoran_driver.c +++ b/linux/drivers/media/video/zoran/zoran_driver.c @@ -2096,16 +2096,10 @@ static int zoran_try_fmt_vid_cap(struct file *file, void *__fh, return -EINVAL; } - bpp = (zoran_formats[i].depth + 7) / 8; - fmt->fmt.pix.width &= ~((bpp == 2) ? 1 : 3); - if (fmt->fmt.pix.width > BUZ_MAX_WIDTH) - fmt->fmt.pix.width = BUZ_MAX_WIDTH; - if (fmt->fmt.pix.width < BUZ_MIN_WIDTH) - fmt->fmt.pix.width = BUZ_MIN_WIDTH; - if (fmt->fmt.pix.height > BUZ_MAX_HEIGHT) - fmt->fmt.pix.height = BUZ_MAX_HEIGHT; - if (fmt->fmt.pix.height < BUZ_MIN_HEIGHT) - fmt->fmt.pix.height = BUZ_MIN_HEIGHT; + bpp = DIV_ROUND_UP(zoran_formats[i].depth, 8); + v4l_bound_align_image( + &fmt->fmt.pix.width, BUZ_MIN_WIDTH, BUZ_MAX_WIDTH, bpp == 2 ? 1 : 2, + &fmt->fmt.pix.height, BUZ_MIN_HEIGHT, BUZ_MAX_HEIGHT, 0, 0); mutex_unlock(&zr->resource_lock); return 0; |