From patchwork Wed May 19 16:44:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: asheeshb@ti.com X-Patchwork-Id: 100938 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4JGjGtA009716 for ; Wed, 19 May 2010 16:45:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080Ab0ESQou (ORCPT ); Wed, 19 May 2010 12:44:50 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:37813 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754045Ab0ESQoo (ORCPT ); Wed, 19 May 2010 12:44:44 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4JGii1P012343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 May 2010 11:44:44 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o4JGiiNm010038 for ; Wed, 19 May 2010 11:44:44 -0500 (CDT) Received: from dlee73.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o4JGii8o013194 for ; Wed, 19 May 2010 11:44:44 -0500 (CDT) Received: from localhost.localdomain (158.218.48.84) by dlee73.ent.ti.com (157.170.170.88) with Microsoft SMTP Server (TLS) id 8.1.358.0; Wed, 19 May 2010 11:44:44 -0500 From: To: CC: Asheesh Bhardwaj Subject: [PATCH 4/7] Change vpif capture driver to get the right size image for the MMAP buffers Date: Wed, 19 May 2010 11:44:35 -0500 Message-ID: <1274287478-14661-5-git-send-email-asheeshb@ti.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1274287478-14661-4-git-send-email-asheeshb@ti.com> References: <1274287478-14661-1-git-send-email-asheeshb@ti.com> <1274287478-14661-2-git-send-email-asheeshb@ti.com> <1274287478-14661-3-git-send-email-asheeshb@ti.com> <1274287478-14661-4-git-send-email-asheeshb@ti.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 19 May 2010 16:45:17 +0000 (UTC) diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 9ba015d..d18a378 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -142,7 +142,7 @@ static int vpif_buffer_prepare(struct videobuf_queue *q, if (VIDEOBUF_NEEDS_INIT == vb->state) { vb->width = common->width; vb->height = common->height; - vb->size = vb->width * vb->height; + vb->size = common->fmt.fmt.pix.sizeimage; vb->field = field; ret = videobuf_iolock(q, vb, NULL); @@ -469,10 +469,8 @@ static void vpif_calculate_offsets(struct channel_obj *ch) } else vid_ch->buf_field = common->fmt.fmt.pix.field; - if (V4L2_MEMORY_USERPTR == common->memory) - sizeimage = common->fmt.fmt.pix.sizeimage; - else - sizeimage = config_params.channel_bufsize[ch->channel_id]; + /*sizeimage is same for both user and MMAP allocated buffers*/ + sizeimage = common->fmt.fmt.pix.sizeimage; hpitch = common->fmt.fmt.pix.bytesperline; vpitch = sizeimage / (hpitch * 2); @@ -630,10 +628,7 @@ static int vpif_check_format(struct channel_obj *ch, goto exit; } - if (V4L2_MEMORY_USERPTR == common->memory) - sizeimage = pixfmt->sizeimage; - else - sizeimage = config_params.channel_bufsize[ch->channel_id]; + sizeimage = pixfmt->sizeimage; vpitch = sizeimage / (hpitch * 2);