From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp-68.nebula.fi ([83.145.220.68]:45041 "EHLO smtp-68.nebula.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753006Ab1HQMNV (ORCPT ); Wed, 17 Aug 2011 08:13:21 -0400 Date: Wed, 17 Aug 2011 15:13:16 +0300 From: Sakari Ailus To: Guennadi Liakhovetski Cc: Linux Media Mailing List , Hans Verkuil , Pawel Osciak , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab Subject: Re: [PATCH 1/6 v4] V4L: add two new ioctl()s for multi-size videobuffer management Message-ID: <20110817121316.GJ7436@valkosipuli.localdomain> References: <4E3D8B03.3090601@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: On Wed, Aug 17, 2011 at 10:41:51AM +0200, Guennadi Liakhovetski wrote: > On Sat, 6 Aug 2011, Sakari Ailus wrote: > > > Guennadi Liakhovetski wrote: > > > A possibility to preallocate and initialise buffers of different sizes > > > in V4L2 is required for an efficient implementation of asnapshot mode. > > > This patch adds two new ioctl()s: VIDIOC_CREATE_BUFS and > > > VIDIOC_PREPARE_BUF and defines respective data structures. > > > > > > Signed-off-by: Guennadi Liakhovetski > > > --- > > > > Hi Guennadi, > > [snip] > > > > + When the I/O method is not supported the ioctl > > > +returns an &EINVAL;. > > > + > > > + > > > + struct <structname>v4l2_create_buffers</structname> > > > + > > > + &cs-str; > > > + > > > + > > > + __u32 > > > + index > > > + The starting buffer index, returned by the driver. > > > + > > > + > > > + __u32 > > > + count > > > + The number of buffers requested or granted. > > > + > > > + > > > + __u32 > > > + type > > > + V4L2 buffer type: one of V4L2_BUF_TYPE_* > > > +values. > > > > &v4l2-buf-type; > > > > here? > > No idea and I don't care all that much, tbh. I certainly copy-pasted those > constructs from other documents, and yes, they are inconsistent across > v4l: some use my version, some yours, others . I'm happy > with either or none of those. Just tell me _something_, that's > approapriate. Links are being used in other parts of V4L2 documentation. I think PREPARE_BUF documentation should use them, too, rather than duplicating parts of definitions. > > > > > + > > > + > > > + __u32 > > > + memory > > > + Applications set this field to > > > +V4L2_MEMORY_MMAP or > > > +V4L2_MEMORY_USERPTR. > > > > &v4l2-memory; > > [snip] > > > > + Applications can optionally call the > > > +VIDIOC_PREPARE_BUF ioctl to pass ownership of the buffer > > > +to the driver before actually enqueuing it, using the > > > +VIDIOC_QBUF ioctl, and to prepare it for future I/O. > > > > s/VIDIOC_QBUF/&VIDIOC_QBUF;/ > > *shrug* > > > > > +Such preparations may include cache invalidation or cleaning. Performing them > > > +in advance saves time during the actual I/O. In case such cache operations are > > > +not required, the application can use one of > > > +V4L2_BUF_FLAG_NO_CACHE_INVALIDATE and > > > +V4L2_BUF_FLAG_NO_CACHE_CLEAN flags to skip the respective > > > +step. > > > + > > > + The v4l2_buffer structure is > > > > s/v4l2_buffer/&v4l2-buffer;/ > > "structname" seems to be more precise, but well... It's precise but precision isn't everything: giving the user a link to the definition of e.g. v4l2_buffer is more useful than forcing him or her to look for it elsewhere in the documentation. These are small issues but the usability of the documentation counts a lot. Regards, -- Sakari Ailus sakari.ailus@iki.fi