summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-02-07 16:59:54 +0100
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-04-05 10:37:17 +0200
commitc2637a17d95e645cc45eb648d03324502ab99748 (patch)
tree9b8f61aaceba8e42083c76efebe396e1c3e2c2af
parentd9bc4d8305c3f3ee4b82386ae119d72d3a66a4d2 (diff)
radeon/winsys: add sparse buffer interface
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/gallium/drivers/radeon/radeon_winsys.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_winsys.h b/src/gallium/drivers/radeon/radeon_winsys.h
index a19ece6634..a63485175d 100644
--- a/src/gallium/drivers/radeon/radeon_winsys.h
+++ b/src/gallium/drivers/radeon/radeon_winsys.h
@@ -53,6 +53,7 @@ enum radeon_bo_flag { /* bitfield */
RADEON_FLAG_CPU_ACCESS = (1 << 1),
RADEON_FLAG_NO_CPU_ACCESS = (1 << 2),
RADEON_FLAG_HANDLE = (1 << 3), /* the buffer most not be suballocated */
+ RADEON_FLAG_SPARSE = (1 << 4),
};
enum radeon_bo_usage { /* bitfield */
@@ -66,6 +67,8 @@ enum radeon_bo_usage { /* bitfield */
RADEON_USAGE_SYNCHRONIZED = 8
};
+#define RADEON_SPARSE_PAGE_SIZE (64 * 1024)
+
enum ring_type {
RING_GFX = 0,
RING_COMPUTE,
@@ -575,6 +578,20 @@ struct radeon_winsys {
struct winsys_handle *whandle);
/**
+ * Change the commitment of a (64KB-page aligned) region of the given
+ * sparse buffer.
+ *
+ * \warning There is no automatic synchronization with command submission.
+ *
+ * \note Only implemented by the amdgpu winsys.
+ *
+ * \return false on out of memory or other failure, true on success.
+ */
+ bool (*buffer_commit)(struct pb_buffer *buf,
+ uint64_t offset, uint64_t size,
+ bool commit);
+
+ /**
* Return the virtual address of a buffer.
*
* When virtual memory is not in use, this is the offset relative to the