From patchwork Tue May 21 03:47:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2596061 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7C02E40077 for ; Tue, 21 May 2013 03:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755006Ab3EUDrj (ORCPT ); Mon, 20 May 2013 23:47:39 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:34906 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754723Ab3EUDrc (ORCPT ); Mon, 20 May 2013 23:47:32 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MN400F77QJ69OM0@mailout1.samsung.com> for linux-media@vger.kernel.org; Tue, 21 May 2013 12:47:30 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.112]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id C9.66.29708.25EEA915; Tue, 21 May 2013 12:47:30 +0900 (KST) X-AuditID: cbfee690-b7f6f6d00000740c-43-519aee52233b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F4.68.17674.15EEA915; Tue, 21 May 2013 12:47:30 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MN400AB6QJ38K21@mmp2.samsung.com>; Tue, 21 May 2013 12:47:29 +0900 (KST) From: Seung-Woo Kim To: linux-media@vger.kernel.org, mchehab@redhat.com Cc: m.szyprowski@samsung.com, hans.verkuil@cisco.com, pawel@osciak.com, kyungmin.park@samsung.com, sw0312.kim@samsung.com Subject: [RESEND][PATCH 1/2] media: vb2: return for polling if a buffer is available Date: Tue, 21 May 2013 12:47:29 +0900 Message-id: <1369108050-13522-2-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1369108050-13522-1-git-send-email-sw0312.kim@samsung.com> References: <1369108050-13522-1-git-send-email-sw0312.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrKLMWRmVeSWpSXmKPExsWyRsSkQDfo3axAg/3POSyW/NzFZHG26Q27 Rc+GrawWa4/cZbfYc/Qwu8WUtz/ZLWZMfsnmwO4x5fdGVo/Hv16yebzfd5XNo2/LKkaPz5vk AlijuGxSUnMyy1KL9O0SuDJ6t+5jKfjAXnF7xX32BsarbF2MnBwSAiYSl15+YoKwxSQu3FsP FOfiEBJYyijRvP8pXFHThkmsEInpjBK9TRuhnGYmiWnrDoNVsQnoSOxf8psVxBYRMJbY3NfJ 0sXIwcEsUC1xa4E6SFhYIExi0bH/zCA2i4CqxLv5u8FaeQXcJHZ9XscMsUxBYsG9t2BxTgF3 iQfzp7OD2EJANdf+LYI6aB67xIt/ihBzBCS+TT4EtkpCQFZi0wGoMZISB1fcYJnAKLyAkWEV o2hqQXJBcVJ6kYlecWJucWleul5yfu4mRmCQn/73bMIOxnsHrA8xJgONm8gsJZqcD4ySvJJ4 Q2MzIwtTE1NjI3NLM9KElcR51VusA4UE0hNLUrNTUwtSi+KLSnNSiw8xMnFwSjUwdj+49/37 FdEwdhUTrR3pG3MkmqxcbsVs+vQ7ilW6acJaoS5ZhjmFRQJzhLVuLzz43j1KZdujJV69WYfC YmQamZawFvbYMB/OnVOkmLLlqP7sb4rbp6VcUM06e+LXKk2fhC7mX1+X7Szdk90Sc1ZlaoTl z9tc1eLdW1W2ZC9SfHt1fm4cp9kCJZbijERDLeai4kQA0VWIhIgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsVy+t9jQd2gd7MCDboOM1ks+bmLyeJs0xt2 i54NW1kt1h65y26x5+hhdospb3+yW8yY/JLNgd1jyu+NrB6Pf71k83i/7yqbR9+WVYwenzfJ BbBGNTDaZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gDd oaRQlphTChQKSCwuVtK3wzQhNMRN1wKmMULXNyQIrsfIAA0krGHM6N26j6XgA3vF7RX32RsY r7J1MXJySAiYSDRtmMQKYYtJXLi3HijOxSEkMJ1RordpIyuE08wkMW3dYbAONgEdif1LfoN1 iAgYS2zu62TpYuTgYBaolri1QB0kLCwQJrHo2H9mEJtFQFXi3fzdYK28Am4Suz6vY4ZYpiCx 4N5bsDingLvEg/nT2UFsIaCaa/8WsU1g5F3AyLCKUTS1ILmgOCk910ivODG3uDQvXS85P3cT IziKnknvYFzVYHGIUYCDUYmHV8BwVqAQa2JZcWXuIUYJDmYlEd7vzUAh3pTEyqrUovz4otKc 1OJDjMlAV01klhJNzgdGeF5JvKGxiZmRpZG5oYWRsTlpwkrivAdbrQOFBNITS1KzU1MLUotg tjBxcEo1MIa/f/f9TdSxiB7TVTf/fdr7+AdTmNLxLfMDHp4+2SOZ+ORig2H91H0GF7j+MrF6 5Lw7NGNzeVTP3PNG//pW+883eelwhtW0YXd0+uEdy9Olv5tn7P+V/vx1b+uZcFuBoxEKixfW c9uH2N5tZvH+ya5eF1h9kTl0hcremLatt6flCiz/ZJJqlazEUpyRaKjFXFScCABVseX75gIA AA== 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 The vb2_poll() does not need to wait next vb_buffer_done() if there is already a buffer in done_list of queue, but current vb2_poll() always waits. So done_list is checked before calling poll_wait(). Signed-off-by: Seung-Woo Kim Acked-by: Marek Szyprowski --- drivers/media/v4l2-core/videobuf2-core.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 7d833ee..e3bdc3b 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -2014,7 +2014,8 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) if (list_empty(&q->queued_list)) return res | POLLERR; - poll_wait(file, &q->done_wq, wait); + if (list_empty(&q->done_list)) + poll_wait(file, &q->done_wq, wait); /* * Take first buffer available for dequeuing.