User avatar
Cycl0ne
Posts: 102
Joined: Mon Jun 25, 2012 8:03 am

Mailbox property interface->Suggestions

Fri Aug 03, 2012 12:43 am

Hi,

got some questions/featurerequest on this thing:

Can you add some RectFill/BlitOperations to these Properties?

And what about Interrupts? Can you make something like: i send a request to the mailbox and get a int back when its finished?
And what about Doublebuffering or Offside Buffers?

Thanks.

ps: to make some suggestions:
GetFreeVCMem -> Perhaps for an own calculation of the AllocOffSide Command, how many offside buffers one could keep?
AllocOffsideBuffer(width, height)
FreeOffsideBuffer(mem)
FillRect(x, y, x2, y2, color) // The color could be a PEN in BPP8 or a ColorVal in BPP15/16/24/32
Blit(DstMem, destx, desty, w, h, SrcMem, srcx. srcy, operation)

Operation Modes could be these:
#define ROP_COPY 0 /* src*/
#define ROP_XOR 1 /* src ^ dst*/
#define ROP_OR 2 /* src | dst (PAINT)*/
#define ROP_AND 3 /* src & dst (MASK)*/
#define ROP_CLEAR 4 /* 0*/
#define ROP_SET 5 /* ~0*/
#define ROP_EQUIV 6 /* ~(src ^ dst)*/
#define ROP_NOR 7 /* ~(src | dst)*/
#define ROP_NAND 8 /* ~(src & dst)*/
#define ROP_INVERT 9 /* ~dst*/
#define ROP_COPYINVERTED 10 /* ~src*/
#define ROP_ORINVERTED 11 /* ~src | dst*/
#define ROP_ANDINVERTED 12 /* ~src & dst (SUBTRACT)*/
#define ROP_ORREVERSE 13 /* src | ~dst*/
#define ROP_ANDREVERSE 14 /* src & ~dst*/
#define ROP_NOOP 15 /* dst*/
#define ROP_XOR_FGBG 16 /* src ^ background ^ dst (Java XOR mode)*/

/* Porter-Duff compositing operations. */
#define ROP_SRC_OVER 17 /* dst = alphablend src,dst*/
#define ROP_DST_OVER 18
#define ROP_SRC_IN 19
#define ROP_DST_IN 20
#define ROP_SRC_OUT 21
#define ROP_DST_OUT 22
#define ROP_SRC_ATOP 23
#define ROP_DST_ATOP 24
#define ROP_PORTERDUFF_XOR 25
#define ROP_SRCTRANSCOPY 26 /* copy src -> dst except for transparent color in src*/

VBPos -> Vertical Beam at end of the buffer (for doublebuffering)

User avatar
Cycl0ne
Posts: 102
Joined: Mon Jun 25, 2012 8:03 am

Re: Mailbox property interface->Suggestions

Fri Aug 03, 2012 8:17 am

Ohh I forgot:

Hardware cursor would be nice too.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5710
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Mailbox property interface->Suggestions

Fri Aug 03, 2012 9:49 am

Cycl0ne wrote: Can you add some RectFill/BlitOperations to these Properties?
DMA would be much less overhead (and as fast) for blits and fills. For blended ops, I'll think about it.
Cycl0ne wrote:And what about Interrupts? Can you make something like: i send a request to the mailbox and get a int back when its finished?
You get an interrupt when the mailbox becomes non-empty. See the Linux driver.
Cycl0ne wrote: And what about Doublebuffering or Offside Buffers?
You can do this. Create a double height virtual buffer, and toggle the y_offset between 0 and height.

User avatar
Cycl0ne
Posts: 102
Joined: Mon Jun 25, 2012 8:03 am

Re: Mailbox property interface->Suggestions

Fri Aug 03, 2012 10:54 am

dom wrote:
Cycl0ne wrote: Can you add some RectFill/BlitOperations to these Properties?
DMA would be much less overhead (and as fast) for blits and fills. For blended ops, I'll think about it.
But hasnt DMA the limitation of correct alignment of memory for that? will it be possible for the rectfill/blit to work on every BPP with every coordinate? And to go even further, what about blitting a rectangle of 0,0,10,10 to a position in screen 100,100. how should dma handle the correct rect in destbuffer (skipping the unneeded bytes). hmm, then it would have to go linewise in DMA or? Wouldnt that complicate the call? I can only see DMA perhaps for a full clearscreen, but for rectfills or blitting? :?
dom wrote:
Cycl0ne wrote:And what about Interrupts? Can you make something like: i send a request to the mailbox and get a int back when its finished?
You get an interrupt when the mailbox becomes non-empty. See the Linux driver.
I had a look at it, but the mechanism used is for the other mailbox with doorbell and such. does it also work for the Mailbox Property Interface? Just asking because in Linux something like this happens:
-> Place message in Mailbox
-> Ring bell
-> Get a Bell (interrupt) that a Message has been processed and is lying in your response mailbox.

or do you mean with "mailbox non empty" my response mailbox?
dom wrote:
Cycl0ne wrote: And what about Doublebuffering or Offside Buffers?
You can do this. Create a double height virtual buffer, and toggle the y_offset between 0 and height.
Ok that sounds good. What about offside buffers? Where I could use the blitter to copy pieces of graphics to the mainbuffer? Or could i just create a 4 times virtual buffer and copy parts from virtual to phys? (if there ever existed a blitter command in future). I assume the VC can only blit from its own memory to its own memory or?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5710
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Mailbox property interface->Suggestions

Sat Aug 04, 2012 11:07 am

Cycl0ne wrote: But hasnt DMA the limitation of correct alignment of memory for that? will it be possible for the rectfill/blit to work on every BPP with every coordinate? And to go even further, what about blitting a rectangle of 0,0,10,10 to a position in screen 100,100. how should dma handle the correct rect in destbuffer (skipping the unneeded bytes). hmm, then it would have to go linewise in DMA or? Wouldnt that complicate the call? I can only see DMA perhaps for a full clearscreen, but for rectfills or blitting? :?
It can handle arbitrary 8-bit alignment, and with two dimensional DMAs, so can do arbitrary blits/fills for 8bpp or higher modes.

valtonia
Posts: 26
Joined: Wed Jul 04, 2012 9:09 pm

Re: Mailbox property interface->Suggestions

Sat Aug 04, 2012 2:02 pm

Hey @dom,

Do you have any example code for doing arbitrary 8-bit alignment DMA? From the doc's I could only see 32 bit or 128 bit, and I couldn't get the 32 bit to work correctly.

Cheers,
V.

Return to “Bare metal, Assembly language”