From patchwork Tue Oct 23 15:50:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 10654201 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 3F81F13A4 for ; Wed, 24 Oct 2018 07:21:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2598F2A658 for ; Wed, 24 Oct 2018 07:21:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14B7E2A688; Wed, 24 Oct 2018 07:21:20 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D5A72A658 for ; Wed, 24 Oct 2018 07:21:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FD836E18C; Wed, 24 Oct 2018 07:21:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB20E6E1D6 for ; Tue, 23 Oct 2018 15:51:38 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id r9-v6so875114pff.11 for ; Tue, 23 Oct 2018 08:51:38 -0700 (PDT) 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=NlgASVRlNX+ALqEjtYF3sm1E5YI3hOJ6Lz3xqdNlUFw=; b=JhXE6m+UTEs9ANt+fqEq00PQkYDCyoDpPT0Uxz3a8YRSv3IK59f51Mi0cO70GYIzXx MQSkzmhlw9QQo7QNMsgnXIwbC8AaUjPHEqukNNU88n9KUrCaTFbMGZlTCNv2P5F4RMyv GIRtNBUPm51DzVOK3y/MCGeg9KrZkhSlDTt28eHCSPcEUKjRDQ5H4qpFETbd+kAi5IWa lFF3K1b5b/HT13xUGebCwcIb9uCoqbxZp0XnEhQv3hIDx/hSbrTa4OwAMkN1uJqbRAHP OoEkpcaBbuE8cnpHsVLWXwS4WfiqB8pMa8E4GJmmKDQEQZJ/VpARCEpgyfdn5FNkm8A2 z7lw== X-Gm-Message-State: AGRZ1gKmlLx0qFpaSboQsVlCtP0YBrW+vBTw+UAQuz57Qb4+ZhxgIGwq 5MUqP3YtOUPouWFSrfiAXXZeEg== X-Google-Smtp-Source: AJdET5czfKeMo4WdpKorjXN7oSgKMFLettza7vTigo3eYGZAoObGBmiWE8R1oWBnJQRj2vkFeHCspQ== X-Received: by 2002:a63:734e:: with SMTP id d14-v6mr9580018pgn.397.1540309898443; Tue, 23 Oct 2018 08:51:38 -0700 (PDT) Received: from localhost.localdomain ([27.7.51.1]) by smtp.gmail.com with ESMTPSA id o75-v6sm7442829pfg.0.2018.10.23.08.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Oct 2018 08:51:37 -0700 (PDT) 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 Subject: [PATCH v2 07/15] drm/sun4i: sun6i_mipi_dsi: Fix VBP size calculation Date: Tue, 23 Oct 2018 21:20:27 +0530 Message-Id: <20181023155035.9101-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181023155035.9101-1-jagan@amarulasolutions.com> References: <20181023155035.9101-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 24 Oct 2018 07:21:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jagan Teki Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP According to horizontal and vertical timings are defined per the diagram from include/drm/drm_modes.h Back porch = [hv]total - [hv]sync_end So, update SUN6I_DSI_BASIC_SIZE0_VBP calculation as mode->vtotal - mode->vsync_end Horizontal or Vertical back porch calculation in BSP code is simply following the Linux drm comment diagram from include/drm/drm_modes.h which is [hv]back porch = [hv]total - [hv]sync_end BSP code form BPI-M64-bsp is calculating as vertical back porch as in 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 --- Changes for v2: - Add detailed commit message 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 fc8560607147..3a1d48bc1996 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) |