Commit 0dab3189 authored by Dave Airlie's avatar Dave Airlie

gallium: cached bufmgr add map busy check

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: default avatarDave Airlie <airlied@redhat.com>
parent 12deb9e6
......@@ -227,6 +227,8 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf,
pb_size size,
const struct pb_desc *desc)
{
void *map;
if(buf->base.base.size < size)
return FALSE;
......@@ -239,6 +241,13 @@ 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, PIPE_BUFFER_USAGE_DONTBLOCK);
if (!map) {
return FALSE;
}
pb_unmap(buf->buffer);
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment