Glamo Speed Improvement(s) direcfb

Thomas White taw at bitwiz.org.uk
Sun Nov 22 20:39:53 CET 2009


On Sun, 22 Nov 2009 19:00:15 +0100
mobi phil <mobi at mobiphil.com> wrote:

> I assume that you have a very good understanding of the 2D glamo
> commands. I wonder if you would have time to write a short story how
> the glamo register story works. I am looking at
> xf86-video-glamo.git/src/glamo-draw.c, and it seems that for example
> for drawing a solid (GLAMOExaSolid), different OUT_REG sequences are
> used than in gdrm-waitq.c ...

gdrm-waitq (also gdrm-burst-cmdq and Mesa) use burst commands instead
of individual commands for sending instructions.  A sequence of
individual commands consists of a series of registers and contents -
two 16-bit values per command.  A burst command is a single register
followed by a sequence of values, which go into consecutive registers.
So to work out what the sequence does, look at the register list in the
glamo-regs.h header, and start counting up from the address specified
in glamoDRMStartBurst.  A buffer object (glamoDRMAddBO) fills in two
registers, hence four bytes (a high and low value is needed).

To answer specifically:

>       glamoDRMAddData(gCtx, 960 & 0x7ff, 2);   //??

This is the destination buffer pitch, which is the depth (in bytes)
multiplied by the width.

>       glamoDRMAddData(gCtx, y2, 2);
>       glamoDRMAddData(gCtx, x2, 2);

These should be the destination buffer width and height (in that order
- not what you have currently).

>       glamoDRMAddData(gCtx, 640, 2);  //??

Width and height of the rectangle.  You seem to be missing the width.,
which should go before this.

>       glamoDRMAddData(gCtx, 0x0000, 2);  //??
>       glamoDRMAddData(gCtx, 0x0000, 2); //??

Pattern base address, which isn't used for now.  If you did, you'd need
to use a glamoDRMAddBO here.

>       glamoDRMAddData(gCtx, col, 2);

Pattern foreground colour.  Background colour would be next if you were
using a pattern.

Then there's a whole load of mask, rotation and clipping stuff, all
currently unused.  To avoid having to send a load of zeroes to the
hardware, we just start a new burst submission for sending the actual
command to do a bitblit.

Sorry that you found the example program where I was lazy and didn't
add comments to label the registers.  Hope that explains it.

Tom

-- 
Thomas White <taw at bitwiz.org.uk>



More information about the devel mailing list