diff options
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 724b41a2b9e9..ec54364ac828 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -812,6 +812,10 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) | |||
812 | struct nouveau_bo *nvbo = nouveau_bo(bo); | 812 | struct nouveau_bo *nvbo = nouveau_bo(bo); |
813 | struct nouveau_vma *vma; | 813 | struct nouveau_vma *vma; |
814 | 814 | ||
815 | /* ttm can now (stupidly) pass the driver bos it didn't create... */ | ||
816 | if (bo->destroy != nouveau_bo_del_ttm) | ||
817 | return; | ||
818 | |||
815 | list_for_each_entry(vma, &nvbo->vma_list, head) { | 819 | list_for_each_entry(vma, &nvbo->vma_list, head) { |
816 | if (new_mem && new_mem->mem_type == TTM_PL_VRAM) { | 820 | if (new_mem && new_mem->mem_type == TTM_PL_VRAM) { |
817 | nouveau_vm_map(vma, new_mem->mm_node); | 821 | nouveau_vm_map(vma, new_mem->mm_node); |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 2f0eab66ece6..7c3a57de8187 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -404,6 +404,9 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, | |||
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
407 | if (bdev->driver->move_notify) | ||
408 | bdev->driver->move_notify(bo, mem); | ||
409 | |||
407 | if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && | 410 | if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && |
408 | !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) | 411 | !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) |
409 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, mem); | 412 | ret = ttm_bo_move_ttm(bo, evict, no_wait_reserve, no_wait_gpu, mem); |
@@ -413,11 +416,17 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, | |||
413 | else | 416 | else |
414 | ret = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, mem); | 417 | ret = ttm_bo_move_memcpy(bo, evict, no_wait_reserve, no_wait_gpu, mem); |
415 | 418 | ||
416 | if (ret) | 419 | if (ret) { |
417 | goto out_err; | 420 | if (bdev->driver->move_notify) { |
421 | struct ttm_mem_reg tmp_mem = *mem; | ||
422 | *mem = bo->mem; | ||
423 | bo->mem = tmp_mem; | ||
424 | bdev->driver->move_notify(bo, mem); | ||
425 | bo->mem = *mem; | ||
426 | } | ||
418 | 427 | ||
419 | if (bdev->driver->move_notify) | 428 | goto out_err; |
420 | bdev->driver->move_notify(bo, mem); | 429 | } |
421 | 430 | ||
422 | moved: | 431 | moved: |
423 | if (bo->evicted) { | 432 | if (bo->evicted) { |