diff options
author | Dave Airlie <[email protected]> | 2010-08-28 18:59:32 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2010-09-12 13:32:43 +1000 |
commit | b5fcf0c8e07e666523b007fab1d0fc18c2c89241 (patch) | |
tree | 2cd8fdfbe697531b04a9912e296df70d554db509 /src/gallium/auxiliary | |
parent | 95555ed03e95f7472ad1f6c4b43e0aa7aaa13f93 (diff) |
pb: add void * for flush ctx to mapping functions
If the buffer we are attempting to map is referenced by the unsubmitted
command stream for this context, we need to flush the command stream,
however to do that we need to be able to access the context at the lowest
level map function, currently we set the buffer in the toplevel map, but this
racy between context. (we probably have a lot more issues than that.)
I'll look into a proper solution as suggested by jrfonseca when I get some time.
Diffstat (limited to 'src/gallium/auxiliary')
8 files changed, 19 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index a6c50dcf0c1..5a13f39849f 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -130,7 +130,7 @@ struct pb_vtbl * flags is bitmask of PB_USAGE_CPU_READ/WRITE. */ void *(*map)( struct pb_buffer *buf, - unsigned flags ); + unsigned flags, void *flush_ctx ); void (*unmap)( struct pb_buffer *buf ); @@ -164,13 +164,13 @@ struct pb_vtbl */ static INLINE void * pb_map(struct pb_buffer *buf, - unsigned flags) + unsigned flags, void *flush_ctx) { assert(buf); if(!buf) return NULL; assert(pipe_is_referenced(&buf->base.reference)); - return buf->vtbl->map(buf, flags); + return buf->vtbl->map(buf, flags, flush_ctx); } diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index d6cf6405825..c310f28f51f 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -624,7 +624,7 @@ fenced_buffer_copy_storage_to_gpu_locked(struct fenced_buffer *fenced_buf) assert(fenced_buf->data); assert(fenced_buf->buffer); - map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_WRITE); + map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_WRITE, NULL); if(!map) return PIPE_ERROR; @@ -644,7 +644,7 @@ fenced_buffer_copy_storage_to_cpu_locked(struct fenced_buffer *fenced_buf) assert(fenced_buf->data); assert(fenced_buf->buffer); - map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_READ); + map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_READ, NULL); if(!map) return PIPE_ERROR; @@ -674,7 +674,7 @@ fenced_buffer_destroy(struct pb_buffer *buf) static void * fenced_buffer_map(struct pb_buffer *buf, - unsigned flags) + unsigned flags, void *flush_ctx) { struct fenced_buffer *fenced_buf = fenced_buffer(buf); struct fenced_manager *fenced_mgr = fenced_buf->mgr; @@ -712,7 +712,7 @@ fenced_buffer_map(struct pb_buffer *buf, } if(fenced_buf->buffer) { - map = pb_map(fenced_buf->buffer, flags); + map = pb_map(fenced_buf->buffer, flags, flush_ctx); } else { assert(fenced_buf->data); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 88501e8d72d..b4d81073726 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -167,10 +167,10 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf) static void * pb_cache_buffer_map(struct pb_buffer *_buf, - unsigned flags) + unsigned flags, void *flush_ctx) { struct pb_cache_buffer *buf = pb_cache_buffer(_buf); - return pb_map(buf->buffer, flags); + return pb_map(buf->buffer, flags, flush_ctx); } @@ -242,7 +242,7 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, if(!pb_check_usage(desc->usage, buf->base.base.usage)) return FALSE; - map = pb_map(buf->buffer, PB_USAGE_DONTBLOCK); + map = pb_map(buf->buffer, PB_USAGE_DONTBLOCK, NULL); if (!map) { return FALSE; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 0dc5b31a754..4a01c7371bf 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -181,7 +181,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) map = pb_map(buf->buffer, PB_USAGE_CPU_READ | - PB_USAGE_UNSYNCHRONIZED); + PB_USAGE_UNSYNCHRONIZED, NULL); assert(map); if(map) { boolean underflow, overflow; @@ -247,14 +247,14 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf) static void * pb_debug_buffer_map(struct pb_buffer *_buf, - unsigned flags) + unsigned flags, void *flush_ctx) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); void *map; pb_debug_buffer_check(buf); - map = pb_map(buf->buffer, flags); + map = pb_map(buf->buffer, flags, flush_ctx); if(!map) return NULL; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c index faf7c352674..f35b4ce0601 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c @@ -269,7 +269,7 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, mm->map = pb_map(mm->buffer, PB_USAGE_CPU_READ | - PB_USAGE_CPU_WRITE); + PB_USAGE_CPU_WRITE, NULL); if(!mm->map) goto failure; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c index 31f1ebbeb7c..694a092f3c2 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c @@ -103,13 +103,13 @@ pb_ondemand_buffer_destroy(struct pb_buffer *_buf) static void * pb_ondemand_buffer_map(struct pb_buffer *_buf, - unsigned flags) + unsigned flags, void *flush_ctx) { struct pb_ondemand_buffer *buf = pb_ondemand_buffer(_buf); if(buf->buffer) { assert(!buf->data); - return pb_map(buf->buffer, flags); + return pb_map(buf->buffer, flags, flush_ctx); } else { assert(buf->data); @@ -150,7 +150,7 @@ pb_ondemand_buffer_instantiate(struct pb_ondemand_buffer *buf) if(!buf->buffer) return PIPE_ERROR_OUT_OF_MEMORY; - map = pb_map(buf->buffer, PB_USAGE_CPU_READ); + map = pb_map(buf->buffer, PB_USAGE_CPU_READ, NULL); if(!map) { pb_reference(&buf->buffer, NULL); return PIPE_ERROR; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c index fdcce428784..4f46cfc9e32 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c @@ -285,7 +285,7 @@ pool_bufmgr_create(struct pb_manager *provider, pool->map = pb_map(pool->buffer, PB_USAGE_CPU_READ | - PB_USAGE_CPU_WRITE); + PB_USAGE_CPU_WRITE, NULL); if(!pool->map) goto failure; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index 7a3305aaf37..275eb76bf52 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -316,7 +316,7 @@ pb_slab_create(struct pb_slab_manager *mgr) * through this address so it is required that the buffer is pinned. */ slab->virtual = pb_map(slab->bo, PB_USAGE_CPU_READ | - PB_USAGE_CPU_WRITE); + PB_USAGE_CPU_WRITE, NULL); if(!slab->virtual) { ret = PIPE_ERROR_OUT_OF_MEMORY; goto out_err1; |