diff options
author | Tomeu Vizoso <[email protected]> | 2018-12-17 09:56:00 +0100 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2018-12-28 10:22:01 +0100 |
commit | bf1dfcc3e8120400c9a78d03dd914a786728b5f7 (patch) | |
tree | 2bf38755c534068e04d6a64b3d21e2c7314c3d06 /src/gallium/drivers/etnaviv/etnaviv_context.c | |
parent | d1ce7eba8b056bfd7d8f29cc0f583777a7ee30e5 (diff) |
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 <[email protected]>
Reported-by: Sjoerd Simons <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_context.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_context.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index aa742566289..44b50925a4f 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -63,6 +63,8 @@ etna_context_destroy(struct pipe_context *pctx) if (ctx->dummy_rt) etna_bo_del(ctx->dummy_rt); + util_copy_framebuffer_state(&ctx->framebuffer_s, NULL); + if (ctx->primconvert) util_primconvert_destroy(ctx->primconvert); @@ -294,10 +296,10 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) if (DBG_ENABLED(ETNA_DBG_FLUSH_ALL)) pctx->flush(pctx, NULL, 0); - if (ctx->framebuffer.cbuf) - etna_resource(ctx->framebuffer.cbuf->texture)->seqno++; - if (ctx->framebuffer.zsbuf) - etna_resource(ctx->framebuffer.zsbuf->texture)->seqno++; + if (ctx->framebuffer_s.cbufs[0]) + etna_resource(ctx->framebuffer_s.cbufs[0]->texture)->seqno++; + if (ctx->framebuffer_s.zsbuf) + etna_resource(ctx->framebuffer_s.zsbuf->texture)->seqno++; if (info->index_size && indexbuf != info->index.resource) pipe_resource_reference(&indexbuf, NULL); } |