From patchwork Mon Jan 31 12:19:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 5764 Return-path: Envelope-to: mchehab@pedra Delivery-date: Mon, 31 Jan 2011 10:19:45 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PjsjR-00063v-7K for mchehab@pedra; Mon, 31 Jan 2011 10:19:45 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Mon, 31 Jan 2011 10:19:45 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PjsiT-0004iN-3j; Mon, 31 Jan 2011 12:18:45 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755420Ab1AaMSn (ORCPT + 1 other); Mon, 31 Jan 2011 07:18:43 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:50619 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543Ab1AaMSm (ORCPT ); Mon, 31 Jan 2011 07:18:42 -0500 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 56EA71C08E0C; Mon, 31 Jan 2011 13:18:41 +0100 (CET) X-Auth-Info: HBSJQ/KCrso99RSquCBBaAZWi2DhCX50TzPVAXaTzd0= Received: from localhost (p4FE3DF32.dip.t-dialin.net [79.227.223.50]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 2C41B1C0008A; Mon, 31 Jan 2011 13:18:41 +0100 (CET) From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Guennadi Liakhovetski , Detlev Zundel , Markus Niebel Subject: [PATCH 1/2 v2] v4l: soc-camera: start stream after queueing the buffers Date: Mon, 31 Jan 2011 13:19:32 +0100 Message-Id: <1296476372-10388-1-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1296031789-1721-2-git-send-email-agust@denx.de> References: <1296031789-1721-2-git-send-email-agust@denx.de> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Some camera systems have strong requirement for capturing an exact number of frames after starting the stream and do not tolerate losing captured frames. By starting the stream after the videobuf has queued the buffers, we ensure that no frame will be lost. Signed-off-by: Anatolij Gustschin --- v2: Check for return value of videobuf_streamon() before starting the stream, as suggested by Guennadi. drivers/media/video/soc_camera.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index a66811b..e09bec0 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c @@ -646,11 +646,12 @@ static int soc_camera_streamon(struct file *file, void *priv, if (icd->streamer != file) return -EBUSY; - v4l2_subdev_call(sd, video, s_stream, 1); - /* This calls buf_queue from host driver's videobuf_queue_ops */ ret = videobuf_streamon(&icd->vb_vidq); + if (!ret) + v4l2_subdev_call(sd, video, s_stream, 1); + return ret; }