summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nv10_fence.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2012-11-25 23:04:23 +0100
committerBen Skeggs <bskeggs@redhat.com>2012-11-29 09:58:11 +1000
commit04c8c21085e13011a2eaf3ae518ab44e23e21917 (patch)
treeeb7fe589503f248555e3fc7e33d071932c78dd86 /drivers/gpu/drm/nouveau/nv10_fence.c
parent124ea297c8f0e0a3a567af0894fdbe05caaf80ec (diff)
downloadlwn-04c8c21085e13011a2eaf3ae518ab44e23e21917.tar.gz
lwn-04c8c21085e13011a2eaf3ae518ab44e23e21917.zip
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>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv10_fence.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv10_fence.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c
index ce752bf5cc4e..7ae7f97a6d4d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -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);
}