From patchwork Fri Dec 19 10:36:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Debski X-Patchwork-Id: 5518741 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4B8019F443 for ; Fri, 19 Dec 2014 10:37:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E7AC2012B for ; Fri, 19 Dec 2014 10:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72EC020117 for ; Fri, 19 Dec 2014 10:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752389AbaLSKgv (ORCPT ); Fri, 19 Dec 2014 05:36:51 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:23209 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877AbaLSKgt (ORCPT ); Fri, 19 Dec 2014 05:36:49 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NGT00BW5S5B8410@mailout1.samsung.com> for linux-media@vger.kernel.org; Fri, 19 Dec 2014 19:36:47 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-a0-5493ffbf8939 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 66.1B.09430.FBFF3945; Fri, 19 Dec 2014 19:36:47 +0900 (KST) Received: from AMDC1342.digital.local ([106.116.147.39]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NGT0059NS51V720@mmp2.samsung.com>; Fri, 19 Dec 2014 19:36:47 +0900 (KST) From: Kamil Debski To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, k.debski@samsung.com, hverkuil@xs4all.nl, nicolas.dufresne@collabora.com, p.zabel@pengutronix.de Subject: [PATCH] coda: use VB2_FILEIO_ALLOW_ZERO_BYTESUSED flag Date: Fri, 19 Dec 2014 11:36:27 +0100 Message-id: <1418985387-16580-1-git-send-email-k.debski@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t9jQd39/yeHGMzfom1xavIzJosfry+w WfRs2MpqsfbIXXaLXV/usVncvXeCxYHNY8fdJYwe/X8NPPq2rGL0+LxJzuPU18/sAaxRXDYp qTmZZalF+nYJXBknv51jL3jPVfHwwlm2BsZ+zi5GTg4JAROJST1XmCBsMYkL99azdTFycQgJ TGeU+H3wPJTTwSQxdf1VoCoODjYBTYlV9zxAGkQE5CWe9N4Aq2EWaGCUePf5DBtIQljAXuLo /06wehYBVYlDTzhAwrwCLhIvnt9lAQlLCChIzJlkM4GRewEjwypG0dSC5ILipPRcI73ixNzi 0rx0veT83E2M4LB4Jr2DcVWDxSFGAQ5GJR7ejsLJIUKsiWXFlbmHGCU4mJVEeO//AArxpiRW VqUW5ccXleakFh9ilOZgURLnVbJvCxESSE8sSc1OTS1ILYLJMnFwSjUwFh6VFApisVMqm3ni 7RWOov+FwjesFN02NKwqq1nlnn4g9rDNmzdmnhXp7wsYP+V5lNzSUA8+t9gyd5GyYuO3oxbu mz2jWeblH3NadEVHV+K7MKO30H2nLp806+9rFqQzfvjWIHHxve+Ty/+u9XXNdrZ2m+sQs7Ew g/HhxeM1zWvOFUfGPJ+sxFKckWioxVxUnAgA8mhcNAcCAAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The coda driver interprets a buffer with bytesused equal to 0 as a special case indicating end-of-stream. After vb2: fix bytesused == 0 handling (8a75ffb) patch videobuf2 modified the value of bytesused if it was 0. The VB2_FILEIO_ALLOW_ZERO_BYTESUSED flag was added to videobuf2 to keep backward compatibility. Signed-off-by: Kamil Debski Acked-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 42b4630..6c67e6d 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1491,6 +1491,13 @@ static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq) vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; vq->lock = &ctx->dev->dev_mutex; + /* One of means to indicate end-of-stream for coda is to set the + * bytesused == 0. However by default videobuf2 handles videobuf + * equal to 0 as a special case and changes its value to the size + * of the buffer. Set the VB2_FILEIO_ALLOW_ZERO_BYTESUSED flag, so + * that videobuf2 will keep the value of bytesused intact. + */ + vq->io_flags = VB2_FILEIO_ALLOW_ZERO_BYTESUSED; return vb2_queue_init(vq); }