summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/dri_bufmgr.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-11-16 14:20:24 -0800
committerEric Anholt <eric@anholt.net>2007-11-16 15:36:18 -0800
commit00eb5635c6e0a41524c55f450a6a9ce8ba5d6be8 (patch)
tree1c7126a496cfd04c1f1a398d7c89a8cff140bcb3 /src/mesa/drivers/dri/common/dri_bufmgr.h
parentdf3c530bedd0ee59e0ae5c18a916f78fd3f7559a (diff)
[intel] Add support for multiple levels of relocation in bufmgr_fake.
This is required for 965 support, which has relocations in other places than just the batchbuffer.
Diffstat (limited to 'src/mesa/drivers/dri/common/dri_bufmgr.h')
-rw-r--r--src/mesa/drivers/dri/common/dri_bufmgr.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/common/dri_bufmgr.h b/src/mesa/drivers/dri/common/dri_bufmgr.h
index 7dbb558949..f1863c7056 100644
--- a/src/mesa/drivers/dri/common/dri_bufmgr.h
+++ b/src/mesa/drivers/dri/common/dri_bufmgr.h
@@ -134,13 +134,42 @@ struct _dri_bufmgr {
* Tears down the buffer manager instance.
*/
void (*destroy)(dri_bufmgr *bufmgr);
-
+
/**
- * Add relocation
+ * Add relocation entry in reloc_buf, to be set on command submission.
+ *
+ * \param reloc_buf Buffer to write the relocation into.
+ * \param flags BO flags to be used in validating the target buffer.
+ * Applicable flags include:
+ * - DRM_BO_FLAG_READ: The buffer will be read in the process of
+ * command execution.
+ * - DRM_BO_FLAG_WRITE: The buffer will be written in the process of
+ * command execution.
+ * - DRM_BO_FLAG_MEM_TT: The buffer should be validated in TT memory.
+ * - DRM_BO_FLAG_MEM_VRAM: The buffer should be validated in video
+ * memory.
+ * \param delta Constant value to be added to the relocation target's offset.
+ * \param offset Byte offset within batch_buf of the relocated pointer.
+ * \param target Buffer whose offset should be written into the relocation
+ * entry.
*/
- void (*emit_reloc)(dri_bo *batch_buf, GLuint flags, GLuint delta, GLuint offset, dri_bo *relocatee);
+ void (*emit_reloc)(dri_bo *reloc_buf, GLuint flags, GLuint delta,
+ GLuint offset, dri_bo *target);
- void *(*process_relocs)(dri_bo *batch_buf, GLuint *count);
+ /**
+ * Processes the relocations, either in userland or by converting the list
+ * for use in batchbuffer submission.
+ *
+ * Kernel-based implementations will return a pointer to the arguments
+ * to be handed with batchbuffer submission to the kernel. The userland
+ * implementation performs the buffer validation and emits relocations
+ * into them the appopriate order.
+ *
+ * \param batch_buf buffer at the root of the tree of relocations
+ * \param count returns the number of buffers validated.
+ * \return relocation record for use in command submission.
+ * */
+ void *(*process_relocs)(dri_bo *batch_buf, GLuint *count);
void (*post_submit)(dri_bo *batch_buf, dri_fence **fence);
};