All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <a.hajda@samsung.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	dri-devel@lists.freedesktop.org,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	Jyri Sarha <jsarha@ti.com>
Cc: Andrey Gusakov <andrey.gusakov@cogentembedded.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH] drm/bridge: tc358767: fix max_tu_symbol value
Date: Thu, 10 Oct 2019 11:19:53 +0200	[thread overview]
Message-ID: <95fb631e-9aff-35d4-a266-f3bc92ea4939@samsung.com> (raw)
In-Reply-To: <20190924131702.9988-1-tomi.valkeinen@ti.com>

On 24.09.2019 15:17, Tomi Valkeinen wrote:
> max_tu_symbol was programmed to TU_SIZE_RECOMMENDED - 1, which is not
> what the spec says. The spec says:
>
> roundup ((input active video bandwidth in bytes/output active video
> bandwidth in bytes) * tu_size)
>
> It is not quite clear what the above means, but calculating
> max_tu_symbol = (input Bps / output Bps) * tu_size seems to work and
> fixes the issues seen.
>
> This fixes artifacts in some videomodes (e.g. 1024x768@60 on 2-lanes &
> 1.62Gbps was pretty bad for me).
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>


Queued to fixes.


Regards

Andrzej


> ---
>  drivers/gpu/drm/bridge/tc358767.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index 13ade28a36a8..b6aa1bd47e1d 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -677,6 +677,8 @@ static int tc_set_video_mode(struct tc_data *tc,
>  	int upper_margin = mode->vtotal - mode->vsync_end;
>  	int lower_margin = mode->vsync_start - mode->vdisplay;
>  	int vsync_len = mode->vsync_end - mode->vsync_start;
> +	u32 bits_per_pixel = 24;
> +	u32 in_bw, out_bw;
>  
>  	/*
>  	 * Recommended maximum number of symbols transferred in a transfer unit:
> @@ -684,7 +686,10 @@ static int tc_set_video_mode(struct tc_data *tc,
>  	 *              (output active video bandwidth in bytes))
>  	 * Must be less than tu_size.
>  	 */
> -	max_tu_symbol = TU_SIZE_RECOMMENDED - 1;
> +
> +	in_bw = mode->clock * bits_per_pixel / 8;
> +	out_bw = tc->link.base.num_lanes * tc->link.base.rate;
> +	max_tu_symbol = DIV_ROUND_UP(in_bw * TU_SIZE_RECOMMENDED, out_bw);
>  
>  	dev_dbg(tc->dev, "set mode %dx%d\n",
>  		mode->hdisplay, mode->vdisplay);


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-10-10  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190924131723epcas2p27878e7a6c00a7a077260cf0c5cad5b1a@epcas2p2.samsung.com>
2019-09-24 13:17 ` [PATCH] drm/bridge: tc358767: fix max_tu_symbol value Tomi Valkeinen
2019-09-25  7:37   ` Jyri Sarha
2019-10-10  9:19   ` Andrzej Hajda [this message]
2019-10-10  9:25     ` Tomi Valkeinen
2019-11-06 11:23       ` Tomi Valkeinen
2019-11-06 11:23         ` Tomi Valkeinen

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=95fb631e-9aff-35d4-a266-f3bc92ea4939@samsung.com \
    --to=a.hajda@samsung.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=andrey.gusakov@cogentembedded.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jsarha@ti.com \
    --cc=tomi.valkeinen@ti.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 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.