From patchwork Fri Oct 26 14:43:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10657535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E11514BD for ; Fri, 26 Oct 2018 14:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 460F62C939 for ; Fri, 26 Oct 2018 14:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3961C2C938; Fri, 26 Oct 2018 14:49:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7C682C941 for ; Fri, 26 Oct 2018 14:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jiwMXzoaar9lU4sFI+HgOj0R9LV5PpX62/iiGG2jWAo=; b=TTtWvvJ4ppXbPH nnZuzEgj73ea26y9CcppXrjIOGhRnGL0ZfO7ioN0oXVdfawyhnfHz1DbAjQNAj2tlhBJ9mc4QDFRL WSBSks4K2pd8QU2CxN60GvbxYb1W2xKtg1DneqxR5jXv7VecbEHvmyFhwWM5asQs+qIL1KVOwCS4R DzwEbuq36UYIUHFCMjiJZc832tcBdRfn4FiWZPkcqhPV7EhCzNPjzvu3yzQcrU0n5QaKsm9eN7i1/ cHiS+oqQfUVHjglECaCzvLlDHwmhZ49EDh3bNQC7QzCK//EETJCdWyATTVsQ60Y532d/1kyVYNZr5 wGN3Feth1HtswX8sOuMA==; 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 1gG3Qa-0004F6-Ed; Fri, 26 Oct 2018 14:49:32 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Mc-0002Cp-VQ for linux-arm-kernel@bombadil.infradead.org; Fri, 26 Oct 2018 14:45:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=19gLVXTqAECsLkNlTUkgM/csvc CUwccaDKeUOPbMLOwjy7crmieK0hgfPThAZwPbrT5d/dDkz6OCfSAXhiG6ooGpWpjhmn2gbMzZ+QN xz/eW4yZHb8Oh1nKt58VTPr6YYv3QAX1PGC/tQlzx6GzIm7i3byO4J/mYJ5t8Vxe93mXxSjzdWVFR TUANb5aov/OqmnYcHA1unBhNf4Ux8w1uzsrU8DFq0eN9vTP5c0Vlc2Tn0oxFT3pgnTJSNr5deOsTO SR0n5Ya9Hv9vlhiO7aJ7J69xk5H+GjAdy5W24Tkfu7QWQzY68vThwxo/B7PivIXdKTfMIKZEtjMw/ H7a9r2mw==; Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG3Ma-0002nL-1i for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 14:45:24 +0000 Received: by mail-pf1-x441.google.com with SMTP id b11-v6so668780pfi.5 for ; Fri, 26 Oct 2018 07:45:10 -0700 (PDT) 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; bh=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=menwlbWCxRfV/uapcJsCL9CPFYnMiWJhOAuXTh7Sx/iUI4yVSyM25sfKHRZJk4W366 CQGB88ChYMqzzNGhPVEF63Ie/bbHlTjkbhfU3QqIHBt8mU+99e5s/bD9gGuH1U5UwRln 1STuNhnCePzEkYpZoj9XQR5q4ZWbpaEohJHaQ= 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; bh=Bf1jX/QAXYpOjKEyQOR7939jlZu4ci0BnR1i24YJ9yM=; b=cm7y2oOZEfIq16g72G3ddG8ZeodMsaKnw5Mhx38amWd9VqR7x+K7VbaltwFkbLwdnm 0Avc1qEOn6PGhdfscXEveC4rqfvVfAnu7Yf8Con4o15KNNn0cWDZhrVi2SzWleOFMDyc Ux4HigQ+uAtokraw25GxFFneT9WeZoZdmzS5/sSul3DXtg9pjMw50o/kMJUMMZIz4Kid JQ485+/NMdyvv+Uq50enni+/rXL/EK8peU9bepjyTVFffQd8PxOLAyK47TU+zwoxp911 ATHtYkKpACjsD/K56N1B177QQLfb5hJKnUyJhxJs4KNzgnGr4W/712a+BzXez0TccnNh dCyg== X-Gm-Message-State: AGRZ1gLXeiqNhRPNIefSKDTPre28yM1o6n9mH6wuH6R/qasaofWkLeCY NLWYw6KS/YVBeOSlHURcwAxzaQ== X-Google-Smtp-Source: AJdET5cey5/nZsw/eJb8gK2YMexy5LD0d3FhLyKPKYLx/e/etvBqeiL5vA1XpoXPLlgLz4pfVSWi7w== X-Received: by 2002:a63:b218:: with SMTP id x24mr3608116pge.223.1540565108682; Fri, 26 Oct 2018 07:45:08 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id z22-v6sm12044467pgv.24.2018.10.26.07.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Oct 2018 07:45:08 -0700 (PDT) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Icenowy Zheng , Jernej Skrabec , Vasily Khoruzhick , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , David Airlie , dri-devel@lists.freedesktop.org, Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Michael Trimarchi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v3 10/25] drm/sun4i: sun6i_mipi_dsi: Fix DSI hbp timing value Date: Fri, 26 Oct 2018 20:13:29 +0530 Message-Id: <20181026144344.27778-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181026144344.27778-1-jagan@amarulasolutions.com> References: <20181026144344.27778-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_104524_111616_138A6CD8 X-CRM114-Status: GOOD ( 16.13 ) 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: Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Current driver is calculating hbp maximum value by subtracting hsync_start with hdisplay which is front porch value, but the hbp refers to back porch. Back porch value is calculating by subtracting htotal with hsync_end as per drm_mode timings, and BSP code from BPI-M64-bsp is eventually following the same. BPI-M64-bsp is computing hbp as (in drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) dsi_hbp = (hbp-hspw)*dsi_pixel_bits[format]/8 - (4+2); => (panel->lcd_hbp - timmings->hor_sync_time) => (timmings->hor_back_porch + timmings->hor_sync_time - timmings->hor_sync_time) => timmings->hor_back_porch => mode->htotal - mode->hsync_end So, update the MIPI-DSI hbp value accordingly. Tested on 2-lane, 4-lane DSI LCD panels. Signed-off-by: Jagan Teki Tested-by: Jagan Teki --- Changes for v3: - Fixed proper commit message - add tested credit Changes for v2: - none 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 6bece492b1f7..78bad71045ca 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -482,7 +482,7 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, */ #define HBP_PACKET_OVERHEAD 6 hbp = max((unsigned int)HBP_PACKET_OVERHEAD, - (mode->hsync_start - mode->hdisplay) * Bpp - HBP_PACKET_OVERHEAD); + (mode->htotal - mode->hsync_end) * Bpp - HBP_PACKET_OVERHEAD); /* * The frontporch is set using a blanking packet (4 bytes +