[Mesa-dev] [PATCH 2/2] pb_bufmgr_cache: add is_buffer_busy hook and use it instead of non-blocking map

Dave Airlie airlied at gmail.com
Sun Feb 13 23:58:58 PST 2011


>>    if(buf->base.base.size < size)
>>       return 0;
>>
>> @@ -242,13 +240,10 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer
>> *buf,
>>    if(!pb_check_usage(desc->usage, buf->base.base.usage))
>>       return 0;
>>
>> -   map = pb_map(buf->buffer, PB_USAGE_DONTBLOCK, NULL);
>> -   if (!map) {
>> -      return -1;
>> -   }
>> +   if (buf->mgr->base.is_buffer_busy)
>> +      if (buf->mgr->base.is_buffer_busy(&buf->mgr->base, buf->buffer))
>> +         return -1;
>
> Oops, this is wrong. I will locally replace any occurences of
> "buf->mgr->base(.)" with "buf->mgr->provider(->)", which is how it was meant
> to be, but the idea remains the same. Please review.

I actually suggested this originally, but Jose I think preferred using
the dontblock to the buffer mapping.

Dave.


More information about the mesa-dev mailing list