Message ID | 20181113111633.20189-15-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBB6XFVLPQKGQE3HGVV6I@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 2B6602E5422 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 13 Nov 2018 12:18:20 +0100 (CET) Received: by mail-pl1-f200.google.com with SMTP id b8-v6sf9219641pls.11 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 13 Nov 2018 03:18:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542107898; cv=pass; d=google.com; s=arc-20160816; b=kiAgYeYODQJziXGXxRHAQ0tB68PJmXND3wCwoLTWwlkunNN8+IVRuamnetrp57887p kmmXHHlPNqn8UvY1fN/2UQugkzuWULeWjbnDTscJOctg1JcdoXrSgTM6c8nS8sspDfFj W5kq7zlKfSqlQPbiDVanxkPJuU8cpA2zowtdRW0RXjUdnCETDxUKKNHMH5yySDcV8M5P /3nWqe02riZLVcR1u72JcJkmq5yVlC6B1+KHqdBzdP8s3hSth2aWQK5YAlFYOZzMQCd5 2UeLuKf/Mx+hGyunmpLTrMrebG0UgDumiz97McIpbqC8OkmgZjortM+dP6W7Rs1ql61j Si3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y5PF+ZGgoffIRFFiAIPy5mU3TbDRA/z2eo11P9T0YNI=; b=YltzAyEKL2ON3P5aooZtlm6f8I+zeluBZlwmnkFqcuDedt+zHZG4SRdk8zBa5NS9X+ MaG3LpHgxEwV9cdqY3bkemB90B7dYkUWZnLtu+DLR3FTP5sas2vshmcbVwLd6am2dIsc p/fD3khOKGtKSIaoB4KZb35VHT2qpsyQ/1TM4flQ8Vd1OiKAdxpfNtNxPkgmqCgQrljt au8lERbpqAqK4+FbG6wBNO+APEnRmtvmgThFFjgk4xwPcaG80jxTFFBUtTcVBEqO5H83 LrY5sjV+FljU6+CME83xmTsoNnO/vpjzPhCcbao4DqSY+/hphstXwpwKVlszLIgf3aXv B0Qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jneNIuEv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=y5PF+ZGgoffIRFFiAIPy5mU3TbDRA/z2eo11P9T0YNI=; b=SG/do5rTASmVZpf/M1TGXufTb+u3PwOMhMsAw4BsK2AM2ThsgBsJjT+ZrPmV9p9CRs YX/7D2Dh8vpjwTXAIuAXgMExhGCUNXEra5i2EQr0H4poiyRJVP3YK1QBt23P085MFw4D ux3oIKcTt5UumgH315WqhGVwVDupjS7UqtPRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=y5PF+ZGgoffIRFFiAIPy5mU3TbDRA/z2eo11P9T0YNI=; b=S1iT8BtZKG1Kq1Y/oFeHHEO0Q/aDhr/3IX9sSY/ZgY0vLfvtFZeiduL7k+LMpCb5yQ 9YjiAE8L3a6OYHbX9tm24hnNAueb26kEWm7kvKX56aOJW70v5rvhGm7BDQttdHPB9vxU fSzax0rwR9u/1HJ+dIZwPU/Nga3Lh1wF61xfJCGc8w3M+UMxwTPAluhtyjWNyeAWBl44 Hvw23VDB6shi5C6GnqFsD9eV1VhdmtXUO7CZSTelj8LSJ4GBiykgR60AgX6dqN3FtaIA IoY+z2wNWPHPu9Un4Uj4UlfVks4MJTLIFFzzQuQSdwKsSmBq0Paa/DusaY3IvkI5QwDe o8VA== X-Gm-Message-State: AGRZ1gIqCMy01ybAr81snf7ODLvrrhx6ZncUbZ6NJ8J0TP3mM0ZHOL3z 7Lc2ZI8k+2qlQ3cRmivfG7GFafdv X-Google-Smtp-Source: AJdET5cmppMU13uK7VZZFLE/DBFCEfqGLcbW4MAtdYgYa3B1OX3229scMolJeBranBvpMC/IUIu5Xg== X-Received: by 2002:a65:638c:: with SMTP id h12mr1353938pgv.106.1542107898858; Tue, 13 Nov 2018 03:18:18 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:4494:: with SMTP id m20-v6ls4171153pfi.10.gmail; Tue, 13 Nov 2018 03:18:18 -0800 (PST) X-Received: by 2002:a63:bd51:: with SMTP id d17mr4430367pgp.443.1542107898528; Tue, 13 Nov 2018 03:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107898; cv=none; d=google.com; s=arc-20160816; b=eWZ2A3ELLokb+xpbVUcwBrY3phlXt+tUSuTmYrTcDm32TdaidAhNvd0s69FiTBAkna SrfA/16tUOzOT5GCJYSyJztOFOVjrcVrMGv/ZIiInajD5v6c+QWMHC9kAWGWr9A3IkgZ Gi7UGy3UoqiLMiYvUTgyoNJAMEAby64Yj7EQBXtasrtP/SJEoRqTyrfSfCMloJ1eJep9 wsf/RROAyimTCnE+twi2PX0jfm9gM5McEFv/9kDIYJQZmIWzdr8YWZi2JSUlA3ElFraS aYcX21vYyWL7BzHbK/H3YZ1nDMoQUhT0chEjKQ2opa6X0G3M2shOPeiO3wNrzxGzoqrR tmEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=y5PF+ZGgoffIRFFiAIPy5mU3TbDRA/z2eo11P9T0YNI=; b=mje0VkoEBoUGqjUXUNYmWROUR7dnnBaJZnl4NInNLte/jMSQi/r9tclUSd5QQNtnOS aBdo1XKZguY0kv+wrORWD/6Fs8zfemdlmUTcF0c/695qUoHKCHDYUxiVy50kDxumppdY 6PnE8ujeOYcIP3+tJxtjhfbQXWqoUu4qROCX9lu6PGZD5/m7s4WFmPOFv29jiiWICzfX c7ayEoXMnTLF2zZ8iIaxTLCFsh98tsnGNv9fTUdbAZ42zA6ZmqIUGiCzDEEdeBbw16BG IP8qo0SAKyKH27ZSf3T01O0eKkyJahZB6Dqmp7Rcc83MDaustFamA2LiufpnjwACt4T7 T5bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jneNIuEv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x14-v6sor15661819plr.68.2018.11.13.03.18.18 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 13 Nov 2018 03:18:18 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:9681:: with SMTP id n1-v6mr4660594plp.126.1542107898182; Tue, 13 Nov 2018 03:18:18 -0800 (PST) Received: from localhost.localdomain ([2401:4900:3670:3f11:bc71:2ef7:4a39:e260]) by smtp.gmail.com with ESMTPSA id 27-v6sm28531377pfm.36.2018.11.13.03.18.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 03:18:17 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, Icenowy Zheng <icenowy@aosc.io>, Jernej Skrabec <jernej.skrabec@siol.net>, Vasily Khoruzhick <anarsoul@gmail.com>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will.deacon@arm.com>, David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, linux-clk@vger.kernel.org, Michael Trimarchi <michael@amarulasolutions.com>, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Cc: Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v4 14/26] drm/sun4i: sun6i_mipi_dsi: Fix DSI hfp timing value Date: Tue, 13 Nov 2018 16:46:21 +0530 Message-Id: <20181113111633.20189-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181113111633.20189-1-jagan@amarulasolutions.com> References: <20181113111633.20189-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jneNIuEv; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 1a3cdd5b72a0..63b924b89bd7 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -490,7 +490,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ #define HFP_PACKET_OVERHEAD 6 hfp = max((unsigned int)HFP_PACKET_OVERHEAD, - (mode->htotal - mode->hsync_end) * Bpp - HFP_PACKET_OVERHEAD); + (mode->hsync_start - mode->hdisplay) * Bpp - + HFP_PACKET_OVERHEAD); /* * hblk seems to be the line + porches length.
Current driver is calculating hfp maximum value by subtracting htotal with hsync_end which is front back value, but the hpp refers to front porch. Front porch value is calculating by subtracting hsync_start with hdisplay as per drm_mode timings, and BSP code from BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hfp as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hbp = (hbp-hspw)*dsi_pixel_bits[format]/8 - (4+2); dsi_hact = x * dsi_pixel_bits[format]/8; dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); dsi_hfp = dsi_hblk - (4+dsi_hact+2) - (4+dsi_hbp+2); Example, u32 fmt = dsi_pixel_bits[format]/8; => ((ht-hspw)*fmt - 10) - (6 + x * fmt) - (6 + (hbp-hspw)*fmt - 6) => (ht - hspw - x - (hbp - hspw)) * fmt - 16 => (ht - x - hbp) * fmt - 16 => (ht - x - (timmings->hor_total_time - timmings->hor_front_porch - x) * fmt - 16 => (timmings->hor_total_time - x - timmings->hor_total_time + timmings->hor_front_porch + x) * fmt - 16 => timmings->hor_front_porch * fmt - 16 So, update the DSI hfp timing accordingly. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)