From patchwork Fri Sep 28 09:30:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 1517951 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 F09C73FC71 for ; Fri, 28 Sep 2012 09:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757148Ab2I1JbS (ORCPT ); Fri, 28 Sep 2012 05:31:18 -0400 Received: from smtp-vbr19.xs4all.nl ([194.109.24.39]:2472 "EHLO smtp-vbr19.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967Ab2I1JbN (ORCPT ); Fri, 28 Sep 2012 05:31:13 -0400 Received: from alastor.dyndns.org (166.80-203-20.nextgentel.com [80.203.20.166] (may be forged)) (authenticated bits=0) by smtp-vbr19.xs4all.nl (8.13.8/8.13.8) with ESMTP id q8S9UO29037491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 28 Sep 2012 11:30:25 +0200 (CEST) (envelope-from hverkuil@xs4all.nl) Received: from tschai.cisco.com (64-103-25-233.cisco.com [64.103.25.233]) (Authenticated sender: hans) by alastor.dyndns.org (Postfix) with ESMTPSA id 5B6C835C00B9; Fri, 28 Sep 2012 11:30:23 +0200 (CEST) From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Pawel Osciak , Marek Szyprowski , Hans Verkuil Subject: [RFCv2 PATCH 2/4] videobuf2-core: fill in length field for multiplanar buffers. Date: Fri, 28 Sep 2012 11:30:10 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348824612-2857-1-git-send-email-hverkuil@xs4all.nl> References: <1348824612-2857-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <2ffce29d048fbe637273d08abd506d128194d7d9.1348824367.git.hans.verkuil@cisco.com> References: <2ffce29d048fbe637273d08abd506d128194d7d9.1348824367.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 5a132b2..432df11 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 caller has already verified memory and size. */ + b->length = vb->num_planes; memcpy(b->m.planes, vb->v4l2_planes, b->length * sizeof(struct v4l2_plane)); } else {