From patchwork Fri May 25 05:21:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Ha=C5=82asa?= X-Patchwork-Id: 10426347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84EC960327 for ; Fri, 25 May 2018 05:21:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7390729434 for ; Fri, 25 May 2018 05:21:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6519629574; Fri, 25 May 2018 05:21:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B48529434 for ; Fri, 25 May 2018 05:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935556AbeEYFVg (ORCPT ); Fri, 25 May 2018 01:21:36 -0400 Received: from ni.piap.pl ([195.187.100.4]:45500 "EHLO ni.piap.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935179AbeEYFVf (ORCPT ); Fri, 25 May 2018 01:21:35 -0400 Received: from t19.piap.pl (OSB1819.piap.pl [10.0.9.19]) by ni.piap.pl (Postfix) with ESMTP id 70FB8440DCE; Fri, 25 May 2018 07:21:32 +0200 (CEST) From: khalasa@piap.pl (Krzysztof =?utf-8?Q?Ha=C5=82asa?=) To: Steve Longerbeam Cc: linux-media@vger.kernel.org, Philipp Zabel , Tim Harvey Subject: Re: i.MX6 IPU CSI analog video input on Ventana References: <08726c4a-fb60-c37a-75d3-9a0ca164280d@gmail.com> Date: Fri, 25 May 2018 07:21:32 +0200 In-Reply-To: (Steve Longerbeam's message of "Thu, 24 May 2018 13:48:56 -0700") Message-ID: MIME-Version: 1.0 X-KLMS-Rule-ID: 4 X-KLMS-Message-Action: skipped X-KLMS-AntiSpam-Status: not scanned, whitelist X-KLMS-AntiPhishing: not scanned, whitelist X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.721, not scanned, whitelist Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Steve Longerbeam writes: > Sorry I did find a bug. Please try this patch: Ok, your patch fixes the first problem (sets the CSI interlaced mode on input when field = NOE is requested on output). Posting in full since your mail came somehow mangled with UTF-8. > (the removed code was meant to deal with field type at sink pad being > "alternate", which ipu_csi_init_interface() doesn't currently recognize, but > that should be dealt with in IPUv3 driver). I see. > With that you should be able to set pad ipu2_csi1:2 to field type > "none", e.g. > set pipeline to: > > media-ctl -V '"adv7180 2-0020":0[fmt:UYVY2X8 720x480 field:interlaced]' > media-ctl -V '"ipu2_csi1_mux":1[fmt:UYVY2X8 720x480 field:interlaced]' > media-ctl -V '"ipu2_csi1_mux":2[fmt:UYVY2X8 720x480 field:interlaced]' > media-ctl -V '"ipu2_csi1":0[fmt:UYVY2X8 720x480 field:interlaced]' > media-ctl -V '"ipu2_csi1":2[fmt:UYVY2X8 720x480 field:none]' > > With the above patch, capture from ipu1_csi0:2 is fixed for me on > SabreAuto. Right, it also works fine for me on Ventana GW5300 (with ipu_cpmem_skip_odd_chroma_rows() removed as well, of course). > You may also want to try adding a ~500 msec delay after adv7180 power on > as I explained earlier: Ok. In fact I don't have a sync problem even without it, the rolling image always eventually syncs. Maybe I'll investigate the data stream (from ADV7180 to CSI) and see what's on. I't a bit complicated since what I have is just an oscilloscope. --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -629,7 +629,6 @@ static int csi_setup(struct csi_priv *priv) { struct v4l2_mbus_framefmt *infmt, *outfmt; struct v4l2_mbus_config mbus_cfg; - struct v4l2_mbus_framefmt if_fmt; infmt = &priv->format_mbus[CSI_SINK_PAD]; outfmt = &priv->format_mbus[priv->active_output_pad]; @@ -640,20 +639,13 @@ static int csi_setup(struct csi_priv *priv) priv->upstream_ep.bus.mipi_csi2.flags : priv->upstream_ep.bus.parallel.flags; - /* - * we need to pass input frame to CSI interface, but - * with translated field type from output format - */ - if_fmt = *infmt; - if_fmt.field = outfmt->field; - ipu_csi_set_window(priv->csi, &priv->crop); ipu_csi_set_downsize(priv->csi, priv->crop.width == 2 * priv->compose.width, priv->crop.height == 2 * priv->compose.height); - ipu_csi_init_interface(priv->csi, &mbus_cfg, &if_fmt); + ipu_csi_init_interface(priv->csi, &mbus_cfg, infmt); ipu_csi_set_dest(priv->csi, priv->dest);