| Message ID | 20181210161729.29720-8-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBNNDXLQAKGQEL5HGAJY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f70.google.com (cartago.priv [10.11.12.1]) by cassiopea (Postfix) with ESMTPS id 4D6C12E54AF for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 10 Dec 2018 17:17:57 +0100 (CET) Received: by mail-wm1-f70.google.com with SMTP id r11sf4873854wmg.1 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 10 Dec 2018 08:17:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1544458677; cv=pass; d=google.com; s=arc-20160816; b=sA7MSKELfeuuIOHsEXRTZIj8hPVj5yh3/NTp6RoK/ci/mDiLXOhjdKVlgCbi651Ny/ iPAb8vY3HhMTXlFXRnvIc2tJuwr0vATUXn0xnYnyUjJ3aO+PgFTQOfExivFRDrAnkTA7 eyny13o1AhWOwX4z6ybKT3YR+O+WcOgeVYrRBGlUfTd6kATZaxlYDkblUYwcw07nbftT nOxPePlRsO3BOwFjsJ4WlZaTvBiaZpSDNIXKiVwd8TTcVt/SsmR8NOozAKNyOdpXySdL ChEpCqbsq9oa0da152m6DrqP81kTV1aVfhlOW4vZ3gxkpxhhwcOVS0F5gYlw4wjnsIvt IFqQ== 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=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=wJpmjytatzWJ9FrWDQbjptozVgMBcpWXwurHsn+1Fv8FXoUY28ltLs4SVmD2YhKO2w 7lRDhwEYbZcPg4hVxESAiZEECgL80PkENKO6fuWj341/QOMtV2c0a/1gC5sUZfigGcTi 4CX3JfbSbEQ2ZiSQ116ozMLPLoJzEEfZL2Nrf2e8vHLzvJRErenisXBQ6VYVWMtJPiK7 MGR2sxMm0K2/looBEDlHS4jRDiwFMBOH2yIQFLjgYzYlTq4qFmoc2IZGmioNheDxmxM4 4ejjtP7KwD2ugR5y49pVFQ4dbfkdqQJJx7/zjRfvpiXpznUSzQSGrbicf6unP8mUT5Ic O+xg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lvquzrG0; 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=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=Ro2SH/CqHvzbmayQbercyqqrf016K9xq7GI8kP0zPopoQKz999moX+8MkJzmyE5H+d s8M9sOV2Y0PLJRohlgKELxzn3mfQvvcY5aXTzo7eTp1/TJCl9f79D2rf19JJ+lLYg0m6 R9fPjRZ+p3Zg7fwBkeVeBGvQhWd9z8FlCC9i4= 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=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=DLyj3SumunDHBe9dwkNyJwlktj23O8G5Chvfz6xv1+v4/3czpxqvMSz618CJQa8BKi DfxNnNepm8gCteXcHZVncaHmFV9UyU84DiysRYwCUAR9bfB8nphDhBNxYzz2/I01lICm vB4B0g6Tinaf/PQA6nw+UJENqNA6qNJ9wLk7fDRsbsxnmCA4r4/BZ3OyMEmW1FHARFBj X+8qRd3dqY9Drw/PH9ru6KLHm6bl9QlaLO5vBckCbOK3x3gF45Gvv0z28errM5lm3wcT COQYz0HCYkBruuozavgp164bpokvK0bxLikXRqoa+RUPkJc/zojAH7Yebt2WUGU5b4JK 0uJA== X-Gm-Message-State: AA+aEWZ9/YYyCvg+jXlknvCwbt0I7/ouo3KOwBXVgtK/eIyB1StUIa9K KLXFF/zydmbpYIXkDpKN4jxhfg/4 X-Google-Smtp-Source: AFSGD/V2BzqC09QJLMHyjF7wc3s2vVEl0MDQuueXKSjRQv99X8P7c+dhp4GmzUwPrBnm+bd7bXnnWw== X-Received: by 2002:a7b:cc04:: with SMTP id f4mr1401940wmh.16.1544458677060; Mon, 10 Dec 2018 08:17:57 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a1c:c7cc:: with SMTP id x195ls1855657wmf.4.canary-gmail; Mon, 10 Dec 2018 08:17:56 -0800 (PST) X-Received: by 2002:a1c:a485:: with SMTP id n127mr11531152wme.15.1544458676650; Mon, 10 Dec 2018 08:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544458676; cv=none; d=google.com; s=arc-20160816; b=ntp2CLwxH0l4VgPs/JqhudopkRfgu4BteuCDB/CdVFRA5MVlDoF/gFO+dLPPKbjfRT d5krrdHlzOHMs2wMW2KViBkMrwWk+RZ9oKBF2NMt869qdxBE3rzf7szJ5q45MSh5z6k+ KbQT+62q3ytD5cXFxuPAAlpR0c7iirei7etteYzIjP1LXS8BUdP9kkiJwOCRurFt8nrz lwc6nxinMbunAtxYmyhV8OKCuYdfGK8Q7yuvRykD6oiGukae3HD2DXZkSXU+1RobEHG7 EEF+1ouVNFQF51BL6AHEg00G2s2iOzPzyMGwbBZLUMJ4bdcExTUfFebKwwwrb3D7Rntd fG2A== 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=TxNgORGPoSCn3Oq9HEn9GoMFiwahxDYqmWRf1K3P8O8=; b=wQEP4Qun8588VQ+Isy4plGfHFlrSiVBRCKdqcx0mwDF86d/qDYdFaasx5QkdVHvWvP pAH/iRbSYr2tggiLuRZLLrB49uRoNUYyvfW7kDg1CJg7IyUz+DiPn2cE/E7SlTO/Sljq O/I/JNlZYhsmLgMG96owc/ZnAiJ1MxYpeo9g2EG+cknzboSR2XF/1Jkd4TysDnASKjIW lEJ1x+r8c0tx36HkMu10lPryyZCAltbkArreznDMp4jc39a64k7DQnUb/EtQY7tUW+Jb SndBp//OkNrifaiFbAdz4KRambfQlmKoP/v8Th/N7XB1SRSp0V9685zvMb43hovI0w3n 9V3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lvquzrG0; 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 o4sor7564439wrj.2.2018.12.10.08.17.56 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 10 Dec 2018 08:17:56 -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:a5d:4c8a:: with SMTP id z10mr10124004wrs.75.1544458676335; Mon, 10 Dec 2018 08:17:56 -0800 (PST) Received: from localhost.localdomain (ip-162-59.sn-213-198.clouditalia.com. [213.198.162.59]) by smtp.gmail.com with ESMTPSA id b13sm8397503wrn.28.2018.12.10.08.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:17:55 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org> Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Michael Trimarchi <michael@amarulasolutions.com>, linux-sunxi <linux-sunxi@googlegroups.com>, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v5 07/17] drm/sun4i: sun6i_mipi_dsi: Refactor vertical video start delay Date: Mon, 10 Dec 2018 21:47:19 +0530 Message-Id: <20181210161729.29720-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20181210161729.29720-1-jagan@amarulasolutions.com> References: <20181210161729.29720-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lvquzrG0; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
drm/sun4i: Allwinner A64 MIPI-DSI support
|
|
Commit Message
Jagan Teki
Dec. 10, 2018, 4:17 p.m. UTC
Video start delay can be computed by subtracting total vertical
timing with front porch timing and with adding 1 delay line for TCON.
BSP code form BPI-M64-bsp is computing video start delay as
(from linux-sunxi/
drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c)
u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp;
=> (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp)
=> (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y)
- panel->lcd_y - (panel->lcd_vbp)
=> timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y
- panel->lcd_y - panel->lcd_vbp
=> timmings->ver_front_porch
So, update the start delay computation accordingly.
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Comments
On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > Video start delay can be computed by subtracting total vertical > timing with front porch timing and with adding 1 delay line for TCON. > > BSP code form BPI-M64-bsp is computing video start delay as > (from linux-sunxi/ > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > - panel->lcd_y - (panel->lcd_vbp) > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > - panel->lcd_y - panel->lcd_vbp > => timmings->ver_front_porch > > So, update the start delay computation accordingly. > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Even though it's a bit better now on my A33 board and I don't have the white stripes on the bottom of the display, there's still some flickering with your patches applied. Bisecting it seems to point at that patch, but reverting it doesn't make the issue go away, so it's not really clear which one exactly is at fault. So, just like I asked in your v4, twice, http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/615339.html > Since the documentation is quite sparse, and a MIPI-DSI analyzer is > way too expensive, I'd really like to have at least what each of > these commits are actually fixing, and what symptoms each of these > were causing, and not just "the BSP does it". Maxime
On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > Video start delay can be computed by subtracting total vertical > > timing with front porch timing and with adding 1 delay line for TCON. > > > > BSP code form BPI-M64-bsp is computing video start delay as > > (from linux-sunxi/ > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > - panel->lcd_y - (panel->lcd_vbp) > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > - panel->lcd_y - panel->lcd_vbp > > => timmings->ver_front_porch > > > > So, update the start delay computation accordingly. > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > Even though it's a bit better now on my A33 board and I don't have the > white stripes on the bottom of the display, there's still some > flickering with your patches applied. > > Bisecting it seems to point at that patch, but reverting it doesn't > make the issue go away, so it's not really clear which one exactly is > at fault. > > So, just like I asked in your v4, twice, > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/615339.html I don't know how can I comment here. Not quite clearly understand your setup, because I have verified 3 different panels from different vendors one with 2-lane, another with 4-lane and one with video format and another one is burstmode format. I even verified with the clock rate and register details. Please suggest me, what can look further on this.
Hi Maxime, On Tue, Dec 11, 2018 at 10:30 PM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > <maxime.ripard@bootlin.com> wrote: > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > Video start delay can be computed by subtracting total vertical > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > (from linux-sunxi/ > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > - panel->lcd_y - (panel->lcd_vbp) > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > - panel->lcd_y - panel->lcd_vbp > > > => timmings->ver_front_porch > > > > > > So, update the start delay computation accordingly. > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Even though it's a bit better now on my A33 board and I don't have the > > white stripes on the bottom of the display, there's still some > > flickering with your patches applied. > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > make the issue go away, so it's not really clear which one exactly is > > at fault. > > > > So, just like I asked in your v4, twice, > > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/615339.html > > I don't know how can I comment here. Not quite clearly understand your > setup, because I have verified 3 different panels from different > vendors one with 2-lane, another with 4-lane and one with video format > and another one is burstmode format. I even verified with the clock > rate and register details. > > Please suggest me, what can look further on this. From the BSP point-of-view I couldn't find have any difference in start_delay computation between A64, and A33[1]. In fact the driver initialization code is same, here is A64 dsi driver[2]. 1) The only difference that I observe is dsi_gen_wr in BSP [3], the A33 is right shifting message tx length to 0, 8 for first and next packet where as A64 did the same by adding +1 before. Please try to check that If your panel is using long write. and 2) Also every dsi transaction in A33 occupy some delay code in dsi_gen_wr[4], please check the same. and 3) Also If possible please check your panel timings or initialization sequence, because I don't have any panel with A33. 4) other than these I have didn't notice any differences atleast from my knowledge, Please suggest me where can I look further. [1] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L813 [2] https://github.com/BPI-SINOVOIP/BPI-M64-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c [3] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L402 [4] https://github.com/BPI-SINOVOIP/BPI-M2M-bsp/blob/master/linux-sunxi/drivers/video/sunxi/disp/de/lowlevel_sun8iw5/de_dsi.c#L378
On Tue, Dec 11, 2018 at 10:30:08PM +0530, Jagan Teki wrote: > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > <maxime.ripard@bootlin.com> wrote: > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > Video start delay can be computed by subtracting total vertical > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > (from linux-sunxi/ > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > - panel->lcd_y - (panel->lcd_vbp) > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > - panel->lcd_y - panel->lcd_vbp > > > => timmings->ver_front_porch > > > > > > So, update the start delay computation accordingly. > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Even though it's a bit better now on my A33 board and I don't have the > > white stripes on the bottom of the display, there's still some > > flickering with your patches applied. > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > make the issue go away, so it's not really clear which one exactly is > > at fault. > > > > So, just like I asked in your v4, twice, > > > > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/615339.html > > I don't know how can I comment here. Not quite clearly understand your > setup, because I have verified 3 different panels from different > vendors one with 2-lane, another with 4-lane and one with video format > and another one is burstmode format. I even verified with the clock > rate and register details. > > Please suggest me, what can look further on this. You had a reason to do these patches in the first place, yet you never mention it anywhere in your commit logs. it would address the first part of my comment. And I can help you nail down whatever is going on here, but I would need the panel datasheet for that. It is my second point. Maxime
On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > Video start delay can be computed by subtracting total vertical > > timing with front porch timing and with adding 1 delay line for TCON. > > > > BSP code form BPI-M64-bsp is computing video start delay as > > (from linux-sunxi/ > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > - panel->lcd_y - (panel->lcd_vbp) > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > - panel->lcd_y - panel->lcd_vbp > > => timmings->ver_front_porch > > > > So, update the start delay computation accordingly. > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > Even though it's a bit better now on my A33 board and I don't have the > white stripes on the bottom of the display, there's still some > flickering with your patches applied. > > Bisecting it seems to point at that patch, but reverting it doesn't > make the issue go away, so it's not really clear which one exactly is > at fault. Is reverting this patch, work fine or not? This patch is trying to make use of front porch instead of existing back porch to compute the delay. Since we revert the VBP fix patch[1] to assume VBP as VFP value look like your setup would also require to revert this change. But as per BSP or drm_mode details all of my displays even work with and w/o reverting these two. I'm thinking your display should work in the same behavior since the dsi controller making this route. [1] https://patchwork.kernel.org/patch/10680309/
On Fri, Dec 21, 2018 at 2:26 AM Jagan Teki <jagan@amarulasolutions.com> wrote: > > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > <maxime.ripard@bootlin.com> wrote: > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > Video start delay can be computed by subtracting total vertical > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > (from linux-sunxi/ > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > - panel->lcd_y - (panel->lcd_vbp) > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > - panel->lcd_y - panel->lcd_vbp > > > => timmings->ver_front_porch > > > > > > So, update the start delay computation accordingly. > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Even though it's a bit better now on my A33 board and I don't have the > > white stripes on the bottom of the display, there's still some > > flickering with your patches applied. > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > make the issue go away, so it's not really clear which one exactly is > > at fault. > > Is reverting this patch, work fine or not? > > This patch is trying to make use of front porch instead of existing > back porch to compute the delay. Since we revert the VBP fix patch[1] > to assume VBP as VFP value look like your setup would also require to > revert this change. But as per BSP or drm_mode details all of my > displays even work with and w/o reverting these two. > > I'm thinking your display should work in the same behavior since the > dsi controller making this route. Any further comments on this?
On Fri, Dec 21, 2018 at 02:26:11AM +0530, Jagan Teki wrote: > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > <maxime.ripard@bootlin.com> wrote: > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > Video start delay can be computed by subtracting total vertical > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > (from linux-sunxi/ > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > - panel->lcd_y - (panel->lcd_vbp) > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > - panel->lcd_y - panel->lcd_vbp > > > => timmings->ver_front_porch > > > > > > So, update the start delay computation accordingly. > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Even though it's a bit better now on my A33 board and I don't have the > > white stripes on the bottom of the display, there's still some > > flickering with your patches applied. > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > make the issue go away, so it's not really clear which one exactly is > > at fault. > > Is reverting this patch, work fine or not? As I was saying, it doesn't. > This patch is trying to make use of front porch instead of existing > back porch to compute the delay. Since we revert the VBP fix patch[1] > to assume VBP as VFP value look like your setup would also require to > revert this change. But as per BSP or drm_mode details all of my > displays even work with and w/o reverting these two. Again, I cannot help you without the datasheet for the panels you're trying to submit. Maxime
On Mon, Jan 7, 2019 at 7:42 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Fri, Dec 21, 2018 at 02:26:11AM +0530, Jagan Teki wrote: > > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > > <maxime.ripard@bootlin.com> wrote: > > > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > > Video start delay can be computed by subtracting total vertical > > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > > (from linux-sunxi/ > > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > > - panel->lcd_y - (panel->lcd_vbp) > > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > > - panel->lcd_y - panel->lcd_vbp > > > > => timmings->ver_front_porch > > > > > > > > So, update the start delay computation accordingly. > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > Even though it's a bit better now on my A33 board and I don't have the > > > white stripes on the bottom of the display, there's still some > > > flickering with your patches applied. > > > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > > make the issue go away, so it's not really clear which one exactly is > > > at fault. > > > > Is reverting this patch, work fine or not? > > As I was saying, it doesn't. > > > This patch is trying to make use of front porch instead of existing > > back porch to compute the delay. Since we revert the VBP fix patch[1] > > to assume VBP as VFP value look like your setup would also require to > > revert this change. But as per BSP or drm_mode details all of my > > displays even work with and w/o reverting these two. > > Again, I cannot help you without the datasheet for the panels you're > trying to submit. The panel bound with Sitronix ST7701 IC http://www.startek-lcd.com/res/starteklcd/pdres/201705/20170512144242904.pdf
On Mon, Jan 07, 2019 at 08:48:21PM +0530, Jagan Teki wrote: > On Mon, Jan 7, 2019 at 7:42 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > On Fri, Dec 21, 2018 at 02:26:11AM +0530, Jagan Teki wrote: > > > On Tue, Dec 11, 2018 at 10:19 PM Maxime Ripard > > > <maxime.ripard@bootlin.com> wrote: > > > > > > > > On Mon, Dec 10, 2018 at 09:47:19PM +0530, Jagan Teki wrote: > > > > > Video start delay can be computed by subtracting total vertical > > > > > timing with front porch timing and with adding 1 delay line for TCON. > > > > > > > > > > BSP code form BPI-M64-bsp is computing video start delay as > > > > > (from linux-sunxi/ > > > > > drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_dsi.c) > > > > > > > > > > u32 vfp = panel->lcd_vt - panel->lcd_y - panel->lcd_vbp; > > > > > => (panel->lcd_vt) - panel->lcd_y - (panel->lcd_vbp) > > > > > => (timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y) > > > > > - panel->lcd_y - (panel->lcd_vbp) > > > > > => timmings->ver_front_porch + panel->lcd_vbp + panel->lcd_y > > > > > - panel->lcd_y - panel->lcd_vbp > > > > > => timmings->ver_front_porch > > > > > > > > > > So, update the start delay computation accordingly. > > > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > > > Even though it's a bit better now on my A33 board and I don't have the > > > > white stripes on the bottom of the display, there's still some > > > > flickering with your patches applied. > > > > > > > > Bisecting it seems to point at that patch, but reverting it doesn't > > > > make the issue go away, so it's not really clear which one exactly is > > > > at fault. > > > > > > Is reverting this patch, work fine or not? > > > > As I was saying, it doesn't. > > > > > This patch is trying to make use of front porch instead of existing > > > back porch to compute the delay. Since we revert the VBP fix patch[1] > > > to assume VBP as VFP value look like your setup would also require to > > > revert this change. But as per BSP or drm_mode details all of my > > > displays even work with and w/o reverting these two. > > > > Again, I cannot help you without the datasheet for the panels you're > > trying to submit. > > The panel bound with Sitronix ST7701 IC > http://www.startek-lcd.com/res/starteklcd/pdres/201705/20170512144242904.pdf It's the controller, not the panel Maxime
diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index c9b0222ebcd4..cb41fea4f3ee 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -358,7 +358,17 @@ static void sun6i_dsi_inst_init(struct sun6i_dsi *dsi, static u16 sun6i_dsi_get_video_start_delay(struct sun6i_dsi *dsi, struct drm_display_mode *mode) { - return mode->vtotal - (mode->vsync_end - mode->vdisplay) + 1; + u32 vfp = mode->vsync_start - mode->vdisplay; + u32 start_delay; + + start_delay = mode->vtotal - vfp + 1; + if (start_delay > mode->vtotal) + start_delay -= mode->vtotal; + + if (!start_delay) + start_delay = 1; + + return start_delay; } static void sun6i_dsi_setup_burst(struct sun6i_dsi *dsi,