From patchwork Tue Nov 3 10:16:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junghak Sung X-Patchwork-Id: 7541381 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 035919F399 for ; Tue, 3 Nov 2015 10:17:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A69820522 for ; Tue, 3 Nov 2015 10:17:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 20DA420529 for ; Tue, 3 Nov 2015 10:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029AbbKCKQz (ORCPT ); Tue, 3 Nov 2015 05:16:55 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:53311 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751782AbbKCKQs (ORCPT ); Tue, 3 Nov 2015 05:16:48 -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 <0NX802I24HVW5M60@mailout2.samsung.com> for linux-media@vger.kernel.org; Tue, 03 Nov 2015 19:16:44 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.112]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id AD.66.05274.C8988365; Tue, 3 Nov 2015 19:16:44 +0900 (KST) X-AuditID: cbfee68d-f79ae6d00000149a-74-5638898cc889 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id FC.D3.18629.C8988365; Tue, 3 Nov 2015 19:16:44 +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 <0NX8008Z8HVVS340@mmp2.samsung.com>; Tue, 03 Nov 2015 19:16:44 +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 v9 4/6] media: videobuf2: last_buffer_queued is set at fill_v4l2_buffer() Date: Tue, 03 Nov 2015 19:16:40 +0900 Message-id: <1446545802-28496-5-git-send-email-jh1009.sung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1446545802-28496-1-git-send-email-jh1009.sung@samsung.com> References: <1446545802-28496-1-git-send-email-jh1009.sung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRmVeSWpSXmKPExsWyRsSkQLen0yLMYOF+JYtTk58xWUy6P4HF YvvxV+wWnROXsFv0bNjKarH6WYXFgb5dTBZT3v5kt/g37SmzxZn9K9ksjn86yGIxY/JLNgce j9kdM1k9Dn9dyOLx+NdLNo8t/XfZPfq2rGL0+LxJzuPU18/sAexRXDYpqTmZZalF+nYJXBn/ DlxjKljJVXHykHwD4xWOLkZODgkBE4n7fT3sELaYxIV769m6GLk4hARWMEpcWnmREaao7ekT JhBbSGAWo8SZt2UQRd8ZJXqnLQQq4uBgE9CRmLzZECQuIjADKH58FROIwyywnFHi9OtTYCuE BeIlVj14yApiswioSux6uRkszivgLnH96gR2kEESAgoScybZgJicAh4S/X9LIfa6S7yYfgTs OAmBS+wSi748Y4MYIyDxbfIhFohWWYlNB5ghbpaUOLjiBssERuEFjAyrGEVTC5ILipPSiwz1 ihNzi0vz0vW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5OqQbGw2feRtR5 N+y/pvj3xw7lp0kBD6o7bKNnnz4a+Wzhw+cGOU8X7m390iC/5itPhBPn7IKMOJ27b4Xqp5ec Tt/be8xskqqf7uKGl9M1ZW6w7+wL7Vu6sNEj1C5l53UWFQkT7hdrD2upNK3nYDs1s03qhMhH rr0GxzYfeiXdL/tu+vFHmbKTRM3WKrEUZyQaajEXFScCALQCPyHbAgAA 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 Acked-by: Hans Verkuil --- 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 0ca9f23..b0293df 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; } @@ -579,10 +584,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; }