From patchwork Fri Oct 16 06:27:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junghak Sung X-Patchwork-Id: 7411051 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD01DBEEA4 for ; Fri, 16 Oct 2015 06:28:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7F6420A6C for ; Fri, 16 Oct 2015 06:28:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E72320A68 for ; Fri, 16 Oct 2015 06:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753230AbbJPG1y (ORCPT ); Fri, 16 Oct 2015 02:27:54 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:37279 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbbJPG1s (ORCPT ); Fri, 16 Oct 2015 02:27:48 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NWA00VC5VAAC370@mailout1.samsung.com> for linux-media@vger.kernel.org; Fri, 16 Oct 2015 15:27:46 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 29.18.05272.2E890265; Fri, 16 Oct 2015 15:27:46 +0900 (KST) X-AuditID: cbfee68e-f791c6d000001498-4b-562098e2a097 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id CD.26.18629.1E890265; Fri, 16 Oct 2015 15:27:45 +0900 (KST) Received: from localhost.localdomain ([10.252.83.96]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NWA001RRVA8KE70@mmp1.samsung.com>; Fri, 16 Oct 2015 15:27:45 +0900 (KST) From: Junghak Sung To: linux-media@vger.kernel.org, mchehab@osg.samsung.com, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi, pawel@osciak.com Cc: inki.dae@samsung.com, sw0312.kim@samsung.com, nenggun.kim@samsung.com, sangbae90.lee@samsung.com, rany.kwon@samsung.com, Junghak Sung Subject: [RFC PATCH v7 5/7] media: videobuf2: last_buffer_queued is checked at fill_v4l2_buffer() Date: Fri, 16 Oct 2015 15:27:41 +0900 Message-id: <1444976863-3657-6-git-send-email-jh1009.sung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1444976863-3657-1-git-send-email-jh1009.sung@samsung.com> References: <1444976863-3657-1-git-send-email-jh1009.sung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsWyRsSkUPfRDIUwg7WTmS1OTX7GZDHp/gQW i+3HX7FbdE5cwm7Rs2Erq8XqZxUWB/p2MVlMefuT3eLftKfMFmf2r2SzOP7pIIvFjMkv2Rx4 PGZ3zGT1OPx1IYvH418v2Ty29N9l9+jbsorR4/MmOY9TXz+zB7BHcdmkpOZklqUW6dslcGVM PbGAsWA5V8XpeUuZGhgvcXQxcnJICJhIrFn1kQnCFpO4cG89WxcjF4eQwApGibYfd1hhilr/ bWaFSCxllPhw4RRU1XdGiV/fpwI5HBxsAjoSkzcbgsRFBGYwSvQeX8UE4jALLGeUOP36FDvI KGGBZIklk1+C2SwCqhJvZ55jBGnmFXCTWLcrF8SUEFCQmDPJBqSCU8BdYvXJrcwgYSGgiqOn akEmSghcYpc4uXcHG8QUAYlvkw+xQLTKSmw6wAxxs6TEwRU3WC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5akZqemFqQWwfQxcXBKNTCGmEx7m776 yMmTjzfPzv15/pXsPacVpR++r7oSUvyl2j7tR4ea106J/vc6PLdncoj997v17FDxAtbCymV7 S71Mgza59exZVZfSnykX/Pj1hDeLZz9U3X01yWmdgnLH7pMsk5dr/lxqXXIjvkrnx4np0ikT brjpMoQunFm5ye2/qFz9T3PngzPWKbEUZyQaajEXFScCAFwxV+7cAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The location to set last_buffer_queued is moved to fill_v4l2_buffer(). So, vb2_core_dqbuf() can be used instead of vb2_internal_dqbuf() in __vb2_perform_fileio(). Signed-off-by: Junghak Sung Signed-off-by: Geunyoung Kim Acked-by: Seung-Woo Kim Acked-by: Inki Dae --- drivers/media/v4l2-core/videobuf2-v4l2.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c index 8ea4d9e..dabcb6d 100644 --- a/drivers/media/v4l2-core/videobuf2-v4l2.c +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c @@ -270,6 +270,11 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) if (vb2_buffer_in_use(q, vb)) b->flags |= V4L2_BUF_FLAG_MAPPED; + if (!q->is_output && + b->flags & V4L2_BUF_FLAG_DONE && + b->flags & V4L2_BUF_FLAG_LAST) + q->last_buffer_dequeued = true; + return 0; } @@ -580,10 +585,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, ret = vb2_core_dqbuf(q, b, nonblocking); - if (!ret && !q->is_output && - b->flags & V4L2_BUF_FLAG_LAST) - q->last_buffer_dequeued = true; - return ret; }