Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp639545ybi; Fri, 14 Jun 2019 00:31:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiJZFx+R7DYyljbPLMPkkFQgxOU3SEbUkhp9QInpRNwsbYguNYa0tByuXcwGxFutvSnfEV X-Received: by 2002:aa7:914e:: with SMTP id 14mr45798048pfi.136.1560497482399; Fri, 14 Jun 2019 00:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560497482; cv=none; d=google.com; s=arc-20160816; b=vBl6ElFnaaiiLmN4ik2iJyQrMa3lzaOlbH3yycXwkKqhieCUZE7futp4fEw5HhPCos 11PtwUN7ReLTS25RI6N/xC4OLRnr63JNK2FrPG7IaN3LBe8x8N+bdYCIlgy9gBks2CGS MY+tYq3XIXEtgM1KWOgnVdXyOwVPSrMCPBQadFokdgbjgYAwcs8PY1s3LxkbcCqdsFds vdRysBzWeM5IcnKmouH+3H51oo33uAW9YqpM1JEl3it/TRS389c49uzKXUcV4qQ1IKJ5 XwxPxH4JvHm4qXegmK2q8yU6VlJRV/00AH0h9MHvfFtG7M+yp+Z6sn2oo8BJQoVgyeG0 cgmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HDVJelm6/YjDlftKQ5jXxNVWxBh6efCzyoAaOvEp1GU=; b=yT0rkanyhqoJSrBKiLhR7hKVIEHx0K/qn7VKipKHMFPhyKc/wAjPXtb6GbKHx+PPc4 uTn9DwDXHn6lvLSmyMR5JAJlKcU8r75wLrK+dwFhRvu3ys2FkcU3nxYAIrYcLehrsliW mkWSZgTvul+7rSUe3cOZf+3OSJqVOBvJqSYHPN3/3RCKuxpw860LWvijEj+e0pgPx9ln AX6CaYrlt5B8UM367JQTk+0fiVBrTL0SRS2qCgOT44XFEJ+pgKIE8FmjIhxnK2LfCbqA nN94hKNnidw5v/pyr2/AAr5IRTnrv51nlFdJ/f0HGTcBSkQq8zi0VUohiArCebF5okeS BZeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v97si1577965pjb.23.2019.06.14.00.31.04; Fri, 14 Jun 2019 00:31:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbfFNHbA (ORCPT + 99 others); Fri, 14 Jun 2019 03:31:00 -0400 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:50955 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbfFNHbA (ORCPT ); Fri, 14 Jun 2019 03:31:00 -0400 Received: from [192.168.2.10] ([46.9.252.75]) by smtp-cloud7.xs4all.net with ESMTPA id bgflhW4t15qKabgfohKiUw; Fri, 14 Jun 2019 09:30:57 +0200 Subject: Re: [PATCH 4/4] media: docs: create vimc documentation To: =?UTF-8?Q?Andr=c3=a9_Almeida?= , linux-media@vger.kernel.org Cc: mchehab@kernel.org, helen.koike@collabora.com, kernel@collabora.com, lkcamp@lists.libreplanetbr.org, linux-kernel@vger.kernel.org References: <20190613150616.19336-1-andrealmeid@collabora.com> <20190613150616.19336-5-andrealmeid@collabora.com> From: Hans Verkuil Message-ID: <4359daf5-4a0c-64b4-46ad-75eba4e9016f@xs4all.nl> Date: Fri, 14 Jun 2019 09:30:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190613150616.19336-5-andrealmeid@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfJHfANkmbWcf/XPPcs5gIJktZc8rJJNzs+iu5+Ag9RH0QrsKy78MhinbGsEJNMrAqPFutGUCMdTPl4FshpPeAPTTgweB2Nku/YMWr4tTh6miecyqjUYy 2LsEXIayRo73USnLiEgcCZmDE/qx16vNsaicmdTaiE13FaSHJOY5ZkF6v9De8n6CjCdRVO6ve3v7XFKgLFld8DUHdq9ZHzG2A+Xr7lGb+zseOnQr/bFEnxbG P4kI1r8Mt7YO4HbNVe2ICSBpOFX0KVQ5zZX2JtPARxhBTH50DwjMvYZ1luoL77dWMm05s/q/hYbQIP81oFc6m+NswRdwtQIPyAf6RuaBoos7dNXXwEpohYlX YmiLF/mUcQxWC1ORqkdQUvNk70FPBjajvV/hS/D6bcB87MCxbbU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi André, Thanks for working one this, very nice to have this documentation. Some comments below: On 6/13/19 5:06 PM, André Almeida wrote: > Create vimc documentation file to explain it basics features, it's > topology, how to configure it and to document vimc's subdevices. > > Signed-off-by: André Almeida > Suggested-by: Helen Koike > --- > Documentation/media/v4l-drivers/index.rst | 1 + > Documentation/media/v4l-drivers/vimc.dot | 22 +++++ > Documentation/media/v4l-drivers/vimc.rst | 98 +++++++++++++++++++++++ > 3 files changed, 121 insertions(+) > create mode 100644 Documentation/media/v4l-drivers/vimc.dot > create mode 100644 Documentation/media/v4l-drivers/vimc.rst > > diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst > index 33a055907258..c4c78a28654c 100644 > --- a/Documentation/media/v4l-drivers/index.rst > +++ b/Documentation/media/v4l-drivers/index.rst > @@ -64,5 +64,6 @@ For more details see the file COPYING in the source distribution of Linux. > si476x > soc-camera > uvcvideo > + vimc > vivid > zr364xx > diff --git a/Documentation/media/v4l-drivers/vimc.dot b/Documentation/media/v4l-drivers/vimc.dot > new file mode 100644 > index 000000000000..57863a13fa39 > --- /dev/null > +++ b/Documentation/media/v4l-drivers/vimc.dot > @@ -0,0 +1,22 @@ > +# SPDX-License-Identifier: GPL-2.0 > + > +digraph board { > + rankdir=TB > + n00000001 [label="{{} | Sensor A\n/dev/v4l-subdev0 | { 0}}", shape=Mrecord, style=filled, fillcolor=green] > + n00000001:port0 -> n00000005:port0 [style=bold] > + n00000001:port0 -> n0000000b [style=bold] > + n00000003 [label="{{} | Sensor B\n/dev/v4l-subdev1 | { 0}}", shape=Mrecord, style=filled, fillcolor=green] > + n00000003:port0 -> n00000008:port0 [style=bold] > + n00000003:port0 -> n0000000f [style=bold] > + n00000005 [label="{{ 0} | Debayer A\n/dev/v4l-subdev2 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] > + n00000005:port1 -> n00000017:port0 > + n00000008 [label="{{ 0} | Debayer B\n/dev/v4l-subdev3 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] > + n00000008:port1 -> n00000017:port0 [style=dashed] > + n0000000b [label="Raw Capture 0\n/dev/video0", shape=box, style=filled, fillcolor=yellow] > + n0000000f [label="Raw Capture 1\n/dev/video1", shape=box, style=filled, fillcolor=yellow] > + n00000013 [label="RGB/YUV Input\n/dev/video2", shape=box, style=filled, fillcolor=yellow] > + n00000013 -> n00000017:port0 [style=dashed] > + n00000017 [label="{{ 0} | Scaler\n/dev/v4l-subdev4 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] > + n00000017:port1 -> n0000001a [style=bold] > + n0000001a [label="RGB/YUV Capture\n/dev/video3", shape=box, style=filled, fillcolor=yellow] > +} > diff --git a/Documentation/media/v4l-drivers/vimc.rst b/Documentation/media/v4l-drivers/vimc.rst > new file mode 100644 > index 000000000000..bd98c55a0025 > --- /dev/null > +++ b/Documentation/media/v4l-drivers/vimc.rst > @@ -0,0 +1,98 @@ > +.. SPDX-License-Identifier: GPL-2.0 > + > +The Virtual Media Controller Driver (vimc) > +========================================== > + > +The Vimc driver emulates the V4L2 API and the Media API as well. Its goal is to Vimc -> vimc It doesn't emulate these APIs, it emulates complex video hardware using these APIs. > +emulate complex devices and topologies. In the actual state, it has a capture Drop 'In the actual state, '. > +device and three subdevices: sensor, debayer and scaler. > + > +Topology > +-------- > + > +The topology is hardcoded, although you could modify it on vimc-core and on -> in > +recompile the driver to achieve your own topology. This is the default topology: > + > +.. _vimc_topology_graph: > + > +.. kernel-figure:: vimc.dot > + :alt: vimc.dot > + :align: center > + > + Media pipeline graph on Vimc > + > +Configuring the topology > +~~~~~~~~~~~~~~~~~~~~~~~~ > + > +Each subdevice will come with its default configuration (pixelformat, height, > +width, ...). One needs to configure the topology in order to match the > +configuration on each linked subdevice to stream frames through the pipeline. > +If the configuration doesn't match, the stream will fail. The ``v4l2-utils`` > +is a bundle of user-space applications, that comes with ``media-ctl`` and > +``v4l2-clt`` that can be used in combination to configure. This sequence of v4l2-clt -> v4l2-ctl in combination to configure -> to configure the vimc configuration. > +commands fits for the default topology: > + > +.. code-block:: bash > + > + media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]' > + media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]' > + media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]' > + media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]' > + v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440 > + v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81 > + v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81 > + > +Subdevices > +---------- > + > +Subdevices define the behavior of an entity in the topology. Depending on the > +subdevice, the entity can have multiple pads of type source or sink. > + > +vimc-sensor: > + Generates images in several formats using video test pattern generator. > + Exposes: > + > + * 1 Pad source > + > +vimc-debayer: > + Transforms images in bayer format into a non-bayer format. > + Exposes: > + > + * 1 Pad sink > + * 1 Pad source > + > +vimc-scaler: > + Multiplies the size of the image by 9 (this value can be configured, > + see at `Modules options`_). It's a bit ambiguous: I assume you mean that the images is scaled up by a factor of 3? So 640x480 becomes 1920x1440? > + Exposes: > + > + * 1 Pad sink > + * 1 Pad source > + > +vimc-capture: > + Exposes node /dev/videoX to allow userspace to capture the stream. > + Exposes: > + > + * 1 Pad sink > + * 1 Pad source > + > +Modules options Modules -> Module > +--------------- > + > +Vimc has a few module parameters to configure the driver. You should pass > +those arguments to each subdevice, not for the Vimc module. For example:: for the -> to the > + > + vimc_subvice.param=value subvice -> subdevice > + > +* ``vimc_scaler.sca_mult=`` > + > + Image size multiplier factor to be used to multiply both width and > + height, so the image size will be ``sca_mult^2`` bigger than the > + original one. Currently, only supports scaling up (the default value > + is 3). > + > +* ``vimc_debayer.deb_mean_win_size=`` > + > + Window size to calculate the mean. Note: the window size needs to be an > + odd number, as the main pixel stays in the center of the window, > + otherwise the next odd number is considered (the default value is 3). > Regards, Hans