From patchwork Tue Nov 13 11:16:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 19 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id BC84B2E5422 for ; Tue, 13 Nov 2018 12:18:01 +0100 (CET) Received: by mail-pg1-f199.google.com with SMTP id r16sf7839352pgr.15 for ; Tue, 13 Nov 2018 03:18:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542107880; cv=pass; d=google.com; s=arc-20160816; b=V5rzic2ngqAUle2kdWGQcNvw6vwt4O7gIfkwMtDxnyoHo+M1HYt326RYo58uHQyhsM hUtJ5Vg8JmWXaf9N/uZ0DfYzCeNWE4pbznPJW78VMMYR9yRfEO3vweNvS70SbTD2GBGw HV12Y/Lva6QR1fviJkqlUGWD2MdXWA2p1RExT9c+Eby+IqtIZMRq9CnK8TNxZshBfpra UraGqqt7M0gOcjRkvUXIHLdUqwR3gPDp5CR/vPfBJ/GNNH2zOpzbPikLYDMjQGv6KWme ZIatjvbLSh2Y7jKl+rUkzEGTaLBCWISXgaHBQcGCW5a6SmJPDl0+9U2GBVZIKuBHItI9 oSBg== 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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=HtVGeGXxB91rdvm5nl9Ha515fmyhTQhl8B1Kl2KJ/BNMxM1kINBpDLNCVYdXqAHTNo TAb5XzIXbIO5VwTwJSdfLn1TCPQAXODMUbygdCviI6Pn6e/ZpwPDM4exGf+c+f6berxp qovDY6ZPL6uZm8jkbUNC9ebaVXis1MKM/vFYbTZjWsVa2nNBiWeN5xWwJMFfhFJ+70Wy BuXe2cUCAxr88O3jUkFDmQnugfsbUqkiBJ0+BZ3U2L5lkDJiCdtdkTflST7sycBYG062 OK9NqTYw1Xd4162mc/ssjGiLkGrIjzN26xCv3I3E5ncnl617yP0A8YGbpQl6G+W2WnU3 c2Cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H+CM64Jc; 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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=JIgIFHdrLTzCr+7wrUKjgSnSKjhWyB+aqenb1MhkWdT8oC6dtkqEPC5dcI7PQtWOCS 0jDRVuZZim6wfIAqHGXOwugBsFwCkSIo1oiuuiVwXQDTHsEipA+EraMzN2aA4c8LjcPX gste/f9NDlFYZ3OYn2DNeztGG7IAZyuuQCXD0= 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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=G6CSl8c5mXunrLUOLS4CxxKQeC0ruMGDrcj5FS4f1yC6GF0e4JXe2qWOB8zC3SjFRE xWnpq/QTUXIUSEGv9a+BKbcT/eS0H+MZXTvmF7+mabCg97NDDb6iS0o7hsqy/iehs9x1 29DQKu92WZWquSLQ/mr47ov+alO0tF8YqIvjUcN+NxiNprhGfcaQNd+eDEteUzfLQfdA gQGSyan1LBgUbLUQ2IMinZWY8fyipEvONcgB0HZyR8INo/KKu37RV6sAnB5KQpeDDmvQ M16cEHJHkjRTxWwpnoveKua7JQP7J3YII+Cv3+nYQAzqi28Y5OSeJQ0oXRR6SZ4Ec0sn xt5A== X-Gm-Message-State: AGRZ1gIPdC7PEii82x1VoCOcdDCM6Yyqopp088vuNfUYUGaTpQuPHvy3 DRbZg7j950ufc4dUHJqPl6ljUQjv X-Google-Smtp-Source: AJdET5fTTt8mpQ2k0Vfhy1Yir7/VW9IEymlP6TnUCnZ4BQzoSDJUY9psZtdzWb5tTl5XUGhdYLThvw== X-Received: by 2002:a63:d849:: with SMTP id k9mr2013648pgj.16.1542107879986; Tue, 13 Nov 2018 03:17:59 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6255:: with SMTP id q21-v6ls2787365pgv.8.gmail; Tue, 13 Nov 2018 03:17:59 -0800 (PST) X-Received: by 2002:a62:3687:: with SMTP id d129-v6mr4757592pfa.56.1542107879656; Tue, 13 Nov 2018 03:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107879; cv=none; d=google.com; s=arc-20160816; b=onuRy4etE0KoS3os06gBU+Q1KafpKBZSlKfOIrxSH3oKUZjpHBn75mjGAPs4yhFm5B xFhuPMagWzzTOZikewL/0wtcnGPhC4ChlypwMqDQmOoUj63UGfsm3kD1KpBtBAjEdRtY /OlY2wlFF9h5CgfI+dYOpDJOtit7lt3UWQCyJRz9y7z3c+lIq66He/yFgHfky58fVMS9 mSIkHUe9ig1Oty/zqwfPUQYa9E1yQ7y7SLv0JLrxSa0DnHio9sAyF0KJjF856rH4lPkv HD0opkhvZe9pJJeEV/hPa5RedNn82kGNTf7gNd+V66enykCt3ZDgBp32IxExD9MUlsyp K2jQ== 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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=WcoRTgBi3vgTGPcwXMj5HYLdJcknEgOoLLXlgGgfDjPc6Tj7hWQF1tRLxOg0jcbEE0 bDzRSIz+MbVjV+nNct21vGmRBY1DuRx+IPe8M8F94YoEHCN2j5/rw8/90VVwxsM/y9yP QxwHNwpDAXlRNAuAyfmFODcVAYESSoQM71/K4q7k7T6/snV7PAuOV0ww0hDesV+EWLzW ViHMj7fE8xn8v06PRPSZoqZrAcjboDEffYD4hqrdj6n6VklBtdJdNWCPResDzxVrp2IZ FclYf9rWXeGiHTLlFxIcEfIzb6LnQgJ6jQiMZUQllIrI8CNFo3iYp9WPGHDXNtR8inPL fBxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=H+CM64Jc; 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 k33-v6sor22594354pld.54.2018.11.13.03.17.59 for (Google Transport Security); Tue, 13 Nov 2018 03:17:59 -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:8a88:: with SMTP id p8-v6mr4582115plo.94.1542107879320; Tue, 13 Nov 2018 03:17:59 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 03:17:58 -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 11/26] drm/sun4i: sun6i_mipi_dsi: Fix DSI hbp timing value Date: Tue, 13 Nov 2018 16:46:18 +0530 Message-Id: <20181113111633.20189-12-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=H+CM64Jc; 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: , 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 f6e3df8d2490..de0992052a90 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 +