freedreno: Fix leak of binning shader variants.
authorEric Anholt <eric@anholt.net>
Thu, 9 Apr 2020 20:32:45 +0000 (13:32 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Apr 2020 18:42:20 +0000 (18:42 +0000)
The v->binning variant is never added to shader->variants, so just free
each one as we free the nonbinning variant.

Noticed from drm-shim mode running out of open fds, since each bo ends up
with an fd.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4502>

src/freedreno/ir3/ir3_shader.c

index cb0de2e8d65192f858e0a396df786861e247decb..e42f7713e099418bde2c9ed41d149323df4f0d18 100644 (file)
@@ -48,6 +48,8 @@ delete_variant(struct ir3_shader_variant *v)
                ir3_destroy(v->ir);
        if (v->bo)
                fd_bo_del(v->bo);
+       if (v->binning)
+               delete_variant(v->binning);
        free(v);
 }