Message ID | 1271843067-23496-1-git-send-email-p.osciak@samsung.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Wed, 21 Apr 2010 09:44:43 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Wed, 21 Apr 2010 06:48:30 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O4WU7-0005bT-N7; Wed, 21 Apr 2010 09:44:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753821Ab0DUJom (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Wed, 21 Apr 2010 05:44:42 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:41255 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753807Ab0DUJol (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 21 Apr 2010 05:44:41 -0400 Received: from eu_spt1 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0L18002YT0EEO8@mailout1.w1.samsung.com> for linux-media@vger.kernel.org; Wed, 21 Apr 2010 10:44:38 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0L1800J5I0EDXN@spt1.w1.samsung.com> for linux-media@vger.kernel.org; Wed, 21 Apr 2010 10:44:37 +0100 (BST) Received: from localhost.localdomain (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 1C42D27004C; Wed, 21 Apr 2010 11:44:05 +0200 (CEST) Date: Wed, 21 Apr 2010 11:44:27 +0200 From: Pawel Osciak <p.osciak@samsung.com> Subject: [PATCH] v4l: videobuf: qbuf now uses relevant v4l2_buffer fields for OUTPUT types To: linux-media@vger.kernel.org Cc: p.osciak@samsung.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com Message-id: <1271843067-23496-1-git-send-email-p.osciak@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.0 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Pawel Osciak
April 21, 2010, 9:44 a.m. UTC
According to the V4L2 specification, applications set bytesused, field and timestamp fields of struct v4l2_buffer when the buffer is intended for output and memory type is MMAP. This adds proper copying of those values to videobuf_buffer so drivers can use them. Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> --- drivers/media/video/videobuf-core.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Comments
Hi Pawel, On Wednesday 21 April 2010 11:44:27 Pawel Osciak wrote: > According to the V4L2 specification, applications set bytesused, field and > timestamp fields of struct v4l2_buffer when the buffer is intended for > output and memory type is MMAP. This adds proper copying of those values > to videobuf_buffer so drivers can use them. Why only for the MMAP memory type ? Don't drivers need the information for USERPTR buffers as well ? > Signed-off-by: Pawel Osciak <p.osciak@samsung.com> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> > --- > 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 63d7043..e573ca7 100644 > --- a/drivers/media/video/videobuf-core.c > +++ b/drivers/media/video/videobuf-core.c > @@ -549,6 +549,13 @@ int videobuf_qbuf(struct videobuf_queue *q, struct > v4l2_buffer *b) "but buffer addr is zero!\n"); > goto done; > } > + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT > + || q->type == V4L2_BUF_TYPE_VBI_OUTPUT > + || q->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { > + buf->size = b->bytesused; > + buf->field = b->field; > + buf->ts = b->timestamp; > + } > break; > case V4L2_MEMORY_USERPTR: > if (b->length < buf->bsize) {
Hi Laurent, >Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: >> According to the V4L2 specification, applications set bytesused, field and >> timestamp fields of struct v4l2_buffer when the buffer is intended for >> output and memory type is MMAP. This adds proper copying of those values >> to videobuf_buffer so drivers can use them. > >Why only for the MMAP memory type ? Don't drivers need the information for >USERPTR buffers as well ? > It is only mentioned for the MMAP memory type: http://linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html#vidioc-qbuf although it would make sense to do this for USERPTR as well. Maybe I am trying too hard to stay 100% faithful to the documentation, I guess it should be corrected as well then? Best regards -- Pawel Osciak Linux Platform Group Samsung Poland R&D Center -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Pawel, On Thursday 22 April 2010 11:24:52 Pawel Osciak wrote: > >Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: > >> According to the V4L2 specification, applications set bytesused, field > >> and timestamp fields of struct v4l2_buffer when the buffer is intended > >> for output and memory type is MMAP. This adds proper copying of those > >> values to videobuf_buffer so drivers can use them. > > > >Why only for the MMAP memory type ? Don't drivers need the information for > >USERPTR buffers as well ? > > It is only mentioned for the MMAP memory type: > http://linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html > #vidioc-qbuf although it would make sense to do this for USERPTR as well. > Maybe I am trying too hard to stay 100% faithful to the documentation, I > guess it should be corrected as well then? This wouldn't be the first time the spec is wrong :-) I'd like other people's opinion on this, but I think we should fix the spec and copy the values for both MMAP and USERPTR.
>Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: >On Thursday 22 April 2010 11:24:52 Pawel Osciak wrote: >> >Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: >> >> According to the V4L2 specification, applications set bytesused, field >> >> and timestamp fields of struct v4l2_buffer when the buffer is intended >> >> for output and memory type is MMAP. This adds proper copying of those >> >> values to videobuf_buffer so drivers can use them. >> > >> >Why only for the MMAP memory type ? Don't drivers need the information for >> >USERPTR buffers as well ? >> >> It is only mentioned for the MMAP memory type: >> http://linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html >> #vidioc-qbuf although it would make sense to do this for USERPTR as well. >> Maybe I am trying too hard to stay 100% faithful to the documentation, I >> guess it should be corrected as well then? > >This wouldn't be the first time the spec is wrong :-) I'd like other people's >opinion on this, but I think we should fix the spec and copy the values for >both MMAP and USERPTR. Yes, same here. Thanks for pointing that up. I really have to stop treating the spec as it was somehow sacred :) Best regards -- Pawel Osciak Linux Platform Group Samsung Poland R&D Center -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index 63d7043..e573ca7 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c @@ -549,6 +549,13 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) "but buffer addr is zero!\n"); goto done; } + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT + || q->type == V4L2_BUF_TYPE_VBI_OUTPUT + || q->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { + buf->size = b->bytesused; + buf->field = b->field; + buf->ts = b->timestamp; + } break; case V4L2_MEMORY_USERPTR: if (b->length < buf->bsize) {