From patchwork Tue Nov 13 11:16:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 20 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 6F72F2E5422 for ; Tue, 13 Nov 2018 12:18:07 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id a18sf7830873pga.16 for ; Tue, 13 Nov 2018 03:18:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542107886; cv=pass; d=google.com; s=arc-20160816; b=q/n3k6YtWJlNLg9AMhIO6q8w3Plp7DMJeCC39Jx3Nn1P3JWxmnYRXWKRoYcgRDl3xB +v/sJlTDggSw2PlQ5m29TLTk87bvBnNr39uieL5idCEum8TRhy4NKU543WkZorwpkPip BEAQL2kmkm6m/kJ4hcjch41U/bzYnaCyfCka/HwhSnYxPhluilmHRk6+c4P84LbSLKrp e3GEebNIknz0p25xvVytwGpacLjwV3fu7KJMQTC5zXUv51dlp7W9mmpwMovc/dhsgXq0 newMSgTlteM33gxXP9zT8B24m2yzHix/15JBim1OBnzvHpx5bnMj+MB5t1BBePogK04i OojQ== 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=WXeHiI0jTSc5wEU3J9SBtYcSgw6GuTxHUVUlo5pmyKk=; b=KS3MxVTeZccE8kLWjwboTkZWpEAdYQglBzKRDq4r+y7hT9EARWgrt8segXlIJ4Z638 pd80GHt49XFckUdvOiN954rcp4N3iktSd5asMvqb/eM9NZoAkOkzrLO+1lRIlvi78spm M9ugvM23G7uxPF5h2QzFtyfToMMr9R8pG37js3qz4j1D2sWnfzKUHGpLTrB5J9HIobDh 3ul5UQ2pERAGv83mpJzUn4i1kDmDt24YXDrpf6r6zoxgDOQL6nxhRH8nu458deT0//ey 6oJ+fGomPjjbReotG8Mp61XSLbCuvXu77D4vO2R2pEX3dpt8mbyBy9bHFQ4RtFDWTb6I 8+ZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p3/0IBrO"; 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=WXeHiI0jTSc5wEU3J9SBtYcSgw6GuTxHUVUlo5pmyKk=; b=KQEo3sZyQXlqUaOv8Mj3l9TSXxpMnCeJoZHLRYr9DKKdyWEG9DxZpupKuZpV88I4pO CbooLYrd6IcQAdk5BkTOBmvT/1ApTiu0pdywQhAOoYjZ/gZpMuXi/eFoqIqGSwBAVZ3i vxFZAPmWueeDFD3QzKe+ceGErQmUBjpMXfUbM= 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=WXeHiI0jTSc5wEU3J9SBtYcSgw6GuTxHUVUlo5pmyKk=; b=BTRxilnscRS+8Phbw3H2x3E8YCA2q9fZjI2XPuNCoaq2P0q+1mYNKYukTCgeQF/AgG 3lqTMZPDMd8UNfSgoyVTnDU+F8ArYmdSyoORYYESuuY9oWY8ANtcy+BibBUpfXsqtGDJ oAYJkr2+pRWNFNRze7ZxA0zbHz5gKEu04/kLkQmpgUxIEQ5xOFkIu3vkWsALHb29dX+p T4m4tLqAXEf8RBldzY76Wp4v0HPT6qgbmZEgC2ZuK6msDcgvDnm7FCRizRiZWKXrzz/p asqY89Z7Io8nz+b7q2lToEcXmmlhvRwT4YoRMJ3HQWJ6lafTySSwG+i5E/c/9Zu9wm6L L98g== X-Gm-Message-State: AGRZ1gI0x4eIf40TY9oMTMVqFwmcuH9s7Z3+h20SjN0VzQKrXnJ5Vp+H tY/ZfF9qM9PRU/W+DPZMMzegENZo X-Google-Smtp-Source: AJdET5dCzDfjXrsYgg62wIWBVRfKz7jOZRY7/RmTH9kiUOiVpeisflp5/qWLf9uHqBBx0h56O1hhOw== X-Received: by 2002:a62:4e88:: with SMTP id c130-v6mr1946523pfb.55.1542107886149; Tue, 13 Nov 2018 03:18:06 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:69c5:: with SMTP id e188ls1776120pgc.19.gmail; Tue, 13 Nov 2018 03:18:06 -0800 (PST) X-Received: by 2002:a63:374e:: with SMTP id g14mr4461193pgn.59.1542107885929; Tue, 13 Nov 2018 03:18:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107885; cv=none; d=google.com; s=arc-20160816; b=0Q5OmbJLm69ZNuB6y63Y/wA1h6gjmNrVaNvjQbTPkmn43nZRfaDEDig74ELvGRHdu0 l+WDA0B+Og6FRo5gbN9tXQip8vSVL3H0+i4U/n3wtt2nlbUHDOOkbVvaVzyysLDHmwQD /YVak5kgevWA2EM2r2aBAWACQp7xEmyvqxF8GRUcAcdXSllmokUYhKqeYZUdzshAkcPR gRRtH5CAKxkOpyW7F7pSF4wWgoG2vSbCIQyvckjN77d/umuE+bo0EGskLLTg5iKj7NjB Zx2C8ECNscOgoJTsLUWTGFiGsrOTwZSJJJTcGoSP7f68UOTuIGsk6vQ6mFQrGINKbC6i y4cw== 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=WXeHiI0jTSc5wEU3J9SBtYcSgw6GuTxHUVUlo5pmyKk=; b=E6fJ1gqIWjFNfTucXU7v9HLSEf1ijmpMQGWN4uWM4d3W/J2FjVfwbfQF3SquZm6P3r gMoLOlcALbu08EC2qh8rye07E/Z9qVTWN2SIz9I0s0ruMSwPi5n3+WHPeu/FMjDFo/8I AaW31h9rGzGgUtMbHGExG5uRzFQf93dY51sEnyyJjl4z9aphaz1nWZgbfsudAMT2MYX8 ASaSB/hUfz+0U1JwAzPXbfzTr11IdQFSIk3+kmB0joIe/FqLzPAiPT+A7MjxxlmsohQr Jf1NArNIgEFCuSvuK0msPHfFxdKVcPvDaoVsYqZ9G5WPSYPEKecB8D3MHOoHrE7ArXDT 9EfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p3/0IBrO"; 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 j38sor13229187pgm.3.2018.11.13.03.18.05 for (Google Transport Security); Tue, 13 Nov 2018 03:18:05 -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:a63:a16:: with SMTP id 22mr4382852pgk.318.1542107885602; Tue, 13 Nov 2018 03:18:05 -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.17.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 03:18:05 -0800 (PST) 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, linux-amarula@amarulasolutions.com Cc: Jagan Teki Subject: [PATCH v4 12/26] drm/sun4i: sun6i_mipi_dsi: Fix DSI hblk timing calculation Date: Tue, 13 Nov 2018 16:46:19 +0530 Message-Id: <20181113111633.20189-13-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 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="p3/0IBrO"; 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 de0992052a90..cd657ac4bdae 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