From patchwork Mon Aug 5 17:53:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2838889 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 08A44BF535 for ; Mon, 5 Aug 2013 17:53:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47D1720354 for ; Mon, 5 Aug 2013 17:53:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFBA620358 for ; Mon, 5 Aug 2013 17:53:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400Ab3HERwv (ORCPT ); Mon, 5 Aug 2013 13:52:51 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:53135 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754207Ab3HERwh (ORCPT ); Mon, 5 Aug 2013 13:52:37 -0400 Received: from avalon.ideasonboard.com (cpc8-cmbg15-2-0-cust169.5-4.cable.virginmedia.com [86.30.140.170]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B248B35A67; Mon, 5 Aug 2013 19:52:17 +0200 (CEST) From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: linux-sh@vger.kernel.org, Hans Verkuil , Sakari Ailus , Katsuya MATSUBARA , Sylwester Nawrocki Subject: [PATCH v6 02/10] Documentation: media: Clarify the VIDIOC_CREATE_BUFS format requirements Date: Mon, 5 Aug 2013 19:53:21 +0200 Message-Id: <1375725209-2674-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1375725209-2674-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1375725209-2674-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The VIDIOC_CREATE_BUFS ioctl takes a format argument that must contain a valid format supported by the driver. Clarify the documentation. Signed-off-by: Laurent Pinchart Acked-by: Hans Verkuil --- .../DocBook/media/v4l/vidioc-create-bufs.xml | 41 ++++++++++++++-------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml index cd99436..9b700a5 100644 --- a/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml +++ b/Documentation/DocBook/media/v4l/vidioc-create-bufs.xml @@ -62,18 +62,29 @@ addition to the VIDIOC_REQBUFS ioctl, when a tighter control over buffers is required. This ioctl can be called multiple times to create buffers of different sizes. - To allocate device buffers applications initialize relevant fields of -the v4l2_create_buffers structure. They set the -type field in the -&v4l2-format; structure, embedded in this -structure, to the respective stream or buffer type. -count must be set to the number of required buffers. -memory specifies the required I/O method. The -format field shall typically be filled in using -either the VIDIOC_TRY_FMT or -VIDIOC_G_FMT ioctl(). Additionally, applications can adjust -sizeimage fields to fit their specific needs. The -reserved array must be zeroed. + To allocate the device buffers applications must initialize the +relevant fields of the v4l2_create_buffers structure. +The count field must be set to the number of +requested buffers, the memory field specifies the +requested I/O method and the reserved array must be +zeroed. + + The format field specifies the image format +that the buffers must be able to handle. The application has to fill in this +&v4l2-format;. Usually this will be done using the +VIDIOC_TRY_FMT or VIDIOC_G_FMT ioctl() +to ensure that the requested format is supported by the driver. Unsupported +formats will result in an error. + + The buffers created by this ioctl will have as minimum size the size +defined by the format.pix.sizeimage field. If the +format.pix.sizeimage field is less than the minimum +required for the given format, then sizeimage will be +increased by the driver to that minimum to allocate the buffers. If it is +larger, then the value will be used as-is. The same applies to the +sizeimage field of the +v4l2_plane_pix_format structure in the case of +multiplanar formats. When the ioctl is called with a pointer to this structure the driver will attempt to allocate up to the requested number of buffers and store the @@ -144,9 +155,9 @@ mapped I/O. EINVAL - The buffer type (type field) or the -requested I/O method (memory) is not -supported. + The buffer type (format.type field), +requested I/O method (memory) or format +(format field) is not valid.