vmw_gmr_bufmgr(struct pb_manager *mgr)
{
assert(mgr);
+
+ /* Make sure our extra flags don't collide with pipebuffer's flags */
+ STATIC_ASSERT((VMW_BUFFER_USAGE_SHARED & PB_USAGE_ALL) == 0);
+ STATIC_ASSERT((VMW_BUFFER_USAGE_SYNC & PB_USAGE_ALL) == 0);
+
return (struct vmw_gmr_bufmgr *)mgr;
}
static void *
vmw_gmr_buffer_map(struct pb_buffer *_buf,
- unsigned flags,
+ enum pb_usage_flags flags,
void *flush_ctx)
{
struct vmw_gmr_buffer *buf = vmw_gmr_buffer(_buf);
vmw_gmr_buffer_unmap(struct pb_buffer *_buf)
{
struct vmw_gmr_buffer *buf = vmw_gmr_buffer(_buf);
- unsigned flags = buf->map_flags;
+ enum pb_usage_flags flags = buf->map_flags;
if ((_buf->usage & VMW_BUFFER_USAGE_SYNC) &&
!(flags & PB_USAGE_UNSYNCHRONIZED)) {
static enum pipe_error
vmw_gmr_buffer_validate( struct pb_buffer *_buf,
struct pb_validate *vl,
- unsigned flags )
+ enum pb_usage_flags flags )
{
/* Always pinned */
return PIPE_OK;
void *
vmw_svga_winsys_buffer_map(struct svga_winsys_screen *sws,
struct svga_winsys_buffer *buf,
- unsigned flags)
+ enum pipe_transfer_usage flags)
{
void *map;
if (flags & PIPE_TRANSFER_UNSYNCHRONIZED)
flags &= ~PIPE_TRANSFER_DONTBLOCK;
+ /* NOTE: we're passing PIPE_TRANSFER_x flags instead of
+ * PB_USAGE_x flags here. We should probably fix that.
+ */
+ STATIC_ASSERT((unsigned) PB_USAGE_CPU_READ ==
+ (unsigned) PIPE_TRANSFER_READ);
+ STATIC_ASSERT((unsigned) PB_USAGE_CPU_WRITE ==
+ (unsigned) PIPE_TRANSFER_WRITE);
+ STATIC_ASSERT((unsigned) PB_USAGE_GPU_READ ==
+ (unsigned) PIPE_TRANSFER_MAP_DIRECTLY);
+ STATIC_ASSERT((unsigned) PB_USAGE_DONTBLOCK ==
+ (unsigned) PIPE_TRANSFER_DONTBLOCK);
+ STATIC_ASSERT((unsigned) PB_USAGE_UNSYNCHRONIZED ==
+ (unsigned) PIPE_TRANSFER_UNSYNCHRONIZED);
+
map = pb_map(vmw_pb_buffer(buf), flags, NULL);
#ifdef DEBUG