nouveau: Unreference pushbuf objects on channel destruction.

- unreference pushbuf objects on channel destruction

Based on Krzysztof Smiechowicz's patch.
main
Younes Manton 2009-12-28 18:00:09 -05:00
parent cb1caaaa05
commit cd2e4ba9aa
3 changed files with 16 additions and 3 deletions

View File

@ -111,6 +111,7 @@ nouveau_channel_free(struct nouveau_channel **chan)
FIRE_RING(&nvchan->base);
nouveau_pushbuf_fini(&nvchan->base);
nouveau_bo_unmap(nvchan->notifier_bo);
nouveau_bo_ref(NULL, &nvchan->notifier_bo);

View File

@ -64,6 +64,8 @@ struct nouveau_pushbuf_priv {
int
nouveau_pushbuf_init(struct nouveau_channel *);
void
nouveau_pushbuf_fini(struct nouveau_channel *);
struct nouveau_channel_priv {
struct nouveau_channel base;

View File

@ -170,6 +170,16 @@ nouveau_pushbuf_init(struct nouveau_channel *chan)
return 0;
}
void
nouveau_pushbuf_fini(struct nouveau_channel *chan)
{
struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
nouveau_pushbuf_fini_call(chan);
free(nvpb->buffers);
free(nvpb->relocs);
}
int
nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
{