From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH v2 3/9] drm/sun4i: dsi: Change the start delay calculation Date: Mon, 11 Mar 2019 15:12:11 +0100 Message-ID: <20190311141211.uhxtrrdkp3q3dvt5@flea> References: <6e5f72e68f47ca0223877464bf12f0c3f3978de8.1549619502.git-series.maxime.ripard@bootlin.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1540713298==" Return-path: Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id EFC3B89951 for ; Mon, 11 Mar 2019 14:12:14 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jagan Teki Cc: bbrezillon@kernel.org, dri-devel , Paul Kocialkowski , Chen-Yu Tsai , Sean Paul , Thomas Petazzoni , Jagan Teki , linux-arm-kernel List-Id: dri-devel@lists.freedesktop.org --===============1540713298== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6gv2u2dfivms4zdf" Content-Disposition: inline --6gv2u2dfivms4zdf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 07, 2019 at 11:24:01PM +0530, Jagan Teki wrote: > Hi Maxime, >=20 > On Fri, Feb 8, 2019 at 3:23 PM Maxime Ripard = wrote: > > > > The current calculation for the video start delay in the current DSI dr= iver > > is that it is the total vertical size, minus the front porch and sync l= ength, > > plus 1. This equals to the active vertical size plus the back porch plu= s 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 sy= nc > > minus 10, clamped between 8 and 100. > > > > 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 > > --- > > 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/s= un4i/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 *d= si, > > static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, > > struct drm_display_mode *mod= e) > > { > > - return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1; > > + u16 start =3D clamp(mode->vtotal - mode->vdisplay - 10, 8, 100); > > + > > + return mode->vtotal - (mode->vsync_end - mode->vdisplay) + star= t; > > } >=20 > As you stated in commit message about result as "active vertical size > + Back porch" which indeed correct in reverse way of previous code. > but the change seems incorrect to me. > > =3D> mode->vtotal - (mode->vsync_end - mode->vdisplay) + start > =3D> mode->vtotal - (mode->vsync_end - mode->vdisplay) + (mode->vtotal - > mode->vdisplay) # bypass 10 for now > =3D> mode->vtotal - mode->vsync_end + mode->vdisplay + mode->vtotal - > mode->vdisplay > =3D> (mode->vtotal - mode->vsync_end) + mode->vtotal > =3D> Back porch + mode->vtotal >=20 > but not > =3D> Back porch + mode->vdisplay Why do you think it should be this result? Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --6gv2u2dfivms4zdf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXIZsuwAKCRDj7w1vZxhR xQhKAP97rFdiYd/MMkrr8iIg4ycpmJGWPQC4KR13WrNCMdoHJAEAqAF/a2ODC6Kg WPrjT+YuxLVhuHk9YgJscX/PHDLNQAE= =46JF -----END PGP SIGNATURE----- --6gv2u2dfivms4zdf-- --===============1540713298== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============1540713298==--