diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-15 12:05:48 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-15 16:12:56 -0700 |
commit | c1125d09355da276646988061e4b2b5331e94413 (patch) | |
tree | b721876090f35ad7bb020dcb57a3d171adf4289f /src/gallium/drivers/panfrost | |
parent | 48f51e9dbbd8cea2759f4cd7efda2ff397afc35d (diff) |
panfrost: Don't leak oversized transient allocations
When we allocate them, we allocate with two references accidentally,
causing them to leak uncontrollably.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_allocate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_allocate.c b/src/gallium/drivers/panfrost/pan_allocate.c index 9d78fab85d6..9e9565d6006 100644 --- a/src/gallium/drivers/panfrost/pan_allocate.c +++ b/src/gallium/drivers/panfrost/pan_allocate.c @@ -118,6 +118,10 @@ panfrost_allocate_transient(struct panfrost_context *ctx, size_t sz) /* Create a new BO and reference it */ bo = panfrost_drm_create_bo(screen, ALIGN_POT(sz, 4096), 0); panfrost_job_add_bo(batch, bo); + + /* Creating a BO adds a reference, and then the job adds a + * second one. So we need to pop back one reference */ + panfrost_bo_unreference(&screen->base, bo); } struct panfrost_transfer ret = { |