This is proposed content for LibGGI headers, to centrally supply
GGI-Project-specific definitions for use in batchops (which initially
will only be in LibBlt, as a proof of concept).
For those that haven't been reading up, a batchop is, as
far as the GGI Project is concerned at least, a cross between
an emulated generic command fifo and a display list. I'm trying to
be thorough here, so please tell me if you notice something I have missed.
/* OPcodes */
GGI_OP_GET 0x10000000 /* Flag, gets data from target */
GGI_OP_OWNER_MASK 0x0fff0000 /* What extension owns this
GGI_OP_OWNER_GGI 0x00000000 /* GGI primitives */
GGI_OP_OWNER_USER 0x0fff0000 /* Will never be allocated */
/* The rest of the extensions will define their owner codes and opcodes
* in their own headers. A registry is kept here, but in comment form
* so as to reduce revision requirements between LibGGI and extensions.
=======================================================================
OPCODE REGISTRY:
GGI_OP_OWNER_BUF 0x00010000 Owned/defined by LibBuf
GGI_OP_OWNER_MISC 0x00020000 Owned/defined by LibGGIMisc
GGI_OP_OWNER_OVL 0x00030000 Owned/defined by LibOvl
GGI_OP_OWNER_BLT 0x00040000 Owned/defined by LibBlt
=======================================================================
*/
/* Now, values for GGI's own opcodes */
GGI_OP_DRAWPIXEL 0x00000001 /* drawops.drawpixel */
GGI_OP_PUTPIXEL 0x00000002 /* drawops.putpixel */
GGI_OP_DRAWHLINE 0x00000003 /* drawops.drawhline */
GGI_OP_PUTHLINE 0x00000004 /* drawops.puthline */
GGI_OP_DRAWVLINE 0x00000005 /* drawops.drawvline */
GGI_OP_PUTVLINE 0x00000006 /* drawops.putvline */
GGI_OP_DRAWBOX 0x00000007 /* drawops.drawbox */
GGI_OP_PUTBOX 0x00000008 /* drawops.putbox */
GGI_OP_DRAWLINE 0x00000009 /* drawops.drawline */
GGI_OP_COPYBOX 0x0000000a /* drawops.copybox */
GGI_OP_CROSSBLIT 0x0000000b /* drawops.copybox */
/* Since GGI's API is entirely stable, we guarantee we will never use these
* bits, which makes it easier for extensions providing altered analogs to
* GGI drawing primitives to map between their altered primitives and ours.
*/
GGI_OP_NEVERUSED 0x0000f000
/* PT == parmtype. Operations need parameters. Here we define parmtypes,
* such that mmutils can match up source and destination batchops.
*/
/* What IS the batchparm representing? */
GGI_PT_IS_MASK 0xffff0000
GGI_PT_IS_CHANMASK 0x003f0000
GGI_PT_IS_TYPEMASK 0x0f000000
GGI_PT_IS_MISCMASK 0xe0000000
GGI_PT_IS_COORD 0x00000000 /* A coordinate */
GGI_PT_IS_COLOR1 0x00010000 /* A color channel (R, Y, C) */
GGI_PT_IS_COLOR2 0x00020000 /* A color channel (B, U, Cr, M) */
GGI_PT_IS_COLOR3 0x00040000 /* A color channel (G, V, Cg, Y) */
GGI_PT_IS_COLOR4 0x00080000 /* A color channel (K) */
GGI_PT_IS_ALPHA 0x00100000 /* A translucency (A) */
GGI_PT_IS_DEPTH 0x00200000 /* A depth (Z, Bump) */
GGI_PT_IS_PAT 0x01000000 /* A pattern for tesslation fills */
GGI_PT_IS_CLIP 0x02000000 /* A clipping region */
GGI_PT_IS_ERR 0x03000000 /* An error term */
GGI_PT_IS_FGCOL 0x04000000 /* A foreground color */
GGI_PT_IS_BGCOL 0x05000000
GGI_PT_IS_BOP 0x06000000 /* A boolean ROP */
GGI_PT_IS_KEYCOL 0x07000000 /* A color key */
GGI_PT_IS_KEYMASK 0x08000000 /* A color key mask */
GGI_PT_IS_PLANEMASK 0x09000000 /* A plane mask */
GGI_PT_IS_OPCODE 0x0a000000 /* An opcode or command */
GGI_PT_IS_SRC 0x10000000 /* Pertains to source, not dest */
GGI_PT_IS_INDEXED 0x20000000 /* Uses a LUT */
GGI_PT_IS_MODE 0x60000000 /* An operational mode (pixel size,
* pixel format, blend select, etc.) */
GGI_PT_IS_SPECIAL 0xe0000000 /* Extension/Target/chipset specific */
/* IN what axis/dimensions/units is the batchparm? */
GGI_PT_IN_MASK 0x0000ff00
GGI_PT_IN_AXISMASK 0x00000f00
GGI_PT_IN_UNITMASK 0x0000f000
GGI_PT_IN_QTY 0x00000000 /* A generic quantity */
GGI_PT_IN_X 0x00000100 /* X Axis */
GGI_PT_IN_Y 0x00000200 /* Y Axis */
GGI_PT_IN_ADDR 0x00000300 /* Linearized fb address */
GGI_PT_IN_MAJOR 0x00000400 /* Major Axis */
GGI_PT_IN_MINOR 0x00000500 /* Minor Axis */
GGI_PT_IN_PIXEL 0x00000000 /* In Pixels */
GGI_PT_IN_BYTES 0x00001000 /* In Bytes */
GGI_PT_IN_SLICE 0x0000f000 /* In chipset native size slice */
/* What ROLE does the batchparm play? */
GGP_PT_ROLE_MASK 0x000000c0
GGI_PT_ROLE_START 0x00000000 /* A starting value or coordinate */
GGI_PT_ROLE_END 0x00000040 /* An ending value or coordinate */
GGI_PT_ROLE_LEN 0x00000080 /* A width or height */
GGI_PT_ROLE_INCR 0x000000c0 /* An increment, pitch, or slope */
--
Brian