From patchwork Wed Jul 13 09:39:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 971392 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6D9dVwJ012608 for ; Wed, 13 Jul 2011 09:39:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965217Ab1GMJjZ (ORCPT ); Wed, 13 Jul 2011 05:39:25 -0400 Received: from smtp-vbr5.xs4all.nl ([194.109.24.25]:1727 "EHLO smtp-vbr5.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965211Ab1GMJjW (ORCPT ); Wed, 13 Jul 2011 05:39:22 -0400 Received: from tschai.lan (215.80-203-102.nextgentel.com [80.203.102.215]) (authenticated bits=0) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id p6D9dGwt048541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jul 2011 11:39:19 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Hans Verkuil Subject: [RFCv1 PATCH 4/6] videobuf: only start streaming in poll() if so requested by the poll mask. Date: Wed, 13 Jul 2011 11:39:02 +0200 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: <1310549944-23756-1-git-send-email-hverkuil@xs4all.nl> References: <1310549944-23756-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: References: X-Virus-Scanned: by XS4ALL Virus Scanner Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 13 Jul 2011 09:39:31 +0000 (UTC) From: Hans Verkuil Signed-off-by: Hans Verkuil --- drivers/media/video/videobuf-core.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index de4fa4e..ffdf59c 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c @@ -1129,6 +1129,7 @@ unsigned int videobuf_poll_stream(struct file *file, struct videobuf_queue *q, poll_table *wait) { + unsigned long req_events = poll_requested_events(wait); struct videobuf_buffer *buf = NULL; unsigned int rc = 0; @@ -1137,7 +1138,7 @@ unsigned int videobuf_poll_stream(struct file *file, if (!list_empty(&q->stream)) buf = list_entry(q->stream.next, struct videobuf_buffer, stream); - } else { + } else if (req_events & (POLLIN | POLLRDNORM)) { if (!q->reading) __videobuf_read_start(q); if (!q->reading) {