From patchwork Tue Nov 13 11:16:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10680309 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 8BFE914E2 for ; Tue, 13 Nov 2018 11:19:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AAFD29A6E for ; Tue, 13 Nov 2018 11:19:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BB852A3BA; Tue, 13 Nov 2018 11:19:37 +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 E967F29A6E for ; Tue, 13 Nov 2018 11:19:36 +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=B8EVlDOdiScetJQ1bHlT3sCveU2h+zJAERfxPbN+/Us=; b=l5WtCUJXcaZu8C ao+XuOxz7Fse7I89uOYdfd9TAgMmWpP1GkkHfGmxJVShp0gHMjf+aN2NK0PhBd/vBuxkAE/ZSiwX9 Qfzlr/ApRXkkFLEdvCZaN00PkI+5oNgo2dSzTisC9dN4twGp0MX/Vj3c7v4AwA49UFa884TMAK5bS x7FQgXNcyLQh5hNa315pGZb6lO23/H1m26nZfwqokFUqivlNSx3SQfdXDSp2EGkvpnkg9eNF+D7/K ksw3RZQ2HUB3/m+HaATg/Wp6oEBwRCMHm2KTKT6Fs45ysJCTzI+p0ZJPpgXN4FubBRRotC6zsd8Uo L06zbcKmfRW/b9Yzqepw==; 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 1gMWj5-0000yH-Mw; Tue, 13 Nov 2018 11:19:23 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMWha-0007wU-4Q for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2018 11:17:55 +0000 Received: by mail-pg1-x543.google.com with SMTP id f8-v6so5538136pgq.5 for ; Tue, 13 Nov 2018 03:17:41 -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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=etDac7bqHT32dF8RDX2MwDIBVJA/i0V11AP17F+Ht2+YiDq0pYU76iV+/vj9hlp+ds 8UdgzwRLq/ALedbrmvbMt5CLvl2vtjd3ffOUDwBGtsgKDcqhaQm2xDmFlvT5Vnjo81jn HKa2rq2zQpGB37h1+IWwjwkI+y8zjmIPk3uXs= 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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=ZA00m6DgxkjmZ+g/LmrxPmJszk0cgai+9/th8qAHee17d9JdscX1FJPG/f9vOjnHxd yFp6yhckUXGdK2mKO6kRhDntmcby/DUN2S/7NXF0njR3fFdrmtkDn78yvz4rEP7UGwzf fNb4C1Cz2ybjpZbImsQpEQeuFMf6ma+0+kP7YrssMMknp9sFpgfRi/uYi1FBJ/UUwo2i AGpFHSQqG1JvfLQ1+NYqVDvJw6m+X9JCnuIXal8zbllcE0DG7o+dqbXZAupZptZx9sE+ 8NMi7xyKyGEMdZKVDQjRFNm/k4CENCuNOTdsufaV2T9K8DwZueLbh66wQgMGVJcQrpaK +L/g== X-Gm-Message-State: AGRZ1gKMZqC64Q4ipkhDDVin9XY6XGV1DkEcGllVPEFPl75PR9RW1G8/ XNW/5ffaA7NbXzVO3DDIawZnYQ== X-Google-Smtp-Source: AJdET5fd6Ak8LnYIZTmTLiUWQkzpPt2VdM1kigR9OO35gNyARjAjey0ihqVua4K4gaL4ztKryT4wkg== X-Received: by 2002:a62:380e:: with SMTP id f14-v6mr4662628pfa.203.1542107860438; Tue, 13 Nov 2018 03:17:40 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 03:17:39 -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 08/26] drm/sun4i: sun6i_mipi_dsi: Fix VBP size calculation Date: Tue, 13 Nov 2018 16:46:15 +0530 Message-Id: <20181113111633.20189-9-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_031750_186855_D29CCB9E X-CRM114-Status: GOOD ( 14.97 ) 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 The horizontal and vertical back porch calculation in BSP code is simply following the Linux drm comment diagram, in include/drm/drm_modes.h which is [hv]back porch = [hv]total - [hv]sync_end BSP code form BPI-M64-bsp is calculating vertical back porch as (from linux-sunxi/drivers/video/sunxi/disp2/disp/de/disp_lcd.c) timmings->ver_sync_time= panel_info->lcd_vspw; timmings->ver_back_porch= panel_info->lcd_vbp-panel_info->lcd_vspw; vbp = panel->lcd_vbp; vspw = panel->lcd_vspw; dsi_dev[sel]->dsi_basic_size0.bits.vbp = vbp-vspw; dsi_dev[sel]->dsi_basic_size0.bits.vbp = panel->lcd_vbp - panel->lcd_vspw; => timmings->ver_back_porch + panel_info->lcd_vspw - panel_info->lcd_vspw => timmings->ver_back_porch => mode->vtotal - mode->end Which evatually same as mode->vtotal - mode->vsync_end so update the same in SUN6I_DSI_BASIC_SIZE0_VBP On the information note, existing SUN6I_DSI_BASIC_SIZE0_VSA is proper value. Signed-off-by: Jagan Teki --- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index cdd44a1307b3..eeea977604ac 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -526,8 +526,8 @@ static void sun6i_dsi_setup_timings(struct sun6i_dsi *dsi, regmap_write(dsi->regs, SUN6I_DSI_BASIC_SIZE0_REG, SUN6I_DSI_BASIC_SIZE0_VSA(mode->vsync_end - mode->vsync_start) | - SUN6I_DSI_BASIC_SIZE0_VBP(mode->vsync_start - - mode->vdisplay)); + SUN6I_DSI_BASIC_SIZE0_VBP(mode->vtotal - + mode->vsync_end)); regmap_write(dsi->regs, SUN6I_DSI_BASIC_SIZE1_REG, SUN6I_DSI_BASIC_SIZE1_VACT(mode->vdisplay) |