All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mats Randgaard (matrandg)" <matrandg@cisco.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Hans Verkuil <hansverk@cisco.com>,
	linux-media@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [RFC 05/12] [media] tc358743: fix lane number calculation to include blanking
Date: Mon, 04 May 2015 16:09:54 +0200	[thread overview]
Message-ID: <55477DB2.2000601@cisco.com> (raw)
In-Reply-To: <1427713856-10240-6-git-send-email-p.zabel@pengutronix.de>

On 03/30/2015 01:10 PM, Philipp Zabel wrote:
> Instead of only using the visible width and height, also add the
> horizontal and vertical blanking to calculate the bit rate.

I am not a CSI expert and when I look at the spreadsheet from Toshiba I 
understand that the calculation of the CSI parameters is quite complex. 
I think you are right that there should be added some kind of blanking 
to the active video, but adding all the blanking from the HDMI format 
gives a too high value. It seems like the calculation will fail if "CSI 
clock enable during LP" is set to "Disable", but that is not supported 
by the driver at the moment.

I have tested all the resolutions between 640x480p60 and 1920x1080p60 
that my video generator will give me, and it works perfect on our 
product. Do you have to change this for your product?

> Signed-off-by: Philipp Zabel<p.zabel@pengutronix.de>
> ---
>   drivers/media/i2c/tc358743.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
> index dd2ea16..74e83c5 100644
> --- a/drivers/media/i2c/tc358743.c
> +++ b/drivers/media/i2c/tc358743.c
> @@ -713,9 +713,11 @@ static unsigned tc358743_num_csi_lanes_needed(struct v4l2_subdev *sd)
>   {
>   	struct tc358743_state *state = to_state(sd);
>   	struct v4l2_bt_timings *bt = &state->timings.bt;
> +	u32 htotal = bt->width + bt->hfrontporch + bt->hsync + bt->hbackporch;
> +	u32 vtotal = bt->height + bt->vfrontporch + bt->vsync + bt->vbackporch;

By the way, V4L2_DV_BT_FRAME_WIDTH(bt)  and V4L2_DV_BT_FRAME_HEIGHT(bt) 
can be used to calculate total frame width and height.

Regards,

Mats Randgaard


>   	u32 bits_pr_pixel =
>   		(state->mbus_fmt_code == MEDIA_BUS_FMT_UYVY8_1X16) ?  16 : 24;
> -	u32 bps = bt->width * bt->height * fps(bt) * bits_pr_pixel;
> +	u32 bps = htotal * vtotal * fps(bt) * bits_pr_pixel;
>   
>   	return DIV_ROUND_UP(bps, state->pdata.bps_pr_lane);
>   }


  reply	other threads:[~2015-05-04 14:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30 11:10 [RFC 00/12] TC358743 async subdev and dt support Philipp Zabel
2015-03-30 11:10 ` [RFC 01/12] [media] Driver for Toshiba TC358743 CSI-2 to HDMI bridge Philipp Zabel
2015-03-30 11:10 ` [RFC 02/12] [media] tc358743: register v4l2 asynchronous subdevice Philipp Zabel
2015-05-04 14:09   ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 03/12] [media] tc358743: support probe from device tree Philipp Zabel
2015-05-04 14:09   ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 04/12] [media] tc358743: fix set_pll to enable PLL with default frequency Philipp Zabel
     [not found]   ` <55477DAE.5040408@cisco.com>
2015-05-04 14:13     ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 05/12] [media] tc358743: fix lane number calculation to include blanking Philipp Zabel
2015-05-04 14:09   ` Mats Randgaard (matrandg) [this message]
2015-03-30 11:10 ` [RFC 06/12] [media] tc358743: split set_csi into set_csi and start_csi Philipp Zabel
2015-03-30 11:10 ` [RFC 07/12] [media] tc358743: also set TCLK_TRAILCNT and TCLK_POSTCNT Philipp Zabel
2015-03-30 11:10 ` [RFC 08/12] [media] tc358743: parse MIPI CSI-2 endpoint, support noncontinuous clock Philipp Zabel
2015-03-30 11:10 ` [RFC 09/12] [media] tc358743: add direct interrupt handling Philipp Zabel
2015-03-30 11:10 ` [RFC 10/12] [media] tc358743: detect chip by ChipID instead of IntMask Philipp Zabel
2015-05-04 14:09   ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 11/12] [media] tc358743: don't return E2BIG from G_EDID Philipp Zabel
2015-03-30 11:10 ` [RFC 12/12] [media] tc358743: allow event subscription Philipp Zabel
2015-04-08 11:40 ` [RFC 00/12] TC358743 async subdev and dt support Mats Randgaard (matrandg)
     [not found] ` <55477D9C.7050006@cisco.com>
2015-05-04 14:12   ` Mats Randgaard (matrandg)

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=55477DB2.2000601@cisco.com \
    --to=matrandg@cisco.com \
    --cc=hansverk@cisco.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /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.