public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: khalasa@piap.pl (Krzysztof Hałasa)
To: Steve Longerbeam <slongerbeam@gmail.com>
Cc: linux-media@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Tim Harvey <tharvey@gateworks.com>
Subject: Re: i.MX6 IPU CSI analog video input on Ventana
Date: Fri, 25 May 2018 07:21:32 +0200	[thread overview]
Message-ID: <m3d0xkqpib.fsf@t19.piap.pl> (raw)
In-Reply-To: <aad7c874-ee05-ef9b-733c-609b6928fc3c@gmail.com> (Steve Longerbeam's message of "Thu, 24 May 2018 13:48:56 -0700")

Steve Longerbeam <slongerbeam@gmail.com> 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.

--- 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);
 

> (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.
-- 
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

  parent reply	other threads:[~2018-05-25  5:21 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10  8:19 i.MX6 IPU CSI analog video input on Ventana Krzysztof Hałasa
2018-05-10 16:32 ` Steve Longerbeam
2018-05-11  5:37   ` Krzysztof Hałasa
2018-05-11 17:35     ` Steve Longerbeam
2018-05-18 17:28       ` Krzysztof Hałasa
2018-05-18 17:56         ` Tim Harvey
2018-05-21  5:51           ` Krzysztof Hałasa
2018-05-21  8:09         ` Krzysztof Hałasa
2018-05-21 15:55           ` Tim Harvey
2018-05-21 21:25           ` Steve Longerbeam
2018-05-22 10:48             ` Krzysztof Hałasa
2018-05-24 15:56             ` Krzysztof Hałasa
2018-05-24 18:12               ` Steve Longerbeam
2018-05-24 20:48                 ` Steve Longerbeam
2018-05-24 21:33                   ` Steve Longerbeam
2018-05-25  6:34                     ` Philipp Zabel
2018-05-25  5:21                   ` Krzysztof Hałasa [this message]
2018-05-25  6:32                 ` Philipp Zabel
2018-05-25  7:18                   ` Krzysztof Hałasa
2018-05-25 23:39                     ` Steve Longerbeam
2018-05-29  7:26                       ` Krzysztof Hałasa
2018-05-29 14:00                         ` Steve Longerbeam
2018-05-30  8:53                           ` Krzysztof Hałasa
2018-05-30 17:57                             ` Steve Longerbeam
2018-05-30 18:46                               ` Krzysztof Hałasa
2018-05-30 20:56                                 ` Steve Longerbeam
2018-05-31  6:29                                   ` Philipp Zabel
2018-06-01  5:23                                     ` Krzysztof Hałasa
2018-06-02 17:33                                     ` Steve Longerbeam
2018-06-04  8:38                                       ` Philipp Zabel
2018-06-01 10:02                                   ` Krzysztof Hałasa
2018-06-01 13:13                                     ` Philipp Zabel
2018-06-02 17:45                                       ` Steve Longerbeam
2018-06-04  7:33                                         ` Krzysztof Hałasa
2018-06-04  8:47                                         ` Philipp Zabel
2018-06-04  8:58                                           ` Krzysztof Hałasa
2018-10-17 20:38                                             ` Tim Harvey
     [not found]                                               ` <57dfdc0b-5f04-e10a-2ffd-c7ba561fe7ce@gmail.com>
2018-10-17 23:05                                                 ` Tim Harvey
2018-10-17 23:37                                                   ` Steve Longerbeam
2018-10-18 17:56                                                     ` Tim Harvey
2018-10-19 20:06                                                       ` Steve Longerbeam
2018-10-19  9:45                                                 ` Philipp Zabel
2018-06-04  7:06                                       ` Krzysztof Hałasa
2018-05-25 23:21                   ` Steve Longerbeam
2018-06-01 13:52                     ` Philipp Zabel
2018-05-25  7:07                 ` Krzysztof Hałasa
2018-05-22  9:41           ` Franz Melchior
2018-05-11  6:11 ` Franz Melchior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3d0xkqpib.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=slongerbeam@gmail.com \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox