Suggested by Jose on the list, probably not perfect but will let me get
past this for now, testing with a fenced bufmgr on top of this, was slower,
Also this doesn't let you do the busy early exit optimisation either from
what I can see.
Signed-off-by: Dave Airlie <airlied@redhat.com>
pb_size size,
const struct pb_desc *desc)
{
+ void *map;
+
if(buf->base.base.size < size)
return FALSE;
if(!pb_check_usage(desc->usage, buf->base.base.usage))
return FALSE;
+
+ map = pb_map(buf->buffer, PIPE_BUFFER_USAGE_DONTBLOCK);
+ if (!map) {
+ return FALSE;
+ }
+
+ pb_unmap(buf->buffer);
return TRUE;
}