From: Tuukka Toivonen <[email protected]>

When restricting the required memory for video buffers,
take into account that each buffer allocation takes multiple
of PAGE_SIZE bytes.

Signed-off-by: Tuukka Toivonen <[email protected]>
---
 drivers/media/video/omap34xxcam.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap34xxcam.c 
b/drivers/media/video/omap34xxcam.c
index 08d8253..be2dd2d 100644
--- a/drivers/media/video/omap34xxcam.c
+++ b/drivers/media/video/omap34xxcam.c
@@ -154,7 +154,8 @@ static int omap34xxcam_vbq_setup(struct videobuf_queue 
*vbq, unsigned int *cnt,
 
        *size = vdev->pix.sizeimage;
 
-       while (*size * *cnt > fh->vdev->vdev_sensor_config.capture_mem)
+       while (PAGE_ALIGN(*size) * *cnt >
+              fh->vdev->vdev_sensor_config.capture_mem)
                (*cnt)--;
 
        return isp_vbq_setup(vdev->cam->isp, vbq, cnt, size);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to