From patchwork Thu Jul 23 13:56:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tuukka.O Toivonen" X-Patchwork-Id: 36969 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6NDuq0M025870 for ; Thu, 23 Jul 2009 13:56:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751203AbZGWN4u (ORCPT ); Thu, 23 Jul 2009 09:56:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751463AbZGWN4u (ORCPT ); Thu, 23 Jul 2009 09:56:50 -0400 Received: from smtp.nokia.com ([192.100.122.230]:33203 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbZGWN4t (ORCPT ); Thu, 23 Jul 2009 09:56:49 -0400 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n6NDuSaU010987 for ; Thu, 23 Jul 2009 16:56:41 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 23 Jul 2009 16:56:34 +0300 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 23 Jul 2009 16:56:34 +0300 Received: from localhost.localdomain (ouped11921.nmp.nokia.com [172.23.119.21]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n6NDuRni017142; Thu, 23 Jul 2009 16:56:31 +0300 From: tuukka.o.toivonen@nokia.com To: linux-media@vger.kernel.org Cc: sakari.ailus@maxwell.research.nokia.com, tuukka.o.toivonen@nokia.com Subject: [PATCH] omap34xxcam: each video buffer takes multiple of PAGE_SIZE bytes Date: Thu, 23 Jul 2009 16:56:27 +0300 Message-Id: <1248357387-14720-4-git-send-email-tuukka.o.toivonen@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1248357387-14720-3-git-send-email-tuukka.o.toivonen@nokia.com> References: <1248357387-14720-1-git-send-email-tuukka.o.toivonen@nokia.com> <1248357387-14720-2-git-send-email-tuukka.o.toivonen@nokia.com> <1248357387-14720-3-git-send-email-tuukka.o.toivonen@nokia.com> X-OriginalArrivalTime: 23 Jul 2009 13:56:34.0529 (UTC) FILETIME=[63C7CD10:01CA0B9D] X-Nokia-AV: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Tuukka Toivonen 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 --- 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);