From patchwork Wed Sep 19 14:37:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1477851 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 98CBE3FE65 for ; Wed, 19 Sep 2012 14:38:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753205Ab2ISOi3 (ORCPT ); Wed, 19 Sep 2012 10:38:29 -0400 Received: from smtp-vbr4.xs4all.nl ([194.109.24.24]:3831 "EHLO smtp-vbr4.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397Ab2ISOi1 (ORCPT ); Wed, 19 Sep 2012 10:38:27 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166]) (authenticated bits=0) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8JEbiEl099300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 19 Sep 2012 16:37:44 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.lan (tschai.lan [192.168.1.10]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id D2F6435C0147; Wed, 19 Sep 2012 16:37:42 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Pawel Osciak , Marek Szyprowski , Hans Verkuil Subject: [RFCv1 PATCH 4/6] videobuf2-core: fill in length field for multiplanar buffers. Date: Wed, 19 Sep 2012 16:37:38 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> References: <1348065460-1624-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.git.hans.verkuil@cisco.com> References: <9e4acd70e02bb67e6e7af0c236c69af27108e4fa.1348064901.git.hans.verkuil@cisco.com> 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 From: Hans Verkuil length should be set to num_planes in __fill_v4l2_buffer(). That way the caller knows how many planes there are in the buffer. Signed-off-by: Hans Verkuil --- drivers/media/v4l2-core/videobuf2-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 929cc99..bbfe022 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -348,6 +348,7 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, struct v4l2_buffer *b) * Fill in plane-related data if userspace provided an array * for it. The memory and size is verified above. */ + b->length = q->num_planes; memcpy(b->m.planes, vb->v4l2_planes, b->length * sizeof(struct v4l2_plane)); } else {