diff options
author | Marcin Slusarz <marcin.slusarz@gmail.com> | 2012-11-25 23:04:23 +0100 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-11-29 09:58:11 +1000 |
commit | 04c8c21085e13011a2eaf3ae518ab44e23e21917 (patch) | |
tree | eb7fe589503f248555e3fc7e33d071932c78dd86 /drivers/gpu/drm/nouveau/nv04_crtc.c | |
parent | 124ea297c8f0e0a3a567af0894fdbe05caaf80ec (diff) |
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/nv04_crtc.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_crtc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c index 82a0d9c6cda3..6578cd28c556 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c @@ -730,6 +730,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc) drm_crtc_cleanup(crtc); nouveau_bo_unmap(nv_crtc->cursor.nvbo); + nouveau_bo_unpin(nv_crtc->cursor.nvbo); nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo); kfree(nv_crtc); } @@ -1056,8 +1057,11 @@ nv04_crtc_create(struct drm_device *dev, int crtc_num) 0, 0x0000, NULL, &nv_crtc->cursor.nvbo); if (!ret) { ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM); - if (!ret) + if (!ret) { ret = nouveau_bo_map(nv_crtc->cursor.nvbo); + if (ret) + nouveau_bo_unpin(nv_crtc->cursor.nvbo); + } if (ret) nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo); } |