[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170509201919.ubzhiyntdwf6wlog@lukather>
Date: Tue, 9 May 2017 22:19:19 +0200
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Icenowy Zheng <icenowy@...c.io>
Cc: linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-sunxi@...glegroups.com, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, Chen-Yu Tsai <wens@...e.org>,
Rob Herring <robh+dt@...nel.org>, linux-clk@...r.kernel.org
Subject: Re: [PATCH v6 08/13] drm/sun4i: add support for Allwinner DE2 mixers
On Fri, May 05, 2017 at 08:39:31PM +0800, Icenowy Zheng wrote:
> >> > > + /* 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.
>
> Are they these two lines:
> ```
> paddr += (state->src_x >> 16) * bpp;
> paddr += (state->src_y >> 16) * fb->pitches[0];
> ```
>
> I think I copied them here, so I don't need to mind this problem any
> more, right?
Hmmm, yes, probably. That's pretty easy to test anyway, you just need
to set up a plane with a negative base coordinate.
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