linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Maxime Ripard <maxime.ripard@bootlin.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>
Cc: bbrezillon@kernel.org, dri-devel@lists.freedesktop.org,
	Chen-Yu Tsai <wens@csie.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Jagan Teki <jagan@openedev.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 2/8] drm/sun4i: dsi: Change the start delay calculation
Date: Tue, 12 Feb 2019 16:28:13 +0100	[thread overview]
Message-ID: <0f3247c920d1f5ce67cc7e024125c3a4d3ca0c81.camel@bootlin.com> (raw)
In-Reply-To: <6e5f72e68f47ca0223877464bf12f0c3f3978de8.1549896081.git-series.maxime.ripard@bootlin.com>

Hi,

On Mon, 2019-02-11 at 15:41 +0100, Maxime Ripard wrote:
> The current calculation for the video start delay in the current DSI driver
> is that it is the total vertical size, minus the front porch and sync length,
> plus 1. This equals to the active vertical size plus the back porch plus 1.
> 
> That 1 is coming in the Allwinner BSP from an variable that is set to 1.
> However, if we look at the Allwinner BSP more closely, and especially in
> the "legacy" code for the display (in drivers/video/sunxi/legacy/), we can
> see that this variable is actually computed from the porches and the sync
> minus 10, clamped between 8 and 100.

For future reference, it look like there is a version of the BSP where
this is clamped between 8 and 31 in the legacy ebios code:
https://github.com/Icenowy/linux-kernel-lichee-a33/blob/master/drivers/video/sunxi/legacy/disp/de_bsp/de/ebios/de_dsi.c#L687

As well as in the A23 code:
https://github.com/Icenowy/linux-kernel-lichee-a33/blob/master/drivers/video/sunxi/disp/de/lowlevel_sun8iw3/de_dsi.c#L686

> This fixes the start delay symptom we've seen on some panels (vblank
> timeouts with vertical white stripes at the bottom of the panel).
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> ---
>  drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
> index 380fc527a707..9471fa695ec7 100644
> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
> @@ -357,7 +357,9 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi,
>  static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi,
>  					   struct drm_display_mode *mode)
>  {
> -	return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1;
> +	u16 start = clamp(mode->vtotal - mode->vdisplay - 10, 8, 100);
> +
> +	return mode->vtotal - (mode->vsync_end - mode->vdisplay) + start;

Looking at the formula from the BSP, I get a different result from
yours.

From what I can see, the BSP formula is:
start_delay = vtotal - vfp + start
vfp = vtotal - y - vbp

With vbp counting the back porch and sync length.
So the final value can be simplified:
start_delay = vbp + y + start

Translated to DRM:
start_delay = vtotal - vsync_start + vdisplay + start

Which differs from your formula by the sync length.

Does this also work out for your hardware? I guess it's best to stick
close to the BSP if we can.

Cheers,

Paul

>  }
>  
>  static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-02-12 15:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 14:41 [PATCH v3 0/8] drm/sun4i: dsi: Add burst mode support Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 1/8] drm/sun4i: dsi: Restrict DSI tcon clock divider Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 2/8] drm/sun4i: dsi: Change the start delay calculation Maxime Ripard
2019-02-12 15:28   ` Paul Kocialkowski [this message]
2019-02-12 15:45     ` Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 3/8] drm/sun4i: dsi: Enforce boundaries on the start delay Maxime Ripard
2019-02-12 15:30   ` Paul Kocialkowski
2019-02-14  9:21     ` Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 4/8] drm/sun4i: dsi: Fix front vs back porch calculation Maxime Ripard
2019-02-12 15:41   ` Paul Kocialkowski
2019-02-11 14:41 ` [PATCH v3 5/8] drm/sun4i: dsi: Fix DRQ calculation Maxime Ripard
2019-02-13 14:33   ` Paul Kocialkowski
2019-02-14  9:23     ` Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 6/8] drm/sun4i: dsi: Rework a bit the hblk calculation Maxime Ripard
2019-02-13 14:41   ` Paul Kocialkowski
2019-02-11 14:41 ` [PATCH v3 7/8] drm/sun4i: dsi: Add burst support Maxime Ripard
2019-02-13 14:36   ` Paul Kocialkowski
2019-02-14  9:15     ` Maxime Ripard
2019-02-11 14:41 ` [PATCH v3 8/8] drm/panel: Add Ronbo RB070D30 panel Maxime Ripard
2019-02-11 15:13   ` Sam Ravnborg
2019-02-13 14:26   ` Paul Kocialkowski
2019-02-14 11:07     ` Re[2]: " Konstantin Sudakov
2019-02-12 10:32 ` [PATCH v3 0/8] drm/sun4i: dsi: Add burst mode support Jagan Teki
2019-02-15 14:12 ` Maxime Ripard
     [not found]   ` <CAMty3ZAA90-fHPADJSE3ht9CiYWA3yBoyEy7wVv9=6C5JiaTVw@mail.gmail.com>
2019-02-15 17:07     ` Jagan Teki
2019-02-18  8:26       ` Paul Kocialkowski
2019-02-18 10:31         ` Jagan Teki
2019-02-20 16:35           ` Maxime Ripard
2019-02-26  6:48             ` Jagan Teki

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=0f3247c920d1f5ce67cc7e024125c3a4d3ca0c81.camel@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@openedev.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=seanpaul@chromium.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).