From patchwork Mon Aug 31 11:58:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tuukka.O Toivonen" X-Patchwork-Id: 44872 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7VC0Gix031716 for ; Mon, 31 Aug 2009 12:00:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751309AbZHaL7T (ORCPT ); Mon, 31 Aug 2009 07:59:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752194AbZHaL7R (ORCPT ); Mon, 31 Aug 2009 07:59:17 -0400 Received: from smtp.nokia.com ([192.100.122.233]:19098 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbZHaL7P (ORCPT ); Mon, 31 Aug 2009 07:59:15 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7VBwneZ019248; Mon, 31 Aug 2009 14:58:50 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 31 Aug 2009 14:59:01 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 31 Aug 2009 14:59:00 +0300 Received: from ouped11921.nmp.nokia.com (ouped11921.nmp.nokia.com [172.23.119.21]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7VBwqaY012092; Mon, 31 Aug 2009 14:58:53 +0300 From: "Tuukka.O Toivonen" Organization: Nokia To: linux-media@vger.kernel.org Subject: [PATCH take 2] V4L: videobuf-core.c VIDIOC_QBUF should return video buffer flags Date: Mon, 31 Aug 2009 14:58:54 +0300 User-Agent: KMail/1.9.10 Cc: sailus@maxwell.research.nokia.com, ext Laurent Pinchart , ext Mauro Carvalho Chehab MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200908311458.54406.tuukka.o.toivonen@nokia.com> X-OriginalArrivalTime: 31 Aug 2009 11:59:00.0955 (UTC) FILETIME=[6DA212B0:01CA2A32] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When user space queues a buffer using VIDIOC_QBUF, the kernel should set flags in struct v4l2_buffer as specified in the V4L2 documentation. --- drivers/media/video/videobuf-core.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index b7b0584..1322056 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c @@ -477,6 +477,7 @@ int videobuf_qbuf(struct videobuf_queue *q, struct videobuf_buffer *buf; enum v4l2_field field; unsigned long flags = 0; + __u32 buffer_flags = b->flags; int retval; MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); @@ -531,6 +532,8 @@ int videobuf_qbuf(struct videobuf_queue *q, "but buffer addr is zero!\n"); goto done; } + buffer_flags |= V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_QUEUED; + buffer_flags &= ~V4L2_BUF_FLAG_DONE; break; case V4L2_MEMORY_USERPTR: if (b->length < buf->bsize) { @@ -541,6 +544,8 @@ int videobuf_qbuf(struct videobuf_queue *q, buf->baddr != b->m.userptr) q->ops->buf_release(q, buf); buf->baddr = b->m.userptr; + buffer_flags |= V4L2_BUF_FLAG_QUEUED; + buffer_flags &= ~(V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE); break; case V4L2_MEMORY_OVERLAY: buf->boff = b->m.offset; @@ -564,6 +569,8 @@ int videobuf_qbuf(struct videobuf_queue *q, q->ops->buf_queue(q, buf); spin_unlock_irqrestore(q->irqlock, flags); } + + b->flags = buffer_flags; dprintk(1, "qbuf: succeded\n"); retval = 0; wake_up_interruptible_sync(&q->wait);