diff mbox

omap34xxcam: each video buffer takes multiple of PAGE_SIZE bytes

Message ID 1248357387-14720-4-git-send-email-tuukka.o.toivonen@nokia.com (mailing list archive)
State RFC
Headers show

Commit Message

Tuukka.O Toivonen July 23, 2009, 1:56 p.m. UTC
From: Tuukka Toivonen <tuukka.o.toivonen@nokia.com>

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 <tuukka.o.toivonen@nokia.com>
---
 drivers/media/video/omap34xxcam.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

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);