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: 16 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 5C5392E5422 for ; Tue, 13 Nov 2018 12:17:42 +0100 (CET) Received: by mail-pg1-f198.google.com with SMTP id 202sf7249202pgb.6 for ; Tue, 13 Nov 2018 03:17:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542107861; cv=pass; d=google.com; s=arc-20160816; b=to6oCHXLK+HwFwY1ltx4+bZ/ue7lu1bqxE75Tr7Llfkr676moM5bofnZ8pGJnsBuYA McsBAUnT2q/XazP4ic7pRJfCl7+uV84pix02hGkwXICHEVWtk3ndLRHFqxso0z8hxasS niIdPYhSWh/uYYuEmvlUmXDXWiTlHHsNV6bpJ1mEE/Ip9YINYqYcoLoOmvf20v19nLdf tYVJ54i+mcSoeho+4KPd0YM1cZxoDCfykB/o/QcMlZaB6sub/wR/HJWAr3D6VcW19GV5 W9nSJxAnOeR7tSmXJsxXJCrFmMNC98+0WLY7u7NqMkEDnt9X/3uCe2RYfur30xTJlVZc bdGQ== 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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=WFjSMNPSO5o/fgsDYhGCCarCIKM9Y4c2rCGPWKKfzKM8hprwUzMGdD1O+3x+U0kFCJ WC2cN9O02WDiNYsWnOCuW5wE9TcfPIUK5c9nYyA17BYR3QB0X2J7Zog1xVReGTOi1VwQ UNIOl9rjBpmj+k6jFmNURDZpkrTA2kClqOhtYA85BG6nbMDBeZLflXl0VCHVeo/zVrEi 3xXbJZqnNfi6WU0L5ZQxILvnSE6y97cj3K0RnPo4q2N8qRIeyd09KIlrBImfJXGF8OiG +KJtxfVZWyIpFTgQYptFkRWx0KWHRq4Nhfe7elaNiOsh10hineryaco7+OLbcfGwPmMy 4noQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etDac7bq; 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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=Dpt+VRtuIjPS137bbj1uFpqtl3JXE7s82C5Z1ssl8kjCYKzrnZkwlg46CuN4r7jt9G D1hRUw3r1igLIH8+WE50ZJ0svegugp6NfmKCBySolLOUoART1rJrosAIq89UiwZF351F C3YqH0qtfHlaxIvwdWCBKfevndxIXFhFwWncs= 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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=gxugTo1lovNWxmQcgDN1Q2trI1oFWDtwZHoXQyvRP/mkKLVkJWpumcbMis/3syF7fz ku20YkqvQ3/w0vI9J5gzb352AuE/jbd7TCow+OUYSOUKDnB25y7Touy313mfYWgvHI4H fJqjFb8F+VbqmCRjs9pVScoJHt9/iYhNhHl5JM2uM37HJDhrY2ASOI8+VWXgZeGOSVum X0WNGdwz3deVBvll9mnUE9dwWGlYvSMaAfpk7wfmhfE/ddrqJdaPQQ7Xy2ZwUTwNBOyp k2ljrG8PEZ2kIC9cErtG+ow0yXlCYrcuimoWU7lmF++IkGv2m92h/GakQXT1cIpKueK9 wOlg== X-Gm-Message-State: AGRZ1gJnIwUsGTZqM/iVnZdjNaKtmUFL43Sum6E5NF2OUs2Q48nESpjA FcSD9LA5RglconUU/EhyvQWSeAFO X-Google-Smtp-Source: AJdET5ccVdRkPjCXQjpDpvX/J03Wch6bCWt3bEDsZ8svHs7M/HqgY5FLwVxJVoJb8wc4rcFNYm0JYw== X-Received: by 2002:a17:902:ac1:: with SMTP id 59-v6mr1274794plp.66.1542107861063; Tue, 13 Nov 2018 03:17:41 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b483:: with SMTP id y3-v6ls4319740plr.3.gmail; Tue, 13 Nov 2018 03:17:40 -0800 (PST) X-Received: by 2002:a17:902:6e17:: with SMTP id u23-v6mr4756186plk.127.1542107860779; Tue, 13 Nov 2018 03:17:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542107860; cv=none; d=google.com; s=arc-20160816; b=vhsEHLheRs0Dt+9HlVXgI2p0cZ3hCfMeEkb4HWQIZCOK0vwMXG7k7mSHbllJS1E6zp GV2oKZYufl8TzL/8rh4gyRZNEczklLiCTyvAa+2tbNaDmJA6nN1/WG0fJOhMZQ2kCsXU edhOKsL2Bjy1SftfubhhDK8BQFi16iUTVcy4yT/p+c8cEZN6m6irn4ZRC4D6NmqRTKjJ jkyL/Dl/HWjiO9Dw8mG07ELPxBBLcusRt4TMwlFg7kO63rHSloQ6aSkQibFTbp8riUqP f1oUmxj7Rn+et8Huldr/sVkBtLoWQCp/DYmJeV7Zrr+KwEmZufTgt3skR6O69h/0EQPz z+sw== 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=rCYzhNJFb/CoGYAKzI3iqrtOUmQxW0PESvSyXzaqWC0=; b=wUXIeoVKgTCIv/y9rO/ALIw0kVFzuTooaFuH9zAm4/+6S3A6Huqnu+QjJjkGL2iiIX v6YA5LmbQVV3u7NvES+6D5cS73GSwqOTlo6/lQb+sk4uRz0JX8/6R08H/sSYX1+GxtCy oUYRgg21Q7FVxgi0HMzz1pbXj1Anibw65rwhwOAZwXQjR1j+NKmjIpwyVuK7d+7HKLrN gUb4ahX3Uub7NhZiseiaXNjclcWukYXUUIrv1zjZQuQDsRzvUeAKiV6r4QmOERMJ142a EpDkVFsdOZ4dsd5Qv7jsf8G5XCTby2+pDiyVxZbCGhWQoqrGX7OOgWM0rt7O8e6d+UfD Va1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etDac7bq; 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 p72-v6sor23499228pfk.73.2018.11.13.03.17.40 for (Google Transport Security); Tue, 13 Nov 2018 03:17:40 -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: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 Cc: Jagan Teki 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-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etDac7bq; 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: , 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) |