From: Icenowy Zheng <icenowy@aosc.io>
To: Jagan Teki <jagan@amarulasolutions.com>
Cc: David Airlie <airlied@linux.ie>,
linux-sunxi <linux-sunxi@googlegroups.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Chen-Yu Tsai <wens@csie.org>, Maxime Ripard <mripard@kernel.org>,
Daniel Vetter <daniel@ffwll.ch>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [linux-sunxi] [PATCH 3/3] Revert "drm/sun4i: dsi: Rework a bit the hblk calculation"
Date: Sun, 06 Oct 2019 22:44:25 +0800 [thread overview]
Message-ID: <58dc94b6371ab2f5b11b13ab707d73ab3fc4cc64.camel@aosc.io> (raw)
In-Reply-To: <CAMty3ZDW4XHyW+6XL_RSVHqTSk79-r749pa0n5e6VbUzowAsiw@mail.gmail.com>
在 2019-10-03四的 09:53 +0530,Jagan Teki写道:
> Hi Wens,
>
> On Tue, Oct 1, 2019 at 1:34 PM Icenowy Zheng <icenowy@aosc.io> 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 <icenowy@aosc.io>
> > ---
> > 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).
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-10-06 14:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 8:02 [PATCH 0/3] drm/sun4i: dsi: misc timing fixes Icenowy Zheng
2019-10-01 8:02 ` [PATCH 1/3] Revert "drm/sun4i: dsi: Change the start delay calculation" Icenowy Zheng
2019-10-03 7:08 ` [linux-sunxi] " Jagan Teki
2019-10-03 13:19 ` Maxime Ripard
2019-10-03 13:21 ` Icenowy Zheng
2019-10-03 13:34 ` Maxime Ripard
2019-10-01 8:02 ` [PATCH 2/3] drm/sun4i: dsi: fix DRQ calculation Icenowy Zheng
2019-10-03 4:37 ` [linux-sunxi] " Jagan Teki
2019-10-01 8:02 ` [PATCH 3/3] Revert "drm/sun4i: dsi: Rework a bit the hblk calculation" Icenowy Zheng
2019-10-03 4:23 ` [linux-sunxi] " Jagan Teki
2019-10-06 14:44 ` Icenowy Zheng [this message]
2019-10-06 15:12 ` Icenowy Zheng
2019-10-07 15:19 ` Ondřej Jirman
2019-10-02 10:36 ` [PATCH 0/3] drm/sun4i: dsi: misc timing fixes Maxime Ripard
2019-10-03 3:58 ` Icenowy Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58dc94b6371ab2f5b11b13ab707d73ab3fc4cc64.camel@aosc.io \
--to=icenowy@aosc.io \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagan@amarulasolutions.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mripard@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).