Skip to contentSkip to conversation

nv30: plug some memory leaks on screen destroy and shader compile

PATCH New Ilia Mirkin 1 participant 2 messages Jun 18, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nv30: plug some memory leaks on screen destroy and shader compile

---
 src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 6 ++++++
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 1 +
 2 files changed, 7 insertions(+)
src/gallium/drivers/nouveau/nv30/nv30_screen.c +6 -0
index fb9378c..4baabaf 100644
@@ -327,6 +327,12 @@ nv30_screen_destroy(struct pipe_screen *pscreen)
       nouveau_fence_ref(NULL, &screen->base.fence.current);
    }
 
+   nouveau_bo_ref(NULL, &screen->notify);
+
+   nouveau_heap_destroy(&screen->query_heap);
+   nouveau_heap_destroy(&screen->vp_exec_heap);
+   nouveau_heap_destroy(&screen->vp_data_heap);
+
    nouveau_object_del(&screen->query);
    nouveau_object_del(&screen->fence);
    nouveau_object_del(&screen->ntfy);
src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +1 -0
index 4955226..1f1fba2 100644
@@ -1225,6 +1225,7 @@ out:
    if(fpc)
    {
       FREE(fpc->r_temp);
+      FREE(fpc->r_imm);
       util_dynarray_fini(&fpc->if_stack);
       util_dynarray_fini(&fpc->label_relocs);
       util_dynarray_fini(&fpc->imm_data);
Signature · 1 line
1.8.5.5

A message that is not in the archive (sent off-list or not yet received): 1403059172-27689-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#2 lore raw

PATCH 2/2 nv30: avoid dangling references to deleted contexts

---
 src/gallium/drivers/nouveau/nv30/nv30_context.c | 3 +++
 1 file changed, 3 insertions(+)
src/gallium/drivers/nouveau/nv30/nv30_context.c +3 -0
index f325c5c..617b088 100644
@@ -165,6 +165,9 @@ nv30_context_destroy(struct pipe_context *pipe)
    if (nv30->draw)
       draw_destroy(nv30->draw);
 
+   if (nv30->screen->base.pushbuf->user_priv == &nv30->bufctx)
+      nv30->screen->base.pushbuf->user_priv = NULL;
+
    nouveau_bufctx_del(&nv30->bufctx);
 
    if (nv30->screen->cur_ctx == nv30)
Signature · 1 line
1.8.5.5