Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4432786ybp; Mon, 7 Oct 2019 08:22:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzB48TtUZqK7hzThSIV3xmpOBr0NjvS/mrnxLqSgZneK4NfxJJL0Qf+HtPAJlTDOHeLS3dD X-Received: by 2002:a17:906:c82d:: with SMTP id dd13mr23748390ejb.169.1570461772739; Mon, 07 Oct 2019 08:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570461772; cv=none; d=google.com; s=arc-20160816; b=r5b3vIBguAHiwtC1KVTGUG6rdfbniL04JPrzZ6ytsdQNvAOsOXTgxNiF8m3bq4KuKF kPbIl7KSy6zpzRe306CCLbgM36iiTcOasfoGPGSKuMOiigAYzKGkDxWVGHCdhEvIi7vK 8VnVoqMaDbnYtc/vNMhyRACudVKBfZV4yye/azFT7b4NzCep4p8VI3aTToQ7m4CFqQPC epYcrFJS7h34O+lRzJTjGA1d9XQd2Q86Fmo6LYL2VtTQ0TzTysCU3fFRovL/pq+LUyWe n2h3DIRsHMCrD7A5HWfc8SZkzO7d/Jk4QUJcwkG4cqQn3+4TFpxMhWkcsKXd4LO2zvBL KpAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=CeqHJ4rQEYD9ylsmXbb19LVEM0bc4f6+Dm8vV3UwlfI=; b=Acmd4QIRl+hJV6q+PY5myPWHnTsL0dfdiu+WRKmcHh4ZeMuxwLxKNqfD8jV/BvMGXP 9FzEKO7oqqZZijxHqh9ce5dsWpxxtRX9TwD3MdaQojRy9xkkWxato4qvbmij/39vVB/b /oZgf4lHZ6g6MNPqIXY3akVjCvPVfibGQ4RDoj2kCNeSt2GTaEv7dW5tdYfSp94Q7Q+l BDt4q8i0I+W8OY3ID/0wJ5tMGp++5UmCO0genXzrrekGzCPnhXR2QxYKVDqSmw9xybiB 48ADbMx/Q+vgS7Pt61117ObinK6E+IoYYs58iOUSEU0J7UGY5RUTts89p25LgpnoQauT eu0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=m7g5UEjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si7287352ejx.295.2019.10.07.08.22.28; Mon, 07 Oct 2019 08:22:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=m7g5UEjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728648AbfJGPTW (ORCPT + 99 others); Mon, 7 Oct 2019 11:19:22 -0400 Received: from vps.xff.cz ([195.181.215.36]:56964 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727745AbfJGPTW (ORCPT ); Mon, 7 Oct 2019 11:19:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1570461560; bh=OMxyikXfTnLOBqWm+QEP8j50cJcpiVKIgC8XLUKV570=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=m7g5UEjw7VFuKAAkFVCxO3wEHwsalXDMCOagem7pdBWKPdNT2aYudIhcBhI4kKSu0 GbYJuS+e2J+VDLiYmdNd6Ec36l6rKDbsQjjr3tw1qU9T+xZiDXsWrGIba54j8J3XVd k3PKY59M3+VGq3LLOMSy3EowU+0nwjsLVz5VcsZw= Date: Mon, 7 Oct 2019 17:19:19 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Icenowy Zheng Cc: Jagan Teki , Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , dri-devel , linux-arm-kernel , linux-kernel , linux-sunxi Subject: Re: [linux-sunxi] [PATCH 3/3] Revert "drm/sun4i: dsi: Rework a bit the hblk calculation" Message-ID: <20191007151919.4uraoe374lui22gi@core.my.home> Mail-Followup-To: Icenowy Zheng , Jagan Teki , Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , dri-devel , linux-arm-kernel , linux-kernel , linux-sunxi References: <20191001080253.6135-1-icenowy@aosc.io> <20191001080253.6135-4-icenowy@aosc.io> <58dc94b6371ab2f5b11b13ab707d73ab3fc4cc64.camel@aosc.io> <14da3ae768c439e387f6609553bd465e945d4a33.camel@aosc.io> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <14da3ae768c439e387f6609553bd465e945d4a33.camel@aosc.io> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Icenowy, On Sun, Oct 06, 2019 at 11:12:43PM +0800, Icenowy Zheng wrote: > 在 2019-10-06日的 22:44 +0800,Icenowy Zheng写道: > > 在 2019-10-03四的 09:53 +0530,Jagan Teki写道: > > > Hi Wens, > > > > > > On Tue, Oct 1, 2019 at 1:34 PM Icenowy Zheng > > > wrote: > > > > This reverts commit 62e7511a4f4dcf07f753893d3424decd9466c98b. > > > > > > > > This commit, although claimed as a refactor, in fact changed the > > > > formula. > > > > > > > > By expanding the original formula, we can find that the const 10 > > > > is > > > > not > > > > substracted, instead it's added to the value (because 10 is > > > > negative > > > > when calculating hsa, and hsa itself is negative when calculating > > > > hblk). > > > > This breaks the similar pattern to other formulas, so restoring > > > > the > > > > original formula is more proper. > > > > > > > > Signed-off-by: Icenowy Zheng > > > > --- > > > > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 9 ++------- > > > > 1 file changed, 2 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > index 2d3e822a7739..cb5fd19c0d0d 100644 > > > > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > > > > @@ -577,14 +577,9 @@ static void sun6i_dsi_setup_timings(struct > > > > sun6i_dsi *dsi, > > > > (mode->hsync_start - mode->hdisplay) * > > > > Bpp - HFP_PACKET_OVERHEAD); > > > > > > > > /* > > > > - * The blanking is set using a sync event (4 > > > > bytes) > > > > - * and a blanking packet (4 bytes + payload + 2 > > > > - * bytes). Its minimal size is therefore 10 > > > > bytes. > > > > + * hblk seems to be the line + porches length. > > > > */ > > > > -#define HBLK_PACKET_OVERHEAD 10 > > > > - hblk = max((unsigned int)HBLK_PACKET_OVERHEAD, > > > > - (mode->htotal - (mode->hsync_end - > > > > mode- > > > > > hsync_start)) * Bpp - > > > > - HBLK_PACKET_OVERHEAD); > > > > + hblk = mode->htotal * Bpp - hsa; > > > > > > The original formula is correct according to BSP [1] and work with > > > my > > > panels which I have tested before. May be the horizontal timings on > > > panels you have leads to negative value. > > > > Do you tested the same timing with BSP kernel? > > > > It's quite difficult to get a negative value here, because the value > > is > > quite big (includes mode->hdisplay * Bpp). > > By re-checking with the BSP source code, I found that the constant in > the HFP formula is indeed wrong -- it should be 16, not 6. I'm not sure if it's relevant to the discussion, but I've recently found a LCD configuration manual for A10, that may contain some useful info: See this: https://github.com/pocketbook/Platform_A13/blob/master/Kernel/drivers/video/sun5i/lcd/a10_lcd_config_nanual_v1.0.pdf regards, o. > > > > Strangely, only change the formula here back makes the timing > > translated from FEX file works (tested on PineTab and PinePhone > > production ver). The translation rule is from [1]. > > > > So I still insist on the patch because it's needed by experiment. > > > > [1] http://linux-sunxi.org/LCD > > > > > [1] > > > https://github.com/ayufan-pine64/linux-pine64/blob/my-hacks-1.2-with-drm/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c#L919 > > -- > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. > To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/14da3ae768c439e387f6609553bd465e945d4a33.camel%40aosc.io.