diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-17 20:40:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-17 20:40:44 -0300 |
commit | 1596f74981cbcf720947b4fd600028d24edfa783 (patch) | |
tree | 567930fe1e74814e851197326a1adedd038866c8 /linux/drivers/media/video | |
parent | d751a965ff35ef575d2863b5d1256dd8e2a0bddf (diff) | |
parent | 3a6edb94d704d582201d9fad16a566691f176e76 (diff) | |
download | mediapointer-dvb-s2-1596f74981cbcf720947b4fd600028d24edfa783.tar.gz mediapointer-dvb-s2-1596f74981cbcf720947b4fd600028d24edfa783.tar.bz2 |
merge: http://linuxtv.org/hg/~tap/fix
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/pxa_camera.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/v4l2-common.c | 5 |
2 files changed, 11 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pxa_camera.c b/linux/drivers/media/video/pxa_camera.c index 7578d0cfe..8964d60cd 100644 --- a/linux/drivers/media/video/pxa_camera.c +++ b/linux/drivers/media/video/pxa_camera.c @@ -1403,13 +1403,15 @@ static int pxa_camera_try_fmt(struct soc_camera_device *icd, return -EINVAL; } - /* Limit to pxa hardware capabilities. YUV422P planar format requires + /* + * Limit to pxa hardware capabilities. YUV422P planar format requires * images size to be a multiple of 16 bytes. If not, zeros will be * inserted between Y and U planes, and U and V planes, which violates - * the YUV422P standard. */ - v4l2_bound_align_image(&pix->width, 48, 2048, 1, - &pix->height, 32, 2048, 0, - xlate->host_fmt->fourcc == V4L2_PIX_FMT_YUV422P ? 4 : 0); + * the YUV422P standard. + */ + v4l_bound_align_image(&pix->width, 48, 2048, 1, + &pix->height, 32, 2048, 0, + xlate->host_fmt->fourcc == V4L2_PIX_FMT_YUV422P ? 4 : 0); pix->bytesperline = pix->width * DIV_ROUND_UP(xlate->host_fmt->depth, 8); diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c index ba3790a98..f94b5d92a 100644 --- a/linux/drivers/media/video/v4l2-common.c +++ b/linux/drivers/media/video/v4l2-common.c @@ -1055,10 +1055,13 @@ void v4l_bound_align_image(u32 *w, unsigned int wmin, unsigned int wmax, if (walign + halign < salign) { /* Max walign where there is still a valid width */ unsigned int wmaxa = __fls(wmax ^ (wmin - 1)); + /* Max halign where there is still a valid height */ + unsigned int hmaxa = __fls(hmax ^ (hmin - 1)); /* up the smaller alignment until we have enough */ do { - if (walign <= halign && walign < wmaxa) { + if (halign >= hmaxa || + (walign <= halign && walign < wmaxa)) { *w = clamp_align(*w, wmin, wmax, walign + 1); walign = __ffs(*w); } else { |