summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornith1989 <tianhao.ni@samsung.com>2021-03-18 14:57:08 +0800
committerXuelian Bai <xuelian.bai@samsung.com>2021-10-11 10:16:34 +0800
commit8fa74ffca71a0d549eb091c5f664006f0abeeb6b (patch)
tree1f44adfc7d37ff8a213dd317096b559bcb6940cd
parent91dac84205d7ded3db3579a886e0603e1300da66 (diff)
downloadmesa-8fa74ffca71a0d549eb091c5f664006f0abeeb6b.tar.gz
mesa-8fa74ffca71a0d549eb091c5f664006f0abeeb6b.tar.bz2
mesa-8fa74ffca71a0d549eb091c5f664006f0abeeb6b.zip
Fix fence fd leak issue:
- close fence fd when destroy context Change-Id: I4ec1fe1c2f7de3221802ea53c3e563471cd1a332 Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
-rw-r--r--src/gallium/drivers/v3d/v3d_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_context.c b/src/gallium/drivers/v3d/v3d_context.c
index eef3612c64c..29bad92b14d 100644
--- a/src/gallium/drivers/v3d/v3d_context.c
+++ b/src/gallium/drivers/v3d/v3d_context.c
@@ -307,6 +307,13 @@ v3d_context_destroy(struct pipe_context *pctx)
v3d_program_fini(pctx);
+ if (v3d->screen->has_syncobj) {
+ drmSyncobjDestroy(v3d->fd, v3d->out_sync);
+ drmSyncobjDestroy(v3d->fd, v3d->in_syncobj);
+ }
+ if (v3d->in_fence_fd >= 0)
+ close(v3d->in_fence_fd);
+
ralloc_free(v3d);
}