From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from perceval.ideasonboard.com ([95.142.166.194]:39823 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797Ab2FRKIC (ORCPT ); Mon, 18 Jun 2012 06:08:02 -0400 From: Laurent Pinchart To: Hans Verkuil Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Hans de Goede , Andy Walls , Guennadi Liakhovetski , Pawel Osciak , Tomasz Stanislawski , Hans Verkuil Subject: Re: [RFCv1 PATCH 28/32] vivi: use vb2 helper functions. Date: Mon, 18 Jun 2012 12:08:10 +0200 Message-ID: <27919488.Es5OfZrXDC@avalon> In-Reply-To: <47a839710682872826a3da4ef631fccded2ed299.1339321562.git.hans.verkuil@cisco.com> References: <1339323954-1404-1-git-send-email-hverkuil@xs4all.nl> <47a839710682872826a3da4ef631fccded2ed299.1339321562.git.hans.verkuil@cisco.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-media-owner@vger.kernel.org List-ID: Hi Hans, Thanks for the patch. On Sunday 10 June 2012 12:25:50 Hans Verkuil wrote: > From: Hans Verkuil > > Signed-off-by: Hans Verkuil > --- > drivers/media/video/vivi.c | 160 ++++++----------------------------------- > 1 file changed, 21 insertions(+), 139 deletions(-) > > diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c > index 1e4da5e..1e8c4f3 100644 > --- a/drivers/media/video/vivi.c > +++ b/drivers/media/video/vivi.c > @@ -767,7 +767,13 @@ static int queue_setup(struct vb2_queue *vq, const > struct v4l2_format *fmt, struct vivi_dev *dev = vb2_get_drv_priv(vq); > unsigned long size; > > - size = dev->width * dev->height * dev->pixelsize; > + if (fmt) > + size = fmt->fmt.pix.sizeimage; > + else > + size = dev->width * dev->height * dev->pixelsize; > + > + if (size == 0) > + return -EINVAL; If I'm not mistaken, this is a bug fix to properly support CREATE_BUF, right ? If so it should be split to its own patch. > if (0 == *nbuffers) > *nbuffers = 32; -- Regards, Laurent Pinchart