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

maillist126 maillist126 at 126.com
Thu Sep 17 09:55:39 CEST 2009


Hello, 
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/20090917/5079d2c2/attachment.html>


More information about the Intel-gfx mailing list