diff options
author | Jerome Glisse <jglisse@redhat.com> | 2011-11-18 11:47:03 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-12-06 05:40:23 -0500 |
commit | dc97b3409a790d2a21aac6e5cdb99558b5944119 (patch) | |
tree | afad2825ec463545dda7477be40ddb437686b58d /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 57de4ba959b290f0b8cf36ecd5e7f1b29d4b8a12 (diff) |
drm/ttm: callback move_notify any time bo placement change v4
Previously we were calling back move_notify in error path when the
bo is returned to it's original position or when destroy the bo.
When destroying the bo set the new mem placement as NULL when calling
back in the driver.
Updating nouveau to deal with NULL placement properly.
v2: reserve the object before calling move_notify in bo destroy path
at that point ttm should be the only piece of code interacting
with the object so atomic_set is safe here.
v3: callback move notify only once the bo is in its new position
call move notify want swaping out the buffer
v4:- don't call move_notify when swapin out bo, assume driver should
do what is appropriate in swap notify
- move move_notify call back to ttm_bo_cleanup_memtype_use for
destroy path
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 7ac7bc3a8de3..b1b33a108b31 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -815,10 +815,10 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) | |||
815 | struct nouveau_vma *vma; | 815 | struct nouveau_vma *vma; |
816 | 816 | ||
817 | list_for_each_entry(vma, &nvbo->vma_list, head) { | 817 | list_for_each_entry(vma, &nvbo->vma_list, head) { |
818 | if (new_mem->mem_type == TTM_PL_VRAM) { | 818 | if (new_mem && new_mem->mem_type == TTM_PL_VRAM) { |
819 | nouveau_vm_map(vma, new_mem->mm_node); | 819 | nouveau_vm_map(vma, new_mem->mm_node); |
820 | } else | 820 | } else |
821 | if (new_mem->mem_type == TTM_PL_TT && | 821 | if (new_mem && new_mem->mem_type == TTM_PL_TT && |
822 | nvbo->page_shift == vma->vm->spg_shift) { | 822 | nvbo->page_shift == vma->vm->spg_shift) { |
823 | nouveau_vm_map_sg(vma, 0, new_mem-> | 823 | nouveau_vm_map_sg(vma, 0, new_mem-> |
824 | num_pages << PAGE_SHIFT, | 824 | num_pages << PAGE_SHIFT, |