summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/common.h
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-11 12:04:55 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-11 12:04:55 -0700
commit08c2571fb48d41731c81cc402acabf709523c831 (patch)
tree48185f77bbc8416b30c5d4a4255c7d5b27c54e17 /src/mesa/pipe/cell/common.h
parent7db94ba03173f345a47fd727e8d866a87a484415 (diff)
Cell: initial work for a hw-like batch buffer system
Diffstat (limited to 'src/mesa/pipe/cell/common.h')
-rw-r--r--src/mesa/pipe/cell/common.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/pipe/cell/common.h b/src/mesa/pipe/cell/common.h
index c00cee6a02..450ca1d722 100644
--- a/src/mesa/pipe/cell/common.h
+++ b/src/mesa/pipe/cell/common.h
@@ -47,13 +47,23 @@
#define TILE_SIZE 32
+/**
+ * The low byte of a mailbox word contains the command opcode.
+ * Remaining higher bytes are command specific.
+ */
+#define CELL_CMD_OPCODE_MASK 0xf
+
#define CELL_CMD_EXIT 1
#define CELL_CMD_FRAMEBUFFER 2
#define CELL_CMD_CLEAR_SURFACE 3
#define CELL_CMD_FINISH 4
#define CELL_CMD_RENDER 5
+#define CELL_CMD_BATCH 6
+#define CELL_NUM_BATCH_BUFFERS 2
+#define CELL_BATCH_BUFFER_SIZE 1024 /**< 16KB would be the max */
+
/**
* Tell SPUs about the framebuffer size, location
@@ -90,12 +100,23 @@ struct cell_command_render
} ALIGN16_ATTRIB;
+/**
+ * Execute a command/batch buffer.
+ */
+struct cell_command_batch
+{
+ ushort buffer; /**< which buffer [0, CELL_NUM_CMD_BUFFFERS-1] */
+ ushort length; /**< in bytes */
+} ALIGN16_ATTRIB;
+
+
/** XXX unions don't seem to work */
struct cell_command
{
struct cell_command_framebuffer fb;
struct cell_command_clear_surface clear;
struct cell_command_render render;
+ struct cell_command_batch batch;
} ALIGN16_ATTRIB;
@@ -105,6 +126,7 @@ struct cell_init_info
unsigned id;
unsigned num_spus;
struct cell_command *cmd;
+ ubyte *batch_buffers[CELL_NUM_BATCH_BUFFERS];
} ALIGN16_ATTRIB;