提交 728f5b93 编写于 作者: T Trent Piepho 提交者: Mauro Carvalho Chehab

V4L/DVB (11904): zoran: Use v4l bounding/alignment functiob

The v4l function has a better algorithm for aligning image size.
Signed-off-by: NTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 bc44fc06
...@@ -2088,16 +2088,10 @@ static int zoran_try_fmt_vid_cap(struct file *file, void *__fh, ...@@ -2088,16 +2088,10 @@ static int zoran_try_fmt_vid_cap(struct file *file, void *__fh,
return -EINVAL; return -EINVAL;
} }
bpp = (zoran_formats[i].depth + 7) / 8; bpp = DIV_ROUND_UP(zoran_formats[i].depth, 8);
fmt->fmt.pix.width &= ~((bpp == 2) ? 1 : 3); v4l_bound_align_image(
if (fmt->fmt.pix.width > BUZ_MAX_WIDTH) &fmt->fmt.pix.width, BUZ_MIN_WIDTH, BUZ_MAX_WIDTH, bpp == 2 ? 1 : 2,
fmt->fmt.pix.width = BUZ_MAX_WIDTH; &fmt->fmt.pix.height, BUZ_MIN_HEIGHT, BUZ_MAX_HEIGHT, 0, 0);
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;
mutex_unlock(&zr->resource_lock); mutex_unlock(&zr->resource_lock);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册