diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-08-03 22:07:08 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-10-04 20:00:34 -0400 |
commit | 42311ff90dc8746bd81427b2ed6efda9af791b77 (patch) | |
tree | f41e0b9703463f712e1af5a817f0c81639336a9b /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | a845fff841b13678b2d80f10425aba87db840e4a (diff) |
drm/ttm: introduce utility function to free an allocated memory node
Existing core code/drivers call drm_mm_put_block on ttm_mem_reg.mm_node
directly. Future patches will modify TTM behaviour in such a way that
ttm_mem_reg.mm_node doesn't necessarily belong to drm_mm.
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Acked-by: Thomas Hellström <thellstrom@vmware.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 4e813638bdb7..f685f392c226 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -693,12 +693,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, | |||
693 | 693 | ||
694 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); | 694 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, new_mem); |
695 | out: | 695 | out: |
696 | if (tmp_mem.mm_node) { | 696 | ttm_bo_mem_put(bo, &tmp_mem); |
697 | spin_lock(&bo->bdev->glob->lru_lock); | ||
698 | drm_mm_put_block(tmp_mem.mm_node); | ||
699 | spin_unlock(&bo->bdev->glob->lru_lock); | ||
700 | } | ||
701 | |||
702 | return ret; | 697 | return ret; |
703 | } | 698 | } |
704 | 699 | ||
@@ -731,12 +726,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, | |||
731 | goto out; | 726 | goto out; |
732 | 727 | ||
733 | out: | 728 | out: |
734 | if (tmp_mem.mm_node) { | 729 | ttm_bo_mem_put(bo, &tmp_mem); |
735 | spin_lock(&bo->bdev->glob->lru_lock); | ||
736 | drm_mm_put_block(tmp_mem.mm_node); | ||
737 | spin_unlock(&bo->bdev->glob->lru_lock); | ||
738 | } | ||
739 | |||
740 | return ret; | 730 | return ret; |
741 | } | 731 | } |
742 | 732 | ||