Message ID | 1377532029-12777-1-git-send-email-s.nawrocki@samsung.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Sylwester Nawrocki |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1VDz0r-0003Yd-Qm; Mon, 26 Aug 2013 17:47:29 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1VDz0p-0004uC-5V; Mon, 26 Aug 2013 17:47:29 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492Ab3HZPrY (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 26 Aug 2013 11:47:24 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:23814 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391Ab3HZPrX (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 26 Aug 2013 11:47:23 -0400 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 <0MS5009TAAIXBQ20@mailout1.samsung.com> for linux-media@vger.kernel.org; Tue, 27 Aug 2013 00:47:21 +0900 (KST) X-AuditID: cbfee61b-b7f776d0000016c8-03-521b78899798 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 97.D4.05832.9887B125; Tue, 27 Aug 2013 00:47:21 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MS5007BLAINCLD0@mmp2.samsung.com>; Tue, 27 Aug 2013 00:47:21 +0900 (KST) From: Sylwester Nawrocki <s.nawrocki@samsung.com> To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, pawel@osciak.com, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, m.chehab@samsung.com, Sylwester Nawrocki <s.nawrocki@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com> Subject: [PATCH] vb2: Allow queuing OUTPUT buffers with zeroed 'bytesused' Date: Mon, 26 Aug 2013 17:47:09 +0200 Message-id: <1377532029-12777-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgluLIzCtJLcpLzFFi42I5/e+xoG5nhXSQwcEjGhZLfu5isjjb9Ibd onPiEnaLng1bWS0urpO3WHvkLrvFlLc/2S0Ov2lndeDwmPJ7I6vH7I6ZrB6Pf71k8+jbsorR 4/MmuQDWKC6blNSczLLUIn27BK6Mlbd/sBQs4azYeu0CUwPjY/YuRk4OCQETiV+fLrBA2GIS F+6tZ+ti5OIQEpjOKLFx4x92CKeDSaLt3T02kCo2AUOJ3qN9jCC2iIC8xJPeG2AdzAJ3GSVO f9gINlZYwEvi37p2VhCbRUBV4vyfw2BxXgE3iWsffgPFOYDWKUjMmWQzgZF7ASPDKkbR1ILk guKk9FwjveLE3OLSvHS95PzcTYzgcHkmvYNxVYPFIUYBDkYlHt4ANukgIdbEsuLK3EOMEhzM SiK8HKlAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwHW60DhQTSE0tSs1NTC1KLYLJMHJxSDYzL HvWZsi7fdE1zp8RT1Xuda9jyNx+bm9Np7vLpU5J+QtizU1s2OW7738e/Vv98282POrvaKz7c fBZtem+T0StxZ7GtfHsjJ3sLOjVszbr/IPw/R+LT2omHBQ/FLv68R3Lm8xPPjmkdSn8SXG0T sW7S0laOK1Ir1jBpz+g7tTm9/OzrCafsG6z/KLEUZyQaajEXFScCAMUV3G4TAgAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.8.26.143028 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Sylwester Nawrocki
Aug. 26, 2013, 3:47 p.m. UTC
Modify the bytesused/data_offset check to not fail if both bytesused and data_offset is set to 0. This should minimize possible issues in existing applications which worked before we enforced the plane lengths for output buffers checks introduced in commit 8023ed09cb278004a2 "videobuf2-core: Verify planes lengths for output buffers" Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> --- drivers/media/v4l2-core/videobuf2-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Comments
Hi Sylwester, Thank you for the patch. On Monday 26 August 2013 17:47:09 Sylwester Nawrocki wrote: > Modify the bytesused/data_offset check to not fail if both bytesused > and data_offset is set to 0. This should minimize possible issues in > existing applications which worked before we enforced the plane lengths > for output buffers checks introduced in commit 8023ed09cb278004a2 > "videobuf2-core: Verify planes lengths for output buffers" > > Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > drivers/media/v4l2-core/videobuf2-core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c > b/drivers/media/v4l2-core/videobuf2-core.c index 594c75e..de0e87f 100644 > --- a/drivers/media/v4l2-core/videobuf2-core.c > +++ b/drivers/media/v4l2-core/videobuf2-core.c > @@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const > struct v4l2_buffer *b) > > if (b->m.planes[plane].bytesused > length) > return -EINVAL; > - if (b->m.planes[plane].data_offset >= > + > + if (b->m.planes[plane].data_offset > 0 && > + b->m.planes[plane].data_offset >= > b->m.planes[plane].bytesused) > return -EINVAL; > }
Hello, On 8/26/2013 5:47 PM, Sylwester Nawrocki wrote: > Modify the bytesused/data_offset check to not fail if both bytesused > and data_offset is set to 0. This should minimize possible issues in > existing applications which worked before we enforced the plane lengths > for output buffers checks introduced in commit 8023ed09cb278004a2 > "videobuf2-core: Verify planes lengths for output buffers" > > Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> > --- > drivers/media/v4l2-core/videobuf2-core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c > index 594c75e..de0e87f 100644 > --- a/drivers/media/v4l2-core/videobuf2-core.c > +++ b/drivers/media/v4l2-core/videobuf2-core.c > @@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) > > if (b->m.planes[plane].bytesused > length) > return -EINVAL; > - if (b->m.planes[plane].data_offset >= > + > + if (b->m.planes[plane].data_offset > 0 && > + b->m.planes[plane].data_offset >= > b->m.planes[plane].bytesused) > return -EINVAL; > } Best regards
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 594c75e..de0e87f 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) if (b->m.planes[plane].bytesused > length) return -EINVAL; - if (b->m.planes[plane].data_offset >= + + if (b->m.planes[plane].data_offset > 0 && + b->m.planes[plane].data_offset >= b->m.planes[plane].bytesused) return -EINVAL; }