aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/zoran/zoran_driver.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 643cccaa1aab..3d7df32a3d87 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -2088,16 +2088,10 @@ static int zoran_try_fmt_vid_cap(struct file *file, void *__fh,
2088 return -EINVAL; 2088 return -EINVAL;
2089 } 2089 }
2090 2090
2091 bpp = (zoran_formats[i].depth + 7) / 8; 2091 bpp = DIV_ROUND_UP(zoran_formats[i].depth, 8);
2092 fmt->fmt.pix.width &= ~((bpp == 2) ? 1 : 3); 2092 v4l_bound_align_image(
2093 if (fmt->fmt.pix.width > BUZ_MAX_WIDTH) 2093 &fmt->fmt.pix.width, BUZ_MIN_WIDTH, BUZ_MAX_WIDTH, bpp == 2 ? 1 : 2,
2094 fmt->fmt.pix.width = BUZ_MAX_WIDTH; 2094 &fmt->fmt.pix.height, BUZ_MIN_HEIGHT, BUZ_MAX_HEIGHT, 0, 0);
2095 if (fmt->fmt.pix.width < BUZ_MIN_WIDTH)
2096 fmt->fmt.pix.width = BUZ_MIN_WIDTH;
2097 if (fmt->fmt.pix.height > BUZ_MAX_HEIGHT)
2098 fmt->fmt.pix.height = BUZ_MAX_HEIGHT;
2099 if (fmt->fmt.pix.height < BUZ_MIN_HEIGHT)
2100 fmt->fmt.pix.height = BUZ_MIN_HEIGHT;
2101 mutex_unlock(&zr->resource_lock); 2095 mutex_unlock(&zr->resource_lock);
2102 2096
2103 return 0; 2097 return 0;