Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp137202imu; Tue, 8 Jan 2019 16:19:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN543E4wyM2oZOyFLv/oX4xXPBd2nhB3sjAFWNkSdGXLp5OZJYKOq6LROunynXZn5udXmulY X-Received: by 2002:a63:42c1:: with SMTP id p184mr3420793pga.202.1546993165892; Tue, 08 Jan 2019 16:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546993165; cv=none; d=google.com; s=arc-20160816; b=U3BR8wyEvsaCYKUjJHcHqg5gEWGbXA5ustQM8jnL1frggTtI3IxUg9HoNaeVNA9S3g csIKrUkua55s9Aj4dl2itKIa99LqgSNq0Pt0zfmDBwMcMLdnBEmiWfNYy68pFF0/9tQR 3P2t7hRqNb+if+Gq8LpM6xbJNWg/mCwSPLDWsG4ZWuJR3EckUFRowVUYmbl8NgX2zcPN 4vF3BupSFGR1wv1bcjiusEo2VzUjKJSAMjcY/4T50SmmSi7fTE3Nd32xfc/GP7fJx0MG vYFw6LrIHNWIdvxDu9NvK2/GT2I7ENtH0pQNEBiFiS7tdMaZxNKtmhrtXz3qO0nIa525 MdCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Hz8OoQS0GJ1ohgapnMRdb0o/+ZyITL4nFVXmQPKhgCE=; b=U4lF7MWWbErJfCrq7I98pvM7kMW+d5co/2KanaLvV8K0ajw8LUvfvdF3hLhCdeKUyR BFULyIXQW6ny+g7KE+hX/Hf0eNGD4JP9slsnEHvFg4rgya4Ac5SdRgUBYsapdjj1aDVE Xid/ofdeg6XjXaiazUV0EeHAy6A5lr5Tz0pSdvrflE0H1RCdhIsMibrng3Erm1TBmcJu jSk+gHYhG7NDIe8SHKZ8/+gM4EHQ8WOxwtT0eu/54FHtuys+OTqYZqHUcISUjGUfvdq8 b3YQBKKA3O9WndQbTfbC38WggfBFAKShyIS6wClJ2KGI05wjq+mLjhnwB/itW3N0/WMi kg4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="lZ56gy/0"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si22334480pgv.159.2019.01.08.16.19.10; Tue, 08 Jan 2019 16:19:25 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="lZ56gy/0"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729666AbfAIAQ1 (ORCPT + 99 others); Tue, 8 Jan 2019 19:16:27 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38133 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729607AbfAIAQS (ORCPT ); Tue, 8 Jan 2019 19:16:18 -0500 Received: by mail-pl1-f193.google.com with SMTP id e5so2675881plb.5; Tue, 08 Jan 2019 16:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Hz8OoQS0GJ1ohgapnMRdb0o/+ZyITL4nFVXmQPKhgCE=; b=lZ56gy/0eG++b3w2lbn8cbC0bi6hRZAhC2xiLW9jLwyDfD5YQS8A4V09MmhJLS6NrC THjVGZ1jbs1JFsr19BU7ObH3ly02g8vJF/lJRWw9ja5XC5l5mydj12ZSeoOUH9/Trog9 NY8pcEqfH92lNrHM0+jTFHHbn6kpBZWmL64sPVVwmoWyAkS2h7TAQKG5cX93e+yphVXt jx4vYTpCXhy+fwzQGfPepoPAviSKLwYmhn7HaT3HRrBzLNvtlxAlJljQtdrFSzvoHM+T ffGzYWXecW2TomCi4dPPHVo6jlkWT98ESZH+5enSqzJl0lThroNqz5sD/mcx/C4ohvd4 jfww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hz8OoQS0GJ1ohgapnMRdb0o/+ZyITL4nFVXmQPKhgCE=; b=Hufv/OqFafkQ55uQiDr/OW55JXNgk61EPSj/ONAD859jpncvuDwg0+XP+xoGJ/xyFo UnyAJF3K5tWr1jB3/R/EN9Jcc0oR0H931si/0c3gllPm/XnO2vk/F5tTLC7Pf1YPXdkq +ALMdQ6/IM4YVjSpwSne9/VooKzhEMqIwfhU61tra0XGpT7RT2jh9UyCSFxks1XnIN3o 6JdEk+C8mKPYgRxRXe9DmdJKRZSWcXNcJzQj1z8mEkCw9tq0zO6Hp2GijRipgOfAkM8V K70efcBrVdxbAaPCveHU9HGpR4CmNH4pF2XJi13fo6bfZE65NNIfyM7tum3LmeQHfBZJ qTCw== X-Gm-Message-State: AJcUuken6GxzbtuAh7Nu0M/N9PuF6TlDKJTRD76w2qbp+zhbZgSQg2k7 6gnU7kxZuBEqFC2C70WnQDxVYZC8 X-Received: by 2002:a17:902:2468:: with SMTP id m37mr3868914plg.314.1546992976849; Tue, 08 Jan 2019 16:16:16 -0800 (PST) Received: from majic.sklembedded.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.googlemail.com with ESMTPSA id 134sm83978490pgb.78.2019.01.08.16.16.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Jan 2019 16:16:16 -0800 (PST) From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v6 12/12] media: imx.rst: Update doc to reflect fixes to interlaced capture Date: Tue, 8 Jan 2019 16:15:51 -0800 Message-Id: <20190109001551.16113-13-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190109001551.16113-1-slongerbeam@gmail.com> References: <20190109001551.16113-1-slongerbeam@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Also add an example pipeline for unconverted capture with interweave on SabreAuto. Cleanup some language in various places in the process. Signed-off-by: Steve Longerbeam --- Changes since v4: - Make clear that it is IDMAC channel that does pixel reordering and interweave, not the CSI. Caught by Philipp Zabel. Changes since v3: - none. Changes since v2: - expand on idmac interweave behavior in CSI subdev. - switch second SabreAuto pipeline example to PAL to give both NTSC and PAL examples. - Cleanup some language in various places. --- Documentation/media/v4l-drivers/imx.rst | 103 +++++++++++++++--------- 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/Documentation/media/v4l-drivers/imx.rst b/Documentation/media/v4l-drivers/imx.rst index 6922dde4a82b..9314af00d067 100644 --- a/Documentation/media/v4l-drivers/imx.rst +++ b/Documentation/media/v4l-drivers/imx.rst @@ -24,8 +24,8 @@ memory. Various dedicated DMA channels exist for both video capture and display paths. During transfer, the IDMAC is also capable of vertical image flip, 8x8 block transfer (see IRT description), pixel component re-ordering (for example UYVY to YUYV) within the same colorspace, and -even packed <--> planar conversion. It can also perform a simple -de-interlacing by interleaving even and odd lines during transfer +packed <--> planar conversion. The IDMAC can also perform a simple +de-interlacing by interweaving even and odd lines during transfer (without motion compensation which requires the VDIC). The CSI is the backend capture unit that interfaces directly with @@ -175,15 +175,21 @@ via the SMFC and an IDMAC channel, bypassing IC pre-processing. This source pad is routed to a capture device node, with a node name of the format "ipuX_csiY capture". -Note that since the IDMAC source pad makes use of an IDMAC channel, it -can do pixel reordering within the same colorspace. For example, the -sink pad can take UYVY2X8, but the IDMAC source pad can output YUYV2X8. -If the sink pad is receiving YUV, the output at the capture device can -also be converted to a planar YUV format such as YUV420. - -It will also perform simple de-interlace without motion compensation, -which is activated if the sink pad's field type is an interlaced type, -and the IDMAC source pad field type is set to none. +Note that since the IDMAC source pad makes use of an IDMAC channel, +pixel reordering within the same colorspace can be carried out by the +IDMAC channel. For example, if the CSI sink pad is receiving in UYVY +order, the capture device linked to the IDMAC source pad can capture +in YUYV order. Also, if the CSI sink pad is receiving a packed YUV +format, the capture device can capture a planar YUV format such as +YUV420. + +The IDMAC channel at the IDMAC source pad also supports simple +interweave without motion compensation, which is activated if the source +pad's field type is sequential top-bottom or bottom-top, and the +requested capture interface field type is set to interlaced (t-b, b-t, +or unqualified interlaced). The capture interface will enforce the same +field order as the source pad field order (interlaced-bt if source pad +is seq-bt, interlaced-tb if source pad is seq-tb). This subdev can generate the following event when enabling the second IDMAC source pad: @@ -325,14 +331,14 @@ ipuX_vdic The VDIC carries out motion compensated de-interlacing, with three motion compensation modes: low, medium, and high motion. The mode is -specified with the menu control V4L2_CID_DEINTERLACING_MODE. It has -two sink pads and a single source pad. +specified with the menu control V4L2_CID_DEINTERLACING_MODE. The VDIC +has two sink pads and a single source pad. The direct sink pad receives from an ipuX_csiY direct pad. With this link the VDIC can only operate in high motion mode. When the IDMAC sink pad is activated, it receives from an output -or mem2mem device node. With this pipeline, it can also operate +or mem2mem device node. With this pipeline, the VDIC can also operate in low and medium modes, because these modes require receiving frames from memory buffers. Note that an output or mem2mem device is not implemented yet, so this sink pad currently has no links. @@ -345,8 +351,8 @@ ipuX_ic_prp This is the IC pre-processing entity. It acts as a router, routing data from its sink pad to one or both of its source pads. -It has a single sink pad. The sink pad can receive from the ipuX_csiY -direct pad, or from ipuX_vdic. +This entity has a single sink pad. The sink pad can receive from the +ipuX_csiY direct pad, or from ipuX_vdic. This entity has two source pads. One source pad routes to the pre-process encode task entity (ipuX_ic_prpenc), the other to the @@ -369,8 +375,8 @@ color-space conversion, resizing (downscaling and upscaling), horizontal and vertical flip, and 90/270 degree rotation. Flip and rotation are provided via standard V4L2 controls. -Like the ipuX_csiY IDMAC source, it can also perform simple de-interlace -without motion compensation, and pixel reordering. +Like the ipuX_csiY IDMAC source, this entity also supports simple +de-interlace without motion compensation, and pixel reordering. ipuX_ic_prpvf ------------- @@ -380,18 +386,18 @@ pad from ipuX_ic_prp, and a single source pad. The source pad is routed to a capture device node, with a node name of the format "ipuX_ic_prpvf capture". -It is identical in operation to ipuX_ic_prpenc, with the same resizing -and CSC operations and flip/rotation controls. It will receive and -process de-interlaced frames from the ipuX_vdic if ipuX_ic_prp is +This entity is identical in operation to ipuX_ic_prpenc, with the same +resizing and CSC operations and flip/rotation controls. It will receive +and process de-interlaced frames from the ipuX_vdic if ipuX_ic_prp is receiving from ipuX_vdic. -Like the ipuX_csiY IDMAC source, it can perform simple de-interlace -without motion compensation. However, note that if the ipuX_vdic is -included in the pipeline (ipuX_ic_prp is receiving from ipuX_vdic), -it's not possible to use simple de-interlace in ipuX_ic_prpvf, since -the ipuX_vdic has already carried out de-interlacing (with motion -compensation) and therefore the field type output from ipuX_ic_prp can -only be none. +Like the ipuX_csiY IDMAC source, this entity supports simple +interweaving without motion compensation. However, note that if the +ipuX_vdic is included in the pipeline (ipuX_ic_prp is receiving from +ipuX_vdic), it's not possible to use interweave in ipuX_ic_prpvf, +since the ipuX_vdic has already carried out de-interlacing (with +motion compensation) and therefore the field type output from +ipuX_vdic can only be none (progressive). Capture Pipelines ----------------- @@ -516,10 +522,33 @@ On the SabreAuto, an on-board ADV7180 SD decoder is connected to the parallel bus input on the internal video mux to IPU1 CSI0. The following example configures a pipeline to capture from the ADV7180 -video decoder, assuming NTSC 720x480 input signals, with Motion -Compensated de-interlacing. Pad field types assume the adv7180 outputs -"interlaced". $outputfmt can be any format supported by the ipu1_ic_prpvf -entity at its output pad: +video decoder, assuming NTSC 720x480 input signals, using simple +interweave (unconverted and without motion compensation). The adv7180 +must output sequential or alternating fields (field type 'seq-bt' for +NTSC, or 'alternate'): + +.. code-block:: none + + # Setup links + media-ctl -l "'adv7180 3-0021':0 -> 'ipu1_csi0_mux':1[1]" + media-ctl -l "'ipu1_csi0_mux':2 -> 'ipu1_csi0':0[1]" + media-ctl -l "'ipu1_csi0':2 -> 'ipu1_csi0 capture':0[1]" + # Configure pads + media-ctl -V "'adv7180 3-0021':0 [fmt:UYVY2X8/720x480 field:seq-bt]" + media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/720x480]" + media-ctl -V "'ipu1_csi0':2 [fmt:AYUV32/720x480]" + # Configure "ipu1_csi0 capture" interface (assumed at /dev/video4) + v4l2-ctl -d4 --set-fmt-video=field=interlaced_bt + +Streaming can then begin on /dev/video4. The v4l2-ctl tool can also be +used to select any supported YUV pixelformat on /dev/video4. + +This example configures a pipeline to capture from the ADV7180 +video decoder, assuming PAL 720x576 input signals, with Motion +Compensated de-interlacing. The adv7180 must output sequential or +alternating fields (field type 'seq-tb' for PAL, or 'alternate'). +$outputfmt can be any format supported by the ipu1_ic_prpvf entity +at its output pad: .. code-block:: none @@ -531,11 +560,11 @@ entity at its output pad: media-ctl -l "'ipu1_ic_prp':2 -> 'ipu1_ic_prpvf':0[1]" media-ctl -l "'ipu1_ic_prpvf':1 -> 'ipu1_ic_prpvf capture':0[1]" # Configure pads - media-ctl -V "'adv7180 3-0021':0 [fmt:UYVY2X8/720x480]" - media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/720x480 field:interlaced]" - media-ctl -V "'ipu1_csi0':1 [fmt:AYUV32/720x480 field:interlaced]" - media-ctl -V "'ipu1_vdic':2 [fmt:AYUV32/720x480 field:none]" - media-ctl -V "'ipu1_ic_prp':2 [fmt:AYUV32/720x480 field:none]" + media-ctl -V "'adv7180 3-0021':0 [fmt:UYVY2X8/720x576 field:seq-tb]" + media-ctl -V "'ipu1_csi0_mux':2 [fmt:UYVY2X8/720x576]" + media-ctl -V "'ipu1_csi0':1 [fmt:AYUV32/720x576]" + media-ctl -V "'ipu1_vdic':2 [fmt:AYUV32/720x576 field:none]" + media-ctl -V "'ipu1_ic_prp':2 [fmt:AYUV32/720x576 field:none]" media-ctl -V "'ipu1_ic_prpvf':1 [fmt:$outputfmt field:none]" Streaming can then begin on the capture device node at -- 2.17.1