diff options
author | Fredrik Höglund <[email protected]> | 2011-03-29 19:43:59 +0200 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2011-03-29 16:37:04 -0400 |
commit | 948e1eb8e9c166ad5b74abc630d0760768ce78c9 (patch) | |
tree | 147111549a95b7406919945ec34546980e99b887 /src/gallium/drivers/r600/r600_pipe.h | |
parent | a99e80d795f7c6aec0e73369a31d1728577b9727 (diff) |
r600g: implement the pipe_screen fence functions
v2: Allocate the fences from a single shared buffer object.
v3: Allocate the r600_fence structs in blocks of 16.
Spin a few times before calling sched_yield in r600_fence_finish().
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.h')
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 396801e4a41..88aff0e81bb 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -124,6 +124,30 @@ struct r600_textures_info { unsigned n_samplers; }; +struct r600_fence { + struct pipe_reference reference; + struct r600_pipe_context *ctx; + unsigned index; /* in the shared bo */ + struct list_head head; +}; + +#define FENCE_BLOCK_SIZE 16 + +struct r600_fence_block { + struct r600_fence fences[FENCE_BLOCK_SIZE]; + struct list_head head; +}; + +struct r600_pipe_fences { + struct r600_bo *bo; + unsigned *data; + unsigned next_index; + /* linked list of preallocated blocks */ + struct list_head blocks; + /* linked list of freed fences */ + struct list_head pool; +}; + #define R600_CONSTANT_ARRAY_SIZE 256 #define R600_RESOURCE_ARRAY_SIZE 160 @@ -158,9 +182,12 @@ struct r600_pipe_context { bool flatshade; struct r600_textures_info ps_samplers; + struct r600_pipe_fences fences; + struct u_vbuf_mgr *vbuf_mgr; struct util_slab_mempool pool_transfers; bool blit; + }; struct r600_drawl { |