Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2395640imu; Thu, 24 Jan 2019 12:02:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN5AyjIl/3pzdyVRSEBwvZdWkx15eAIc8GPHBQWjfRP9fE5NyD0PAklz2u2VG+R/xDBzuggF X-Received: by 2002:a62:5658:: with SMTP id k85mr7791324pfb.231.1548360167672; Thu, 24 Jan 2019 12:02:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548360167; cv=none; d=google.com; s=arc-20160816; b=nk3uaD6/Y/rulyzly/b/Lo3iJ3KKTzZ7cDr8g64ZeGW8ZmA5+/IziAlYHvtfcrrJoq PZWrpIRhbB5soq8E+qtm6QVwFkoy3NT6+cdnk9insv1Pne/E5XhIfP4W+GJEK3GgQkIj /yUclkN7ejVr17Py2cGPTnvpILpdf9SznExWpOcoMMVz29h5Aabdcy6VLukU2ADBYymW DpOnY5IVvW788ABjXQxVhMGsvRHljRirmsc09tF5deSEFmZEHMN0tvGh16Tm4a5+pAuh B6y+Wa4xm1ACRZk5nqjtYp3HOLDWV1tTG+4OsHIO537bmkzIlqXpiGf9Dn6I4pLg8hJg gcfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=p/fJ1iw2WcKuA3279PZCjqMz7GBGf1KE2XCGX061XcE=; b=qhUN4BcMhtQXN6vBh9HEAAvHz0SjRLeNgZ1B2HFwbrvbFmb5wtiOOCah19jihdtCNJ Lo8O3hCn8KYTtLv9V49W/Ylpxcba/sdYryFaw9UrJe+3AHlfjonOEp+PazHMxCoMCawU iheq8wUXu/8m3O2H9Fq1GMMhQEmfYhFkB4H09Nx4WzlzxDkQ5K2ssojHbywTOm0pf7p9 1uPsaqn1j5IOmHpw9A1UfQbEy5AUrxtmZGelxnA0IhrXo4+xSEwHrMJ8WMRAVA9E3JJ+ DRSfFnzAHbID7ykJOS/dQ8wUUgMUivlX9asbO+fzjmtfxXgW1d2UYew9tkFzPhdq6HxS WsLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CC7tbdyL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si23812792pgh.251.2019.01.24.12.02.32; Thu, 24 Jan 2019 12:02:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=CC7tbdyL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732213AbfAXUBM (ORCPT + 99 others); Thu, 24 Jan 2019 15:01:12 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35766 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729867AbfAXUBL (ORCPT ); Thu, 24 Jan 2019 15:01:11 -0500 Received: by mail-pg1-f196.google.com with SMTP id s198so3139252pgs.2 for ; Thu, 24 Jan 2019 12:01:10 -0800 (PST) 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=p/fJ1iw2WcKuA3279PZCjqMz7GBGf1KE2XCGX061XcE=; b=CC7tbdyLxoRdfqqHGpLeXCUiQEbgaexutUTQRuVYuirYw0CEJF6xTKYaBdsFyFzMgl +mOf3fjdQjDVA496o1n4r6lNRvIDETxD1zWANt0JNbj7Xzp1gr57NASbumpuLDLCBOXs Li2ZfTWYkQZStwDJUpN5TcGcvwK7FaR4lW5eg= 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=p/fJ1iw2WcKuA3279PZCjqMz7GBGf1KE2XCGX061XcE=; b=TaPe4MSsqMZV14xVelrk3vD3RiQmTTJ97IbEoX9g8oN2HMqj0ASmDKLSefQovBhLyi 7C2tmKeOiFY69/1vx8EXsiSuYiqbjp64Dgel1J5ptlQIpzWlpWhqK8uH8nM7+KsKxLrJ RkEnGZV5kepQdnyLHlyxHuXfbV0oYWVHITJ78IbypsuXv1clNFcioxdzvWE2KlnM423c bc8DsH/21i7w1RwB2AIocMb7LhUqWt71k8BetQ5HY9B2OYbyDmAxdSImbuG6l64zkJXu H5ZwFuIbl6LhL9isvwDslsZcxOhiOz5VYEQYfoYJ9Oq2083KQ0p/Z0F6EBHbcL2AVAIj Mkuw== X-Gm-Message-State: AJcUukc+YEDxueCV8WypbSCyqeuciPHKTo6avP3iKoQTPj8oViax1eFk iihQ1uSPJiGAB0r3tn7E4v7pTg== X-Received: by 2002:a62:1b83:: with SMTP id b125mr8204996pfb.42.1548360070231; Thu, 24 Jan 2019 12:01:10 -0800 (PST) Received: from localhost.localdomain ([115.97.179.75]) by smtp.gmail.com with ESMTPSA id x11sm61637003pfe.72.2019.01.24.12.01.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 12:01:09 -0800 (PST) From: Jagan Teki To: Maxime Ripard , David Airlie , Daniel Vetter , Chen-Yu Tsai , Michael Turquette , Rob Herring , Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, Michael Trimarchi , linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki Subject: [PATCH v6 20/22] drm/sun4i: sun6i_mipi_dsi: Fix DSI hbp timing value Date: Fri, 25 Jan 2019 01:28:58 +0530 Message-Id: <20190124195900.22620-21-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190124195900.22620-1-jagan@amarulasolutions.com> References: <20190124195900.22620-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 58bda0928aef..e24719cabba2 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -578,7 +578,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 + -- 2.18.0.321.gffc6fa0e3