All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rui Miguel Silva" <rui.silva@linaro.org>
To: "Fabio Estevam" <festevam@gmail.com>, "Jacopo Mondi" <jacopo@jmondi.org>
Cc: "Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"linux-media" <linux-media@vger.kernel.org>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>
Subject: Re: [RFC 1/3] media: tw9910: Allow to probe from device tree
Date: Mon, 13 Sep 2021 23:12:19 +0100	[thread overview]
Message-ID: <CE93P5UJVABP.3TTVALU1H36DR@arch-thunder> (raw)
In-Reply-To: <CAOMZO5BzK5VtRUn7rqb+b84HoyiDy34e35aJ196J0TpCvL4vtA@mail.gmail.com>

Hi Fabio,
On Mon Sep 13, 2021 at 9:03 PM WEST, Fabio Estevam wrote:

> On Mon, Sep 13, 2021 at 9:53 AM Fabio Estevam <festevam@gmail.com> wrote:
> >
> > Hi Jacopo,
> >
> > On Mon, Sep 13, 2021 at 5:58 AM Jacopo Mondi <jacopo@jmondi.org> wrote:
> >
> > > There's an
> > >
> > >         tw9910_s_power(&priv->subdev, 0);
> > >
> > > at the end of the video_probe() function.
> > >
> > > The driver handles power management with the legacy s_power() call
> > > chain, and the receiver driver needs to v4l2_pipeline_pm_get() which
> > > the imx driver does when the capture node is open.
> > >
> > > Just an hint, you might have noticed already
> >
> > Thanks for your comments and review. Yes, I have fixed the I2C errors.
> >
> > I plan to re-submit the entire series after I get the TW9990 to work
> > on my imx6sx-based board.
> >
> > The capture driver is drivers/staging/media/imx/imx7-media-csi.c.
> >
> > Currently, I am not able to get the stream to start.
> >
> > This is the configuration I am using:
> >
> > media-ctl -l "'tw9910 2-0044':0 -> 'csi':0[1]"
> > media-ctl -l "'csi':1 -> 'csi capture':0[1]"
> > media-ctl -v -V "'tw9910 2-0044':0 [fmt:UYVY8_2X8/720x480 field:any]"
> > Opening media device /dev/media0
> > Enumerating entities
> > Found 3 entities
> > Enumerating pads and links
> > Setting up format UYVY8_2X8 720x480 on pad tw9910 2-0044/0
> > Format set: UYVY8_2X8 720x480
> > Setting up format UYVY8_2X8 720x480 on pad csi/0
> > Format set: UYVY8_2X8 720x480
> >
> > Then I launch the capture stream command:
> >
> > v4l2-ctl --stream-mmap -d /dev/video1
> >
> > but nothing happens here, no >>>>> frame indication progress is shown.
> >
> > If I hit CTRL + C then I get:
> > [  715.467623] csi: wait last EOF timeout
>
> I also need to set the video standard to PAL:
>
> # v4l2-ctl --device /dev/v4l-subdev1 --set-standard PAL
> Standard set to 000000ff
>
> # media-ctl -l "'tw9910 2-0044':0 -> 'csi':0[1]"
> # media-ctl -l "'csi':1 -> 'csi capture':0[1]"
> # media-ctl -v -V "'tw9910 2-0044':0 [fmt:UYVY8_2X8/720x576
> field:interlaced-bt]"
> Opening media device /dev/media0
> Enumerating entities
> Found 3 entities
> Enumerating pads and links
> Setting up format UYVY8_2X8 720x576 on pad tw9910 2-0044/0
> Format set: UYVY8_2X8 720x576
> Setting up format UYVY8_2X8 720x576 on pad csi/0
> Format set: UYVY8_2X8 720x576
>
> # v4l2-ctl --stream-mmap -d /dev/video1
> [   38.554032] priv->vdev.fmt.fmt.pix.width is 800
> [   38.561444] f.fmt.pix.width is 720
> [   38.567607] priv->vdev.fmt.fmt.pix.height is 600
> [   38.574973] f.fmt.pix.height is 576
> [   38.580992] priv->vdev.cc->cs is 1
> [   38.586958] cc->cs is 1
> [   38.591761] priv->vdev.compose.width is 800
> [   38.598420] compose.width is 720
> [   38.604048] priv->vdev.compose.height is 600
> [   38.610681] compose.height is 576
> [   38.616347] csi: capture format not valid
> VIDIOC_STREAMON returned -1 (Broken pipe)
>
> I added some printk debug lines to show the mismatch that prevents
> the pipeline to start in capture_validate_fmt():
>
> diff --git a/drivers/staging/media/imx/imx-media-capture.c
> b/drivers/staging/media/imx/imx-media-capture.c
> index b2f2cb3d6a60..511625981e93 100644
> --- a/drivers/staging/media/imx/imx-media-capture.c
> +++ b/drivers/staging/media/imx/imx-media-capture.c
> @@ -552,6 +552,21 @@ static int capture_validate_fmt(struct capture_priv *priv)
>         ret = __capture_try_fmt_vid_cap(priv, &fmt_src, &f, &cc, &compose);
>         if (ret)
>                 return ret;
> +
> +       pr_err("priv->vdev.fmt.fmt.pix.width is %d\n",
> priv->vdev.fmt.fmt.pix.width);
> +       pr_err("f.fmt.pix.width is %d\n", f.fmt.pix.width);
> +
> +       pr_err("priv->vdev.fmt.fmt.pix.height is %d\n",
> priv->vdev.fmt.fmt.pix.height);
> +       pr_err("f.fmt.pix.height is %d\n", f.fmt.pix.height );
> +
> +       pr_err("priv->vdev.cc->cs is %d\n", priv->vdev.cc->cs);
> +       pr_err("cc->cs is %d\n", cc->cs);
> +
> +       pr_err("priv->vdev.compose.width is %d\n", priv->vdev.compose.width);
> +       pr_err("compose.width is %d\n", compose.width);
> +
> +       pr_err("priv->vdev.compose.height is %d\n", priv->vdev.compose.height);
> +       pr_err("compose.height is %d\n", compose.height);
>
>         return (priv->vdev.fmt.fmt.pix.width != f.fmt.pix.width ||
>                 priv->vdev.fmt.fmt.pix.height != f.fmt.pix.height ||
>
> Any ideas as to whu such mismatch happens?

Looking  at this code it looks like you are using an old tree, Laurent
meanwhile have sent a patch that change this function:

a9512b261afd ("media: imx: capture: Simplify capture_validate_fmt() implementation")

can you test with the latest code as see if you have the same
problems.

------
Cheers,
     Rui

  reply	other threads:[~2021-09-13 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 13:01 [RFC 1/3] media: tw9910: Allow to probe from device tree Fabio Estevam
2021-08-27 13:01 ` [RFC 2/3] media: tw9910: Allow the TW9990 to probe Fabio Estevam
2021-09-13  9:00   ` Jacopo Mondi
2021-08-27 13:01 ` [RFC 3/3] media: tw9910: Initialize the entity type Fabio Estevam
2021-08-28 12:20   ` kernel test robot
2021-08-28 12:20     ` kernel test robot
2021-08-28 16:15   ` kernel test robot
2021-09-13  9:06   ` Jacopo Mondi
2021-08-28 13:58 ` [RFC 1/3] media: tw9910: Allow to probe from device tree Fabio Estevam
2021-09-13  8:59 ` Jacopo Mondi
2021-09-13 12:53   ` Fabio Estevam
2021-09-13 20:03     ` Fabio Estevam
2021-09-13 22:12       ` Rui Miguel Silva [this message]
2021-09-16 20:52         ` Fabio Estevam
2021-09-16 22:05           ` Rui Miguel Silva
2021-09-17  3:28             ` Fabio Estevam

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=CE93P5UJVABP.3TTVALU1H36DR@arch-thunder \
    --to=rui.silva@linaro.org \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jacopo@jmondi.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.