etnaviv: Consolidate buffer references from framebuffers
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Mon, 17 Dec 2018 08:56:00 +0000 (09:56 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 28 Dec 2018 09:22:01 +0000 (10:22 +0100)
commitbf1dfcc3e8120400c9a78d03dd914a786728b5f7
tree2bf38755c534068e04d6a64b3d21e2c7314c3d06
parentd1ce7eba8b056bfd7d8f29cc0f583777a7ee30e5
etnaviv: Consolidate buffer references from framebuffers

We were leaking surfaces because the references taken in
etna_set_framebuffer_state weren't being released on context destroy.

Instead of just directly releasing those references in
etna_context_destroy, use the util_copy_framebuffer_state helper.

Take the chance to remove the duplicated buffer references in
compiled_framebuffer_state to avoid confusion.

The leak can be reproduced with a client that continuously creates and
destroys contexts.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reported-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_context.c
src/gallium/drivers/etnaviv/etnaviv_internal.h
src/gallium/drivers/etnaviv/etnaviv_state.c