[Intel-gfx] Fw:share one render buffer within Multithreading multiple contexts in intel driver

maillist126 maillist126 at 126.com
Tue Sep 22 07:00:27 CEST 2009


Hello there, 

 
I reviewed intel driver in Mesa7.2 and found there seems a problem in 

======================================================
intel_region_release(struct intel_region **region)
{
   if (!*region)
      return;

   DBG("%s %d\n", __FUNCTION__, (*region)->refcount - 1);

   ASSERT((*region)->refcount > 0);
   (*region)->refcount--;

   if ((*region)->refcount == 0) {
      assert((*region)->map_refcount == 0);

      if ((*region)->pbo)
     (*region)->pbo->region = NULL;
      (*region)->pbo = NULL;
      dri_bo_unreference((*region)->buffer);
      free(*region);
   }
   *region = NULL;
}
==========================================
If there are two contexts made current on this region of rb, after "(*region)->refcount--;"  is it possible refcount still be larger than "0", and it will not be free then leaked?

thanks,




网易邮箱用户购物独享现金返还
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090922/0bd81b47/attachment.html>


More information about the Intel-gfx mailing list