[Mesa-dev] [PATCH] i965: Solve Android native fence fd double close issue

Xu, Randy randy.xu at intel.com
Thu Apr 27 11:14:24 UTC 2017


Hi, Chad

Please review this patch, we need it to solve some instability issues


Thanks,
Randy


> -----Original Message-----
> From: Palli, Tapani
> Sent: Thursday, April 20, 2017 2:58 PM
> To: Xu, Randy <randy.xu at intel.com>; mesa-dev at lists.freedesktop.org
> Cc: Chad Versace <chadversary at chromium.org>
> Subject: Re: [PATCH] i965: Solve Android native fence fd double close issue
> 
> Ping Chad
> 
> On 04/20/2017 08:20 AM, Xu, Randy wrote:
> > Any comments to this patch?
> >
> > Thanks,
> > Randy
> >
> >
> >> -----Original Message-----
> >> From: Xu, Randy
> >> Sent: Tuesday, April 18, 2017 2:27 PM
> >> To: mesa-dev at lists.freedesktop.org
> >> Cc: Palli, Tapani <tapani.palli at intel.com>; Xu, Randy
> >> <randy.xu at intel.com>
> >> Subject: [PATCH] i965: Solve Android native fence fd double close
> >> issue
> >>
> >> The Android native fence in i965 driver has two fd, one is from App
> >> and stored in _EGLSync.SyncFd; Another one brw_fence->sync_fd should
> >> be the dup of the first one, not direct copy.
> >> These two fds are closed in dri2_egl_unref_sync in sequence.
> >>
> >> Test: Run Vulkan and GLES stress test and no crash.
> >>
> >> Signed-off-by: Randy Xu <randy.xu at intel.com>
> >> ---
> >>   src/mesa/drivers/dri/i965/brw_sync.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/brw_sync.c
> >> b/src/mesa/drivers/dri/i965/brw_sync.c
> >> index 5b78503..a8356c3 100644
> >> --- a/src/mesa/drivers/dri/i965/brw_sync.c
> >> +++ b/src/mesa/drivers/dri/i965/brw_sync.c
> >> @@ -470,7 +470,7 @@ brw_dri_create_fence_fd(__DRIcontext *dri_ctx,
> >> int
> >> fd)
> >>            goto fail;
> >>      } else {
> >>         /* Import the sync fd as an in-fence. */
> >> -      fence->sync_fd = fd;
> >> +      fence->sync_fd = dup(fd);
> >>      }
> >>
> >>      assert(fence->sync_fd != -1);
> >> --
> >> 2.7.4
> >


More information about the mesa-dev mailing list