From patchwork Mon Apr 1 06:40:46 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: 2369371 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E7E3FDFB7B for ; Mon, 1 Apr 2013 06:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875Ab3DAGko (ORCPT ); Mon, 1 Apr 2013 02:40:44 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:42478 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794Ab3DAGkm (ORCPT ); Mon, 1 Apr 2013 02:40:42 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKK0011OD7O3JO0@mailout2.samsung.com> for linux-media@vger.kernel.org; Mon, 01 Apr 2013 15:40:41 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.43]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id E2.7E.07735.8EB29515; Mon, 01 Apr 2013 15:40:40 +0900 (KST) X-AuditID: cbfee68e-b7f946d000001e37-cd-51592be84fd3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 42.DD.17838.8EB29515; Mon, 01 Apr 2013 15:40:40 +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 <0MKK009SND7R8G00@mmp2.samsung.com>; Mon, 01 Apr 2013 15:40:40 +0900 (KST) From: Seung-Woo Kim To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, m.szyprowski@samsung.com, hans.verkuil@cisco.com, pawel@osciak.com, kyungmin.park@samsung.com, sw0312.kim@samsung.com Subject: [RFC][PATCH 1/2] media: vb2: return for polling if a buffer is available Date: Mon, 01 Apr 2013 15:40:46 +0900 Message-id: <1364798447-32224-2-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1364798447-32224-1-git-send-email-sw0312.kim@samsung.com> References: <1364798447-32224-1-git-send-email-sw0312.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsVy+t8zbd0X2pGBBsvPWVks+bmLyeJs0xt2 i54NW1kt1h65y26x5+hhdospb3+yW8yY/JLNgd1jyu+NrB6Pf71k83i/7yqbR9+WVYwenzfJ BbBGcdmkpOZklqUW6dslcGX8/9/HXrCDvWLV219MDYyL2boYOTkkBEwk9vzezg5hi0lcuLce KM7FISSwjFGic2cXI0zRkc7NjBCJ6YwSs19fZodwmpkkTq39wwJSxSagI7F/yW9WEFtEQF7i Se8NsFHMAv2MEt2nLzGBJIQFgiWeH9sGVsQioCpxY/VvoLEcHLwCbhKdn/whtilILLj3Fuw8 TgF3ia9dp8GuEAIqaf2xiwVkpoTAPHaJiztnMUHMEZD4NvkQC8gcCQFZiU0HmCHmSEocXHGD ZQKj8AJGhlWMoqkFyQXFSelFRnrFibnFpXnpesn5uZsYIYHet4Px5gHrQ4zJQOMmMkuJJucD IyWvJN7Q2MzIwtTE1NjI3NKMNGElcV61FutAIYH0xJLU7NTUgtSi+KLSnNTiQ4xMHJxSDYw2 C4xl5ijY3bw9l9Omfj0vY3LD99ePJod+1Pbwfd7Ysf+jXvrJrg0fTncc2/MxKyWpduaTQOOy 0xGxvWd9HnEd4lm2Il6g3mBB0o4m7W8RZqsl7NQXrMmR3L7vT4TKC576vFSPhclxCjNWp9vs O7L/5hPv0zsjjh9eWRh+sDbRau3MUNUt874rsRRnJBpqMRcVJwIAuuP59YoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsVy+t9jQd0X2pGBBl9mm1os+bmLyeJs0xt2 i54NW1kt1h65y26x5+hhdospb3+yW8yY/JLNgd1jyu+NrB6Pf71k83i/7yqbR9+WVYwenzfJ BbBGNTDaZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gDd oaRQlphTChQKSCwuVtK3wzQhNMRN1wKmMULXNyQIrsfIAA0krGPM+P+/j71gB3vFqre/mBoY F7N1MXJySAiYSBzp3MwIYYtJXLi3HijOxSEkMJ1RYvbry+wQTjOTxKm1f1hAqtgEdCT2L/nN CmKLCMhLPOm9AdbBLNDPKNF9+hITSEJYIFji+bFtYEUsAqoSN1b/BlrBwcEr4CbR+ckfYpuC xIJ7b8Gu4BRwl/jadRrsCiGgktYfu1gmMPIuYGRYxSiaWpBcUJyUnmuoV5yYW1yal66XnJ+7 iREcR8+kdjCubLA4xCjAwajEwxtxISJQiDWxrLgy9xCjBAezkgivzzegEG9KYmVValF+fFFp TmrxIcZkoKMmMkuJJucDYzyvJN7Q2MTMyNLIzNjE3NiYNGElcd4DrdaBQgLpiSWp2ampBalF MFuYODilGhi9vZ/kaCWYhFvbfp2+4b3+vb/WDIHzm1yfL7x1fUXA7RkiKgdPSL18uVU+I2HK u8LCowsT36QcXPFzxgbNmWJCa5cbRzXuf/J928yI9ncnI+/d+qIobXbR4E3Ykd4L0fzzGVIf XZmou3Rvzoaf1c4NgUZaFs7tussnsnfmhSoqzej5IXtf8q6pEktxRqKhFnNRcSIAeA7WIecC AAA= 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 db1235d..e941d2b 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1996,7 +1996,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.