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]
Date:   Fri, 5 May 2017 14:36:18 +0200
From:   Maxime Ripard <maxime.ripard@...e-electrons.com>
To:     icenowy@...c.io
Cc:     Rob Herring <robh+dt@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
        linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org, linux-sunxi@...glegroups.com
Subject: Re: [PATCH v6 08/13] drm/sun4i: add support for Allwinner DE2 mixers

On Fri, May 05, 2017 at 12:50:51AM +0800, icenowy@...c.io wrote:
> > > +void sun8i_mixer_layer_enable(struct sun8i_mixer *mixer,
> > > +				int layer, bool enable)
> > > +{
> > > +	u32 val;
> > > +	/* Currently the first UI channel is used */
> > > +	int chan = mixer->cfg->vi_num;
> > > +
> > > +	DRM_DEBUG_DRIVER("Enabling layer %d in channel %d\n", layer, chan);
> > > +
> > > +	if (enable)
> > > +		val = SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN;
> > > +	else
> > > +		val = 0;
> > > +
> > > +	regmap_update_bits(mixer->engine.regs,
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN, val);
> > > +
> > > +	/* Set the alpha configuration */
> > > +	regmap_update_bits(mixer->engine.regs,
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_MASK,
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_DEF);
> > > +	regmap_update_bits(mixer->engine.regs,
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR(chan, layer),
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MASK,
> > > +			   SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_DEF);
> > > +}
> > 
> > This one too.
> 
> It's called from sun8i_layer.c, so it cannot be static.

Fair enough.

> > > +	/* Set base coordinates */
> > > +	DRM_DEBUG_DRIVER("Layer coordinates X: %d Y: %d\n",
> > > +			 state->crtc_x, state->crtc_y);
> > > +	regmap_write(mixer->engine.regs,
> > > +		     SUN8I_MIXER_CHAN_UI_LAYER_COORD(chan, layer),
> > > +		     SUN8I_MIXER_COORD(state->crtc_x, state->crtc_y));
> > 
> > X and Y are fixed point numbers. You want to keep only the higher 16
> > bits there.
> 
> Do you mean "lower 16 bits"? Thus should I (x & 0xffff) or ((u16)x) ?

Nevermind, I got confused with src_x and src_y.

> P.S. The negative coordinates are broken, how should I deal with it? or
> is the coordinates promised to be not negative?

Adjust the buffer base address, and use a shorter line. You have such
an example in the sun4i code.

Maxime

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ