PB_USAGE_GPU_WRITE = (1 << 3),
PB_USAGE_DONTBLOCK = (1 << 9),
PB_USAGE_UNSYNCHRONIZED = (1 << 10),
+ /* Persistent mappings may remain across a flush. Note that contrary
+ * to OpenGL persistent maps, there is no requirement at the pipebuffer
+ * api level to explicitly enforce coherency by barriers or range flushes.
+ */
+ PB_USAGE_PERSISTENT = (1 << 13)
};
/* For error checking elsewhere */
PB_USAGE_GPU_READ | \
PB_USAGE_GPU_WRITE | \
PB_USAGE_DONTBLOCK | \
- PB_USAGE_UNSYNCHRONIZED)
+ PB_USAGE_UNSYNCHRONIZED | \
+ PB_USAGE_PERSISTENT)
#define PB_USAGE_CPU_READ_WRITE (PB_USAGE_CPU_READ | PB_USAGE_CPU_WRITE)
#define PB_USAGE_GPU_READ_WRITE (PB_USAGE_GPU_READ | PB_USAGE_GPU_WRITE)
if (slab->numFree == slab->numBuffers) {
list = &slab->head;
list_delinit(list);
+ pb_unmap(slab->bo);
pb_reference(&slab->bo, NULL);
FREE(slab->buffers);
FREE(slab);
}
/* Note down the slab virtual address. All mappings are accessed directly
- * through this address so it is required that the buffer is pinned. */
+ * through this address so it is required that the buffer is mapped
+ * persistent */
slab->virtual = pb_map(slab->bo,
PB_USAGE_CPU_READ |
- PB_USAGE_CPU_WRITE, NULL);
+ PB_USAGE_CPU_WRITE |
+ PB_USAGE_PERSISTENT, NULL);
if(!slab->virtual) {
ret = PIPE_ERROR_OUT_OF_MEMORY;
goto out_err1;
}
- pb_unmap(slab->bo);
numBuffers = slab->bo->size / mgr->bufSize;
(unsigned) PIPE_TRANSFER_DONTBLOCK);
STATIC_ASSERT((unsigned) PB_USAGE_UNSYNCHRONIZED ==
(unsigned) PIPE_TRANSFER_UNSYNCHRONIZED);
+ STATIC_ASSERT((unsigned) PB_USAGE_PERSISTENT ==
+ (unsigned) PIPE_TRANSFER_PERSISTENT);
map = pb_map(vmw_pb_buffer(buf), flags & PB_USAGE_ALL, NULL);