drm/nouveau: unpin various bo's before destroying
These objects leak VRAM - but only on module unload. Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:

committed by
Ben Skeggs

parent
124ea297c8
commit
04c8c21085
@@ -155,6 +155,8 @@ nv10_fence_destroy(struct nouveau_drm *drm)
|
||||
{
|
||||
struct nv10_fence_priv *priv = drm->fence;
|
||||
nouveau_bo_unmap(priv->bo);
|
||||
if (priv->bo)
|
||||
nouveau_bo_unpin(priv->bo);
|
||||
nouveau_bo_ref(NULL, &priv->bo);
|
||||
drm->fence = NULL;
|
||||
kfree(priv);
|
||||
@@ -183,8 +185,11 @@ nv10_fence_create(struct nouveau_drm *drm)
|
||||
0, 0x0000, NULL, &priv->bo);
|
||||
if (!ret) {
|
||||
ret = nouveau_bo_pin(priv->bo, TTM_PL_FLAG_VRAM);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
ret = nouveau_bo_map(priv->bo);
|
||||
if (ret)
|
||||
nouveau_bo_unpin(priv->bo);
|
||||
}
|
||||
if (ret)
|
||||
nouveau_bo_ref(NULL, &priv->bo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user