From patchwork Fri May 16 13:33:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 4191751 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D8327BFF02 for ; Fri, 16 May 2014 13:39:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F041320200 for ; Fri, 16 May 2014 13:39:04 +0000 (UTC) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E31A20251 for ; Fri, 16 May 2014 13:39:02 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4GDcG0q005369; Fri, 16 May 2014 08:38:16 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDcGTu008034; Fri, 16 May 2014 08:38:16 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 16 May 2014 08:38:15 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDcFY1025000; Fri, 16 May 2014 08:38:15 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C6E1F80628; Fri, 16 May 2014 08:38:15 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv17.itg.ti.com (dflxv17.itg.ti.com [128.247.5.93]) by linux.omap.com (Postfix) with ESMTP id 027DC8062B for ; Fri, 16 May 2014 08:36:46 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflxv17.itg.ti.com (8.14.3/8.13.8) with ESMTP id s4GDajhf011249 for ; Fri, 16 May 2014 08:36:45 -0500 Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id s4GDajYd021034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 16 May 2014 08:36:45 -0500 Received: from [216.82.253.163:52904] by server-11.bemta-7.messagelabs.com id 99/BE-21432-D6416735; Fri, 16 May 2014 13:36:45 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-15.tower-166.messagelabs.com!1400247404!13597005!1 X-Originating-IP: [209.85.160.45] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20391 invoked from network); 16 May 2014 13:36:44 -0000 Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by server-15.tower-166.messagelabs.com with RC4-SHA encrypted SMTP; 16 May 2014 13:36:44 -0000 Received: by mail-pb0-f45.google.com with SMTP id um1so2623055pbc.4 for ; Fri, 16 May 2014 06:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R31gLywOy3KCGPdXwT9vDfq/qTyA5LqDoz264wnlAFk=; b=tyO8L2WDRdcvOYi9Z5WnIR2R6oceuIw8DstElruO7ieGb/6ssd1yAWHbr39Vs62jyN nSQcnqHdOXSfh6Nm9Amz4QRgtDP8n+tFzp6W4hRNC3IAADxmtsq5nZe9iCcEYJw1jKfW lvixGU4CfuGApfb62DH7F2RASS2AN+D5udhZ+q0mBtTcGyLN7ml8J2MkWb4C9/7XfK7Q DrIRz4Y3T70ZJwvlsc2THONTV/NLDtfIF32jk/fGe00IFVg9HZm8rXW4wtrv/YpLm8WU +6iQmi2uBlUIYdQezt9yYMbK1HUztS0dFSL+aR+NRd4ghv//RtVzVqwMTGvIRYRgBjOi Ol6w== X-Received: by 10.66.218.36 with SMTP id pd4mr21175328pac.141.1400247404197; Fri, 16 May 2014 06:36:44 -0700 (PDT) Received: from localhost.localdomain ([27.107.45.22]) by mx.google.com with ESMTPSA id cj1sm34699547pac.40.2014.05.16.06.36.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 06:36:43 -0700 (PDT) From: "Lad, Prabhakar" To: LMML , Hans Verkuil Subject: [PATCH v5 03/49] media: davinci: vpif_display: use vb2_ops_wait_prepare/finish helper functions Date: Fri, 16 May 2014 19:03:08 +0530 Message-ID: <1400247235-31434-5-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400247235-31434-1-git-send-email-prabhakar.csengg@gmail.com> References: <1400247235-31434-1-git-send-email-prabhakar.csengg@gmail.com> CC: DLOS , LKML X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Lad, Prabhakar" this patch makes use of vb2_ops_wait_prepare/finish helper functions. Signed-off-by: Lad, Prabhakar --- drivers/media/platform/davinci/vpif_display.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/davinci/vpif_display.c b/drivers/media/platform/davinci/vpif_display.c index e2102ea..8bb9f02 100644 --- a/drivers/media/platform/davinci/vpif_display.c +++ b/drivers/media/platform/davinci/vpif_display.c @@ -187,24 +187,6 @@ static void vpif_buf_cleanup(struct vb2_buffer *vb) spin_unlock_irqrestore(&common->irqlock, flags); } -static void vpif_wait_prepare(struct vb2_queue *vq) -{ - struct channel_obj *ch = vb2_get_drv_priv(vq); - struct common_obj *common; - - common = &ch->common[VPIF_VIDEO_INDEX]; - mutex_unlock(&common->lock); -} - -static void vpif_wait_finish(struct vb2_queue *vq) -{ - struct channel_obj *ch = vb2_get_drv_priv(vq); - struct common_obj *common; - - common = &ch->common[VPIF_VIDEO_INDEX]; - mutex_lock(&common->lock); -} - static u8 channel_first_int[VPIF_NUMOBJECTS][2] = { {1, 1} }; static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) @@ -339,8 +321,8 @@ static void vpif_stop_streaming(struct vb2_queue *vq) static struct vb2_ops video_qops = { .queue_setup = vpif_buffer_queue_setup, - .wait_prepare = vpif_wait_prepare, - .wait_finish = vpif_wait_finish, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .buf_prepare = vpif_buffer_prepare, .start_streaming = vpif_start_streaming, .stop_streaming = vpif_stop_streaming, @@ -1649,6 +1631,7 @@ static int vpif_probe_complete(void) q->buf_struct_size = sizeof(struct vpif_disp_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 1; + q->lock = &common->lock; err = vb2_queue_init(q); if (err) {