From patchwork Mon Nov 2 04:43:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junghak Sung X-Patchwork-Id: 7533721 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 C9726BF90C for ; Mon, 2 Nov 2015 04:44:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEFF5205D1 for ; Mon, 2 Nov 2015 04:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C1B6205D3 for ; Mon, 2 Nov 2015 04:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068AbbKBEn7 (ORCPT ); Sun, 1 Nov 2015 23:43:59 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:42660 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbbKBEnz (ORCPT ); Sun, 1 Nov 2015 23:43:55 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NX6017KF7T0YT00@mailout2.samsung.com> for linux-media@vger.kernel.org; Mon, 02 Nov 2015 13:43:48 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 9E.FE.05274.40AE6365; Mon, 2 Nov 2015 13:43:48 +0900 (KST) X-AuditID: cbfee68d-f79ae6d00000149a-1f-5636ea040213 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 5C.D0.18629.40AE6365; Mon, 2 Nov 2015 13:43:48 +0900 (KST) Received: from localhost.localdomain ([10.252.83.96]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NX600C7F7T0BE80@mmp2.samsung.com>; Mon, 02 Nov 2015 13:43:48 +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 v8 4/6] media: videobuf2: last_buffer_queued is set at fill_v4l2_buffer() Date: Mon, 02 Nov 2015 13:43:43 +0900 Message-id: <1446439425-13242-5-git-send-email-jh1009.sung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1446439425-13242-1-git-send-email-jh1009.sung@samsung.com> References: <1446439425-13242-1-git-send-email-jh1009.sung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHLMWRmVeSWpSXmKPExsWyRsSkQJfllVmYweJ32hanJj9jsph0fwKL xfbjr9gtOicuYbfo2bCV1WL1swqLA327mCymvP3JbvFv2lNmizP7V7JZHP90kMVixuSXbA48 HrM7ZrJ6HP66kMXj8a+XbB5b+u+ye/RtWcXo8XmTnMepr5/ZA9ijuGxSUnMyy1KL9O0SuDJ+ TG1hK1jFVXHu4h3mBsarHF2MnBwSAiYSx25eYoOwxSQu3FsPZHNxCAmsYJTYc/8nI0zR9O5r TBCJWYwSm2Z9YoFwvjNKfPuwh7mLkYODTUBHYvJmQ5C4iMAMRone46vAOpgFljNKnH59ih1k lLBAvMTaTZ1g+1gEVCXeT+1kBrF5BdwlFn+4ADZIQkBBYs4kG5Awp4CHxPsJv5hAbCGgkomz 97CDzJQQuMYusXduE9QcAYlvkw+xQPTKSmw6wAxxtaTEwRU3W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dRmJBAemJJanZqakFqEUwfEwenVAOjUfNx WZZTZXNUPQ+9yd7l6DblTHT8l7n35i/W93/Y8tbJsZI18dKPfWGyj4vP+k5/VOKU/May5Urs NIM0Fk7rm3t5dr3box/gLPyMc5d3f3R2YdK968ala1dv8bZmqkhW1rKxTWbw3SkSmP3yrszk 5VY8VU9bnjw7YXX02NR3D//GRGUZcT1QYinOSDTUYi4qTgQAZteV7d4CAAA= 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 in which last_buffer_queued is set is moved to fill_v4l2_buffer(). So, __vb2_perform_fileio() can use vb2_core_dqbuf() instead of vb2_internal_dqbuf(). 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 5be9ed8e..1468b30 100644 --- a/drivers/media/v4l2-core/videobuf2-v4l2.c +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c @@ -274,6 +274,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; } @@ -584,10 +589,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; }