* 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 );
*/
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);
}
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;
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;
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;
}
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);
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);
}
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;
}
map = pb_map(buf->buffer,
PB_USAGE_CPU_READ |
- PB_USAGE_UNSYNCHRONIZED);
+ PB_USAGE_UNSYNCHRONIZED, NULL);
assert(map);
if(map) {
boolean underflow, overflow;
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;
mm->map = pb_map(mm->buffer,
PB_USAGE_CPU_READ |
- PB_USAGE_CPU_WRITE);
+ PB_USAGE_CPU_WRITE, NULL);
if(!mm->map)
goto failure;
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);
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;
pool->map = pb_map(pool->buffer,
PB_USAGE_CPU_READ |
- PB_USAGE_CPU_WRITE);
+ PB_USAGE_CPU_WRITE, NULL);
if(!pool->map)
goto failure;
* 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;
int write = 0;
if (rbuffer->pb) {
- return (uint8_t*)pb_map(rbuffer->pb, transfer->usage) + transfer->box.x;
+ return (uint8_t*)pb_map(rbuffer->pb, transfer->usage, NULL) + transfer->box.x;
}
if (transfer->usage & PIPE_TRANSFER_DONTBLOCK) {
/* FIXME */
static void *
radeon_drm_buffer_map_internal(struct pb_buffer *_buf,
- unsigned flags)
+ unsigned flags, void *flush_ctx)
{
struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf);
- struct radeon_libdrm_cs *cs = buf->cs;
+ struct radeon_libdrm_cs *cs = flush_ctx;
int write = 0;
if (flags & PB_USAGE_DONTBLOCK) {
enum pipe_transfer_usage usage)
{
struct pb_buffer *_buf = radeon_pb_buffer(buf);
- struct radeon_drm_buffer *rbuf = get_drm_buffer(_buf);
- if (rbuf)
- rbuf->cs = radeon_libdrm_cs(cs);
-
- return pb_map(_buf, get_pb_usage_from_transfer_flags(usage));
+ return pb_map(_buf, get_pb_usage_from_transfer_flags(usage), radeon_libdrm_cs(cs));
}
void radeon_drm_buffer_unmap(struct r300_winsys_screen *ws,
unsigned flags)
{
(void)sws;
- return pb_map(vmw_pb_buffer(buf), flags);
+ return pb_map(vmw_pb_buffer(buf), flags, NULL);
}