From da6d0e3facfe0eb5c7db2d75d6992643d929caff Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 18 Aug 2020 08:10:25 -0400 Subject: [PATCH] panfrost: Free NIR of blit shaders After we compile from NIR to a native binary, we can throw away the NIR. 17.47KB leaked over 104 calls from: 0xffff87dcafc3 in ?? _mesa_hash_table_init at ../src/util/hash_table.c:163 in /home/alyssa/rockchip_dri.so _mesa_hash_table_create at ../src/util/hash_table.c:186 nir_lower_vars_to_ssa_impl at ../src/compiler/nir/nir_lower_vars_to_ssa.c:717 in /home/alyssa/rockchip_dri.so nir_lower_vars_to_ssa at ../src/compiler/nir/nir_lower_vars_to_ssa.c:817 optimise_nir at ../src/panfrost/midgard/midgard_compile.c:504 in /home/alyssa/rockchip_dri.so midgard_compile_shader_nir at ../src/panfrost/midgard/midgard_compile.c:2895 in /home/alyssa/rockchip_dri.so panfrost_build_blit_shader at ../src/panfrost/lib/pan_blit.c:103 in /home/alyssa/rockchip_dri.so Signed-off-by: Alyssa Rosenzweig Cc: mesa-stable Reviewed-by: Tomeu Vizoso Part-of: --- src/panfrost/lib/pan_blit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panfrost/lib/pan_blit.c b/src/panfrost/lib/pan_blit.c index 6002278d491..deec17ba720 100644 --- a/src/panfrost/lib/pan_blit.c +++ b/src/panfrost/lib/pan_blit.c @@ -101,6 +101,7 @@ panfrost_build_blit_shader(panfrost_program *program, unsigned gpu_id, gl_frag_r nir_store_var(b, c_out, nir_channel(b, &tex->dest.ssa, 0), 0xFF); midgard_compile_shader_nir(shader, program, false, 0, gpu_id, false, true); + ralloc_free(shader); } /* Compile and upload all possible blit shaders ahead-of-time to reduce draw -- 2.30.2