From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 885A0C43381 for ; Mon, 4 Mar 2019 15:49:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 588CF206B8 for ; Mon, 4 Mar 2019 15:49:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="romoKZgB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 588CF206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sTm2CSUyadCcbQpc7fNCQl4kiCk4NUYQbolSboatC1E=; b=romoKZgBPz2DeJ0P9xgxTuq/Z 4N/CSOI0aM9AdGJ0H7RDn2/uGRoAgpWO9eHORmUiQtj2U5t4OPKxK3Hl/fPk0ZPMMfUYGDIKzmEzQ 8sHH70NkdH1WwtnedqKn5Vufy2D61ThnPx7Dm2KYQdHKc6sDGoyQL9ypkTzlYaenTf6h7zw69z2cO fMXAMTXxRw4iJ04ewejNyiSBge2Qk8aXWr1WdaorVspQ3NDJ0l14qDoNwhBPTjrZbl98poWI/RCCE Nr0G3D9FVqH+bTFNb3nxVwSHzDQkxBLISULbTprioCpX/nw7y971+NLHBf6Ezoom5OSVQ4BhXiPFZ 78CriOaQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0pqB-0006G0-ON; Mon, 04 Mar 2019 15:49:19 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0pq7-0006FV-Vd for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2019 15:49:17 +0000 X-Originating-IP: 185.94.189.188 Received: from localhost (unknown [185.94.189.188]) (Authenticated sender: maxime.ripard@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 4AD3EE001A; Mon, 4 Mar 2019 15:49:12 +0000 (UTC) Date: Mon, 4 Mar 2019 16:49:11 +0100 From: Maxime Ripard To: Jagan Teki Subject: Re: [PATCH v9 3/5] drm/sun4i: sun6i_mipi_dsi: Support vblk timing for 4-lane devices Message-ID: <20190304154911.s6rcx6bzal5slcjk@flea> References: <20190303173527.31055-1-jagan@amarulasolutions.com> <20190303173527.31055-4-jagan@amarulasolutions.com> MIME-Version: 1.0 In-Reply-To: <20190303173527.31055-4-jagan@amarulasolutions.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_074916_315252_76A1FF1E X-CRM114-Status: GOOD ( 18.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chen-Yu Tsai , Daniel Vetter , Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============1037857523463918253==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1037857523463918253== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4vyjlwpzptsmmtro" Content-Disposition: inline --4vyjlwpzptsmmtro Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 03, 2019 at 11:05:25PM +0530, Jagan Teki wrote: > Like other dsi setup timings, or hblk for that matter vblk would > also require compute the timings based payload equation along with > packet overhead. >=20 > But, on the other hand vblk computation is also depends on device > lane number. > - for 4 lane devices, it is computed based on vtotal, packet overhead > along with hblk value. > - for others devices, it is simply 0 >=20 > BSP code from BPI-M64-bsp is computing vblk as for 4-lane devices > (from linux-sunxi > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) >=20 > tmp =3D (ht*dsi_pixel_bits[format]/8)*vt-(4+dsi_hblk+2); > dsi_vblk =3D (lane-tmp%lane); >=20 > So, update the vblk timing calculation to support all type of > devices. >=20 > Tested on 2-lane, 4-lane MIPI-DSI LCD panels. You should be explaining which issue you faced, in which setup, what were its symptoms and how that solution is fixing it. > Signed-off-by: Jagan Teki > Tested-by: Merlijn Wajer > --- > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 27 +++++++++++++++++++------- > 1 file changed, 20 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun= 4i/sun6i_mipi_dsi.c > index 140e55f5ed2e..b38358465d87 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -527,6 +527,24 @@ static void sun6i_dsi_setup_format(struct sun6i_dsi = *dsi, > SUN6I_DSI_PIXEL_CTL0_FORMAT(fmt)); > } > =20 > +static u16 sun6i_dsi_get_timings_vblk(struct sun6i_dsi *dsi, > + struct drm_display_mode *mode, u16 hblk) > +{ > + struct mipi_dsi_device *device =3D dsi->device; > + unsigned int Bpp =3D mipi_dsi_pixel_format_to_bpp(device->format) / 8; > + int tmp; > + > + /* > + * The vertical blank is set using a blanking packet (4 bytes + > + * payload + 2 bytes). Its minimal size is therefore 6 bytes > + */ > +#define VBLK_PACKET_OVERHEAD 6 > + tmp =3D (mode->htotal * Bpp) * mode->vtotal - > + (hblk + VBLK_PACKET_OVERHEAD); > + > + return (device->lanes - tmp % device->lanes); This should have a comment explaining why it's needed > +} > + > static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, > struct drm_display_mode *mode) > { > @@ -586,13 +604,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi= *dsi, > (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp - > HBLK_PACKET_OVERHEAD); > =20 > - /* > - * And I'm not entirely sure what vblk is about. The driver in > - * Allwinner BSP is using a rather convoluted calculation > - * there only for 4 lanes. However, using 0 (the !4 lanes > - * case) even with a 4 lanes screen seems to work... > - */ > - vblk =3D 0; > + if (device->lanes =3D=3D 4) And that can be done in the function itself. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --4vyjlwpzptsmmtro Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXH1I9wAKCRDj7w1vZxhR xQodAQCrqnZbxF2fyl1NPVcnROU4AIK0N+R9W8jAMN9Z+0GiSAD/aQOiMHG7Z389 2eYWjKGR050OLCOn/EsHwfkZYY4d7Qs= =O1dp -----END PGP SIGNATURE----- --4vyjlwpzptsmmtro-- --===============1037857523463918253== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1037857523463918253==--