From patchwork Mon Dec 10 16:17:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 81 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wr1-f70.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id C714A2E5487 for ; Mon, 10 Dec 2018 17:18:00 +0100 (CET) Received: by mail-wr1-f70.google.com with SMTP id y7sf3592785wrr.12 for ; Mon, 10 Dec 2018 08:18:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544458680; cv=pass; d=google.com; s=arc-20160816; b=w7JA2vH9iTOsioIaXUYIzrQNd/oHwwi99NoyH1d5emVLPVYP4WyzTvVPswHToNzFzG evIjRIJIpfoMsKmOzxEauNB9lV90IeJ4aE9doanpHKl1bYFjnIUbzy7RT7E8QLVhUurg NTD291sghseSrfFo6hEXZbRx0yl91i/yrf+h26jMDXezvojRX/JLxJUAC04UcVe0ftHy nQlR+6qdVDAKcIvbYqXd5EXafmPJNShaEiW+gcrCGFeYlE2z7nrkr1Qr3Bh8c1Foj37N re2UWRnl9gIOApYi0k+QJResK78ugOBzHJt4lrAbDq+2tz1ylouwHBH9+APQvZ6DE5sl oMoQ== 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=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=Ethw8Fswk7Cx28Z9aCkrcl1COKFWGXj1qWjhCFHgjKRori4uoQJgJa/jIG7RlOao4I NC4gsJCctgubuf1ol5l8JL8KLid/sdEay/oaB3U1l5nuKcMp0yiZFI9qdPwHvTbx+VNn ACAQ1av0YfKgG4YfZWo1bM7OnnWmTF8v0Wk/5snimgi4FbeYz6IjVm6R14x0vwIdT3OQ eUeQ8Mc+qZ5XQJmQHZDi7chjiiLCVlH/r5UPqXhWh3+yp8S2evTeDwCjJ8iAagCYi422 13pOx79A2VTlMWRVITEnz97FgZLc8TPMJ17UQ8V+OeSZQIDUXjMzr7vX4+3F/k3X2NpK FMDg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Fby41GOV; 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=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=C97vd3JxR5HW0gWapRsri/SstwJb+A0ffj4bTcAzuthjkNvo+2tXJV8wmERibPYpfJ OlxllqkxvRpWYNGBHmWDp8jGvhUyoPrybzZ2ivrQh1u6xfuT1u5nHc82MpSpdNN9vj2V VUKdVKdkgO6nqCiPK3I6aq7oXeE6HJFl4/nF8= 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=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=UWL3Kru38C+lEh3BgyB/D0UL8P4Ht2yangHK0yKDfEpQG7Gdmsm55EcptX3NIG+fwC a2TXj8bsF1limB/MxaICEq5kz3TTuVp65Xx+li+cpIRU4fS95CaIzMKU7EJw8Ph81EjK 4EJV2tZLOFC5Be61ByQyuLb4c09S7BtTUm8pVGh1a+mYnic3kjI9kNh0bRlukiCoEjc9 v2gJ+ZJZt3BApjum19H9taAEJ4hE7dijx1qlizFfXQ2dTaP/QtMwkjfUJ5rygyGxU+Lg nAo3AJz0PK+CeYooi+nMFIvaiSO2EK+kKFKNUzq/sDSkdRBCXikIvqQ9ZvvH+UoOKM/+ tg8w== X-Gm-Message-State: AA+aEWZ49X07WVHsrPd5evmG/lfk4f6ERWG1aFTFxOtZgDVrpvlKanCc du71hVa//2lU2NzH47QFhrG1BUTX X-Google-Smtp-Source: AFSGD/WRg3YQeeQQ1jNFJ7vzZCI0kG2Rk17LcYXBWcof0aCA4slNRr1tnQG1+VNk1XN2qoJz9+3hYg== X-Received: by 2002:adf:f248:: with SMTP id b8mr997305wrp.9.1544458680510; Mon, 10 Dec 2018 08:18:00 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5d:5148:: with SMTP id u8ls2256218wrt.17.gmail; Mon, 10 Dec 2018 08:18:00 -0800 (PST) X-Received: by 2002:adf:ebd0:: with SMTP id v16mr11060179wrn.109.1544458680101; Mon, 10 Dec 2018 08:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544458680; cv=none; d=google.com; s=arc-20160816; b=zCCAbEP7uHIwodpyK1rEGaukFhJGwzBbcSquJfz2yTjXc01DgXSZsCsmEHVysWFdYy z+ZRlmMToqTTpxMVWVE+iPvAEqASyN627iskMQ/G8MbYFdxa30EjbLrX61nLHMShKmpN IPDEs3sBNiztioIH6HafoTZ57ih4+ALDGqT2E12Fu8PRW+N0piEvGgIWVZzXKAVQ7Ymo HQL8/zPMKUox3HAPTV4ElvB+VOCqlvyS6kLoBienxXsedH5T9bPm0/E6DiTP0JIlYZGe 2FD05096X6YoFC2fqxhRrDjtVlA0sbVuDN6vvNBson4cKH06komTDgy1nzwHEuM3yHLJ 2TMA== 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=oiAA/cUEr092LynkAnVQtsmpFwj1u/ZrP8Y7/2WzfF0=; b=iFljqNJuVFj0YZWsXnRImbShGEWLTPz/5mwPNsmgZRMbTn9fvcmSN+pQomv78JsWNV EuCT4tT5sV2Z6lDVbDHbyyoMWIFU9S4GrcmjlP/W0RkWFcRJojgt0OkaRP3HlyDplWBl eOkdCpZKIlVzLpjmpaV9+sSLh4gdHQ+AFTnOti6lGTzNa0kSLTL565GbGwi2DakqpFQ1 9IqYqZqchDZF5jz11I2w63NdTT+/BF/ab2GM1DOUAxFJKnzPfQkcSYd4KbIAco2RWDs2 bSeE5DgfysbjE3UTxwWr8gKABXdAhxUm3MwnYz0j3/iUqNBjbDZx+Zl22IqWjsoy6e9n j49Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Fby41GOV; 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 w136sor8055142wme.22.2018.12.10.08.18.00 for (Google Transport Security); Mon, 10 Dec 2018 08:18:00 -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:a1c:de57:: with SMTP id v84mr10923097wmg.55.1544458679797; Mon, 10 Dec 2018 08:17:59 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:58 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi , linux-sunxi , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 09/17] drm/sun4i: sun6i_mipi_dsi: Fix DSI hblk timing calculation Date: Mon, 10 Dec 2018 21:47:21 +0530 Message-Id: <20181210161729.29720-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Fby41GOV; 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: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , hblk is adding line with all porch timing values, or timings values from htotal without sync time. Current driver is subtracting htotal with hsa, but the hsa is bounded with packet overhead. For real hblk calculation needed by subtracting htotal with back and front porch values and BSP code BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hbp as (from linux-sunxi/ drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hblk = (ht-hspw)*dsi_pixel_bits[format]/8-(4+4+2); => (timmings->hor_total_time - timmings->hor_sync_time) => (mode->htotal - (mode->hsync_end - mode->hsync_start)) So, update the DSI hblk timing accordingly. Tested on 2-lane, 4-lane MIPI-DSI LCD panels. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index 81151d7633f9..4c95b3384ed9 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -495,7 +495,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, /* * hblk seems to be the line + porches length. */ - hblk = mode->htotal * Bpp - hsa; + hblk = (mode->htotal - (mode->hsync_end - mode->hsync_start)) * Bpp; /* * And I'm not entirely sure what vblk is about. The driver in