Skip to content

Commit

Permalink
drm/nouveau: require explicit unmap of kmapped bos
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Sep 24, 2010
1 parent e694438 commit 9d59e8a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
struct drm_device *dev = dev_priv->dev;
struct nouveau_bo *nvbo = nouveau_bo(bo);

ttm_bo_kunmap(&nvbo->kmap);

if (unlikely(nvbo->gem))
DRM_ERROR("bo %p still attached to GEM object\n", bo);

Expand Down Expand Up @@ -305,7 +303,8 @@ nouveau_bo_map(struct nouveau_bo *nvbo)
void
nouveau_bo_unmap(struct nouveau_bo *nvbo)
{
ttm_bo_kunmap(&nvbo->kmap);
if (nvbo)
ttm_bo_kunmap(&nvbo->kmap);
}

u16
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nouveau_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ nouveau_channel_free(struct nouveau_channel *chan)
/* Release the channel's resources */
nouveau_gpuobj_ref_del(dev, &chan->pushbuf);
if (chan->pushbuf_bo) {
nouveau_bo_unmap(chan->pushbuf_bo);
nouveau_bo_unpin(chan->pushbuf_bo);
nouveau_bo_ref(NULL, &chan->pushbuf_bo);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nv04_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ static void nv_crtc_destroy(struct drm_crtc *crtc)

drm_crtc_cleanup(crtc);

nouveau_bo_unmap(nv_crtc->cursor.nvbo);
nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
kfree(nv_crtc);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/nouveau/nv50_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ nv50_crtc_destroy(struct drm_crtc *crtc)

nv50_cursor_fini(nv_crtc);

nouveau_bo_unmap(nv_crtc->lut.nvbo);
nouveau_bo_ref(NULL, &nv_crtc->lut.nvbo);
nouveau_bo_unmap(nv_crtc->cursor.nvbo);
nouveau_bo_ref(NULL, &nv_crtc->cursor.nvbo);
kfree(nv_crtc->mode);
kfree(nv_crtc);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nv50_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ nv50_evo_channel_del(struct nouveau_channel **pchan)
*pchan = NULL;

nouveau_gpuobj_channel_takedown(chan);
nouveau_bo_unmap(chan->pushbuf_bo);
nouveau_bo_ref(NULL, &chan->pushbuf_bo);

if (chan->user)
Expand Down

0 comments on commit 9d59e8a

Please sign in to comment.