public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Chen-Yu Tsai <wens@csie.org>
Cc: Mike Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Mark Rutland <mark.rutland@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	linux-clk <linux-clk@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>
Subject: Re: [linux-sunxi] [PATCH 13/15] drm/sun4i: Add HDMI support
Date: Wed, 3 May 2017 10:41:38 +0200	[thread overview]
Message-ID: <20170503084138.rye2i6qd4ghxifep@lukather> (raw)
In-Reply-To: <CAGb2v67Szt9Xj+hwJD6i9X0XgXOtZBS1Jy4wWjbfSGJSDFM1NQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4046 bytes --]

On Wed, Apr 26, 2017 at 03:59:28PM +0800, Chen-Yu Tsai wrote:
> >> > +       writel(SUN4I_HDMI_VID_TIMING_X(mode->hdisplay) |
> >> > +              SUN4I_HDMI_VID_TIMING_Y(mode->vdisplay),
> >> > +              hdmi->base + SUN4I_HDMI_VID_TIMING_ACT_REG);
> >> > +
> >> > +       x = mode->htotal - mode->hsync_start;
> >> > +       y = mode->vtotal - mode->vsync_start;
> >>
> >> I'm a bit skeptical about this one. All the other parameters are not
> >> inclusive of other, why would this one be different? Shouldn't it
> >> be "Xtotal - Xsync_end" instead?
> >
> > By the usual meaning of backporch, you're right. However, Allwinner's
> > seems to have it's own, which is actually the backporch + sync length.
> >
> > We also have that on all the other connectors (and TCON), and this was
> > confirmed at the time using a scope on an RGB signal.
> 
> Yes. On the later SoCs such as the A31, the user manual actually has
> timing diagrams showing this.
> 
> Unlike the TCON, the HDMI controller's timings lists the front porch
> separately, instead of an all inclusive Xtotal. This is what made me
> look twice. This should be easy to confirm though. Since the HDMI modes
> are well known and can be exactly reproduced on our hardware, we can
> just check for any distortions or refresh rate errors.

This isn't as trivial as that. Screens usually have some tolerancies
on the timings, which will probably make it go unnoticed, even though
they are wrong.

> >>
> >> > +       writel(SUN4I_HDMI_VID_TIMING_X(x) | SUN4I_HDMI_VID_TIMING_Y(y),
> >> > +              hdmi->base + SUN4I_HDMI_VID_TIMING_BP_REG);
> >> > +
> >> > +       x = mode->hsync_start - mode->hdisplay;
> >> > +       y = mode->vsync_start - mode->vdisplay;
> >> > +       writel(SUN4I_HDMI_VID_TIMING_X(x) | SUN4I_HDMI_VID_TIMING_Y(y),
> >> > +              hdmi->base + SUN4I_HDMI_VID_TIMING_FP_REG);
> >> > +
> >> > +       x = mode->hsync_end - mode->hsync_start;
> >> > +       y = mode->vsync_end - mode->vsync_start;
> >> > +       writel(SUN4I_HDMI_VID_TIMING_X(x) | SUN4I_HDMI_VID_TIMING_Y(y),
> >> > +              hdmi->base + SUN4I_HDMI_VID_TIMING_SPW_REG);
> >> > +
> >> > +       val = SUN4I_HDMI_VID_TIMING_POL_TX_CLK;
> >> > +       if (mode->flags & DRM_MODE_FLAG_PHSYNC)
> >> > +               val |= SUN4I_HDMI_VID_TIMING_POL_HSYNC;
> >> > +
> >> > +       if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> >> > +               val |= SUN4I_HDMI_VID_TIMING_POL_VSYNC;
> >> > +
> >> > +       writel(val, hdmi->base + SUN4I_HDMI_VID_TIMING_POL_REG);
> >>
> >> You don't handle the interlaced video here, even though you set
> >>
> >>     hdmi->connector.interlace_allowed = true
> >>
> >> later.
> >
> > I'll fix that.
> >
> >> The double clock and double scan flags aren't handled either, though
> >> I don't understand which one is supposed to represent the need for the
> >> HDMI pixel repeater. AFAIK this is required for resolutions with pixel
> >> clocks lower than 25 MHz, the lower limit of HDMI's TMDS link.
> >
> > I'm not sure about this one though. I'd like to keep things quite
> > simple for now and build up on that once the basis is working. Is it
> > common in the wild?
> 
> If you drive the display at SDTV resolutions, then yes. Mode lines from
> my HDMI monitor:
> 
>   720x576i 50 720 732 795 864 576 580 586 625 flags: nhsync, nvsync,
> interlace, dblclk; type: driver
>   720x480i 60 720 739 801 858 480 488 494 525 flags: nhsync, nvsync,
> interlace, dblclk; type: driver
>   720x480i 60 720 739 801 858 480 488 494 525 flags: nhsync, nvsync,
> interlace, dblclk; type: driver
> 
> AFAIK these are standard modes that all devices should support. Whether
> they are used daily is another thing. Maybe block modes with dblclk
> in .mode_fixup for now?

That would rather be atomic_check and / or mode_valid, but yeah, I can
do that.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2017-05-03  8:41 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07  8:56 [PATCH 0/15] drm: sun4i: Add support for the HDMI controller Maxime Ripard
2017-03-07  8:56 ` [PATCH 1/15] clk: divider: Make divider_round_rate take the parent clock Maxime Ripard
2017-03-07 14:11   ` Stephen Boyd
2017-03-09 10:55     ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 2/15] clk: sunxi-ng: Pass the parent and a pointer to the clocks round rate Maxime Ripard
2017-03-07  8:56 ` [PATCH 3/15] clk: sunxi-ng: div: Switch to divider_round_rate Maxime Ripard
2017-03-07  8:56 ` [PATCH 4/15] clk: sunxi-ng: mux: Don't just rely on the parent for CLK_SET_RATE_PARENT Maxime Ripard
2017-03-07  8:56 ` [PATCH 5/15] clk: sunxi-ng: sun5i: Export video PLLs Maxime Ripard
2017-03-07 10:21   ` [linux-sunxi] " Julian Calaby
2017-03-08  8:58     ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 6/15] dt-bindings: display: sun4i: Add HDMI display bindings Maxime Ripard
2017-03-08  3:39   ` Chen-Yu Tsai
2017-03-15 17:26   ` Rob Herring
2017-04-03 20:59     ` Maxime Ripard
2017-05-03  3:27   ` Chen-Yu Tsai
2017-03-07  8:56 ` [PATCH 7/15] dt-bindings: display: sun4i: Add allwinner,tcon-channel property Maxime Ripard
2017-03-08  3:38   ` Chen-Yu Tsai
2017-03-15 17:37   ` Rob Herring
2017-03-17  3:34     ` Chen-Yu Tsai
2017-03-26 21:11       ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 8/15] drm/sun4i: tcon: Add channel debug Maxime Ripard
2017-03-08  3:37   ` Chen-Yu Tsai
2017-03-07  8:56 ` [PATCH 9/15] drm/sun4i: tcon: Pass the encoder to the mode set functions Maxime Ripard
2017-03-07  8:56 ` [PATCH 10/15] drm/sun4i: tcon: Switch mux on only for composite Maxime Ripard
2017-03-08  3:51   ` Chen-Yu Tsai
2017-03-08  4:16     ` Stefan Monnier
2017-03-09 10:58     ` Maxime Ripard
2017-03-09 11:31       ` [linux-sunxi] " Chen-Yu Tsai
2017-03-09 14:55         ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 11/15] drm/sun4i: tcon: Fix tcon channel 1 backporch calculation Maxime Ripard
2017-03-08  4:25   ` Chen-Yu Tsai
2017-03-08  8:55     ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 12/15] drm/sun4i: tcon: multiply the vtotal when not in interlace Maxime Ripard
2017-03-07 10:05   ` Chen-Yu Tsai
2017-03-09 10:54     ` Maxime Ripard
2017-03-07  8:56 ` [PATCH 13/15] drm/sun4i: Add HDMI support Maxime Ripard
2017-04-21 15:17   ` [linux-sunxi] " Chen-Yu Tsai
2017-04-26  6:50     ` Maxime Ripard
2017-04-26  7:59       ` Chen-Yu Tsai
2017-05-03  8:41         ` Maxime Ripard [this message]
2017-03-07  8:56 ` [PATCH 14/15] ARM: sun5i: a10s: Add the HDMI controller node Maxime Ripard
2017-03-08  3:35   ` [linux-sunxi] " Chen-Yu Tsai
2017-03-09 10:59     ` Maxime Ripard
2017-03-09 11:10       ` Chen-Yu Tsai
2017-03-07  8:56 ` [PATCH 15/15] ARM: sun5i: a10s-olinuxino: Enable HDMI Maxime Ripard
2017-03-08  3:36   ` Chen-Yu Tsai

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=20170503084138.rye2i6qd4ghxifep@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.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