i965: Fix memory leaks in brw_upload_cs_work_groups_surface().
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 9 May 2019 22:40:13 +0000 (15:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 10 May 2019 19:50:19 +0000 (12:50 -0700)
commit3f60810de0a2960ec15118ef9888d9efc9ea605a
tree0440e021feb5ee837a5c49fbdb887e77cd7d3749
parent98b852cd07a80fa42336031f089bdac6e7c617d3
i965: Fix memory leaks in brw_upload_cs_work_groups_surface().

This was taking a reference to the 64kB upload buffer and never
returning it, leaking a reference each time this atom triggered.

This leaked lots of 64kB upload BOs, eventually running us out of
of VMA space.  This would usually happen when using mpv to watch a
movie, after 20-40 minutes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110134
Fixes: 63d7b33f516 i965/cs: Setup surface binding for gl_NumWorkGroups
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c