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: 10680315 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 A710F14E2 for ; Tue, 13 Nov 2018 11:20:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90CC42A3B8 for ; Tue, 13 Nov 2018 11:20:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F5302A3BC; Tue, 13 Nov 2018 11:20:27 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 EC30F2A3B8 for ; Tue, 13 Nov 2018 11:20:26 +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=KgYf7j9Rg7+FGX+CcdG/hb2O1gaWuBrTAKs5qSnsUaw=; b=LmzxYr30ddq0Du 3EZsbxSjOq6Sc2L7r0ryAmDEtPzbad3F/8LrHzLLFWARfZZg/k8mTIcQY0oW1R0rifS3f6swIgT8m FskO5sLfTNEiWVR1ryrSXLEM52uVQnnaH4cQGcPJIEzrzwU61OoEx6eKGeFkarUdo6703D/XTkybA vt3z0YNhQGIJMV7qritx+y6TlhQQn0t6ngdnkpLaqtfJow4lEpw2/3IJ+8m2XRwoHh74prWNXPqjy csBOSuZxEmwUlEQglXyfuuwfbrFR1j+6N/p97zpHK8YfYek6+0o+MIXARKZY5FJH7Jx4gRDOREqQ8 DuDd1pAGEvVKMYplKOXg==; 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 1gMWjn-0001kX-RR; Tue, 13 Nov 2018 11:20:07 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMWhu-0008EB-62 for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2018 11:18:22 +0000 Received: by mail-pl1-x641.google.com with SMTP id w24-v6so5864440plq.3 for ; Tue, 13 Nov 2018 03:18:00 -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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=H+CM64Jczyd+LORW/lL12eYfpWN3JDdI+Re9wVJiPhMeYsRaKt9+QRsF7kTrxS/xI4 Th7f+sxHCY6s4wWc5R6skD0IHvzCfHZz2/AJUqhHvfBrGRCvG8GeU8pDGC5CeKI4+FK/ elWmXUAt/MBX1MXhKzIA5d+R689b7HD0cIm+0= 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=D5aorguBzgFaeno0vSryYlUmgZEQ0xASVydW10sQ7HQ=; b=ly+43XEIfE/ZhQZaG9+n9sK5bcUZcSVWLyTs76RAEcZpFyE5TGR4K2qR7NeyN4c8Ls 22RPFJwXRBGRy8FKLAD7QjMzQvWQk8J478GWQC/X/hpdzSG+AYcQzEQL6VLmfvaeoXMK uXHrn5IcUwubiC2IcAm/vmAtYjZ5+EM54lCQs7lXWqnQVHcdTijvtaD8R6ZSgZzBrlXC 2kah56kF7pyR6Of76lu2/16lL+e6wXTyYsU7a+BD3/cFn3MbobmJOAYsgsAR5QK7cb4s Aqhk1CECEbrVWbKzGbTriPLFGTopnjixl6WVkibpORa8XaoEPoDgJpFtuq5akoo7j8gI J/rw== X-Gm-Message-State: AGRZ1gJUMhV7ueh+HN/QzeJdxZAozkmVu+Hjy6juR+ihprNpceWt4DQy DSIkFDkCVdkKdEaTCMHWGLjeJg== X-Google-Smtp-Source: AJdET5cTIzMDc08V05Z41yDOHL/XXmlckpZgqo3tzgOPa68Qrl2AJa6EG1UTbt02avvjpgvJgQxQ2g== 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181113_031810_241963_6AD75020 X-CRM114-Status: GOOD ( 15.83 ) 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 --- 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 +