Skip to content

Commit

Permalink
V4L/DVB (11903): sh_mobile_ceu_camera: Use v4l bounding/alignment fun…
Browse files Browse the repository at this point in the history
…ction

The v4l function has a better algorithm for aligning image size.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Jun 23, 2009
1 parent 4a6b8df commit bc44fc0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,16 +689,8 @@ static int sh_mobile_ceu_try_fmt(struct soc_camera_device *icd,

/* FIXME: calculate using depth and bus width */

if (f->fmt.pix.height < 4)
f->fmt.pix.height = 4;
if (f->fmt.pix.height > 1920)
f->fmt.pix.height = 1920;
if (f->fmt.pix.width < 2)
f->fmt.pix.width = 2;
if (f->fmt.pix.width > 2560)
f->fmt.pix.width = 2560;
f->fmt.pix.width &= ~0x01;
f->fmt.pix.height &= ~0x03;
v4l_bound_align_image(&f->fmt.pix.width, 2, 2560, 1,
&f->fmt.pix.height, 4, 1920, 2, 0);

f->fmt.pix.bytesperline = f->fmt.pix.width *
DIV_ROUND_UP(xlate->host_fmt->depth, 8);
Expand Down

0 comments on commit bc44fc0

Please sign in to comment.