summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/common.h
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-10-22 10:34:13 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-10-22 10:34:13 -0600
commit70dd4379d2cd54f229c3940312537912470218d3 (patch)
treecf24b8e884221c7637cf9c9b27890c2c9b8ec599 /src/gallium/drivers/cell/common.h
parent0ae4728eb429d7b5217d34ec96fc973a5e7cfe95 (diff)
cell: implement fencing for texture buffers
If we delete a texture, we need to keep the underlying tiled data buffer around until any rendering that references it has completed. Keep a list of buffers referenced by a rendering batch. Unref/free them when the associated batch's fence is executed/signalled.
Diffstat (limited to 'src/gallium/drivers/cell/common.h')
-rw-r--r--src/gallium/drivers/cell/common.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/drivers/cell/common.h b/src/gallium/drivers/cell/common.h
index 9ca4e9d67e..23fb0b0831 100644
--- a/src/gallium/drivers/cell/common.h
+++ b/src/gallium/drivers/cell/common.h
@@ -102,6 +102,8 @@
#define CELL_CMD_STATE_RASTERIZER 22
#define CELL_CMD_VS_EXECUTE 23
#define CELL_CMD_FLUSH_BUFFER_RANGE 24
+#define CELL_CMD_FENCE 25
+
/** Command/batch buffers */
#define CELL_NUM_BUFFERS 4
@@ -123,6 +125,29 @@
#define SPU_MAX_FRAGMENT_OPS_INSTS 64
+
+#define CELL_FENCE_IDLE 0
+#define CELL_FENCE_EMITTED 1
+#define CELL_FENCE_SIGNALLED 2
+
+struct cell_fence
+{
+ /** There's a 16-byte status qword per SPU */
+ volatile uint status[CELL_MAX_SPUS][4];
+};
+
+
+/**
+ * Fence command sent to SPUs. In response, the SPUs will write
+ * CELL_FENCE_STATUS_SIGNALLED back to the fence status word in main memory.
+ */
+struct cell_command_fence
+{
+ uint64_t opcode; /**< CELL_CMD_FENCE */
+ struct cell_fence *fence;
+};
+
+
/**
* Command to specify per-fragment operations state and generated code.
* Note that the dsa, blend, blend_color fields are really only needed