lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <224ec158bf627b4d2f577b1dadf10bd87891e2a7.camel@paulk.fr>
Date:   Tue, 23 Oct 2018 11:33:10 +0200
From:   Paul Kocialkowski <contact@...lk.fr>
To:     Maxime Ripard <maxime.ripard@...tlin.com>
Cc:     devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Chen-Yu Tsai <wens@...e.org>,
        Thierry Reding <thierry.reding@...il.com>,
        David Airlie <airlied@...ux.ie>, linux-sunxi@...glegroups.com,
        Mark Van den Borre <mark@...dem.org>,
        Gerry Demaret <gerry@...dem.org>,
        Luc Verhaegen <libv@...net.be>
Subject: Re: [PATCH 1/4] drm/sun4i: tcon: Support an active-low DE signal
 with RGB interface

Hi,

Le mercredi 10 octobre 2018 à 16:57 +0200, Maxime Ripard a écrit :
> On Wed, Oct 10, 2018 at 01:41:31PM +0200, Paul Kocialkowski wrote:
> > Some panels need an active-low data enable (DE) signal for the RGB
> > interface. This requires flipping a bit in the TCON0 polarity register
> > when setting up the mode for the RGB interface.
> > 
> > Add a new helper function to match specific bus flags and use it to set
> > the polarity inversion bit for the DE signal when required.
> > 
> > Signed-off-by: Paul Kocialkowski <contact@...lk.fr>
> > ---
> >  drivers/gpu/drm/sun4i/sun4i_tcon.c | 28 ++++++++++++++++++++++++++--
> >  drivers/gpu/drm/sun4i/sun4i_tcon.h |  1 +
> >  2 files changed, 27 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> > index 3fb084f802e2..d249a462ec09 100644
> > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> > @@ -78,6 +78,24 @@ static int sun4i_tcon_get_pixel_depth(const struct drm_encoder *encoder)
> >  	return -EINVAL;
> >  }
> >  
> > +static bool sun4i_tcon_match_bus_flags(const struct drm_encoder *encoder,
> > +				       u32 bus_flags)
> > +{
> > +	struct drm_connector *connector;
> > +	struct drm_display_info *info;
> > +
> > +	connector = sun4i_tcon_get_connector(encoder);
> > +	if (!connector)
> > +		return false;
> > +
> > +	info = &connector->display_info;
> > +
> > +	if ((info->bus_flags & bus_flags) == bus_flags)
> > +		return true;
> > +
> > +	return false;
> > +}
> > +
> >  static void sun4i_tcon_channel_set_status(struct sun4i_tcon *tcon, int channel,
> >  					  bool enabled)
> >  {
> > @@ -415,6 +433,7 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon,
> >  }
> >  
> >  static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> > +				     const struct drm_encoder *encoder,
> >  				     const struct drm_display_mode *mode)
> >  {
> >  	unsigned int bp, hsync, vsync;
> > @@ -474,8 +493,13 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
> >  	if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> >  		val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
> >  
> > +	if (sun4i_tcon_match_bus_flags(encoder, DRM_BUS_FLAG_DE_LOW))
> > +		val |= SUN4I_TCON0_IO_POL_DE_NEGATIVE;
> > +
> 
> There's other flags in use in that function, you should also migrate
> them (ideally by splitting that new function into a separate patch).

Actually, these other flags are not DRM bus flags but DRM mode flags,
which can be accessed directly from the mode pointer passed as
argument. Thus, they don't require a helper.

If you'd like, I could still split this patch into one introducing the
helper and one using it for checking the DE_LOW flag.

What do you think?

Cheers,

Paul

-- 
Developer of free digital technology and hardware support.

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ