drm/nouveau: add reservation to nouveau_bo_vma_del
Subsystems (3)
PATCH 2/3 drm/nouveau: add reservation to nouveau_bo_vma_del
Signed-off-by Maarten Lankhorst <[email protected]>
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 16 ++++++++++++++++ drivers/gpu/drm/nouveau/nouveau_bo.h | 1 + drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +16 -0
@@ -1551,9 +1551,25 @@ nouveau_bo_vma_del(struct nouveau_bo *nvbo, struct nouveau_vma *vma) {if (vma->node) {if (nvbo->bo.mem.mem_type !=TTM_PL_SYSTEM ) { +ttm_bo_reserve (&nvbo->bo, false, false, false,0 );spin_lock (&nvbo->bo.bdev->fence_lock);ttm_bo_wait (&nvbo->bo, false, false, false);spin_unlock (&nvbo->bo.bdev->fence_lock); +ttm_bo_unreserve (&nvbo->bo); +nouveau_vm_unmap (vma); + } + +nouveau_vm_put (vma); +list_del (&vma->head); + } +} + +void +nouveau_bo_vma_del_reserved (struct nouveau_bo *nvbo,struct nouveau_vma *vma) +{ +if (vma->node) { +if (nvbo->bo.mem.mem_type !=TTM_PL_SYSTEM ) { +ttm_bo_wait (&nvbo->bo, false, false, false);nouveau_vm_unmap (vma); }
drivers/gpu/drm/nouveau/nouveau_bo.h +1 -0
@@ -84,6 +84,7 @@ nouveau_bo_vma_find(struct nouveau_bo *, struct nouveau_vm *);int nouveau_bo_vma_add (struct nouveau_bo *,struct nouveau_vm *,struct nouveau_vma *);void nouveau_bo_vma_del (struct nouveau_bo *,struct nouveau_vma *); +void nouveau_bo_vma_del_reserved (struct nouveau_bo *,struct nouveau_vma *);/* TODO: submit equivalent to TTM generic API upstream? */ static inline void __iomem *
drivers/gpu/drm/nouveau/nouveau_gem.c +1 -1
@@ -121,7 +121,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) vma =nouveau_bo_vma_find (nvbo, cli->base.vm);if (vma) {if (--vma->refcount ==0 ) { -nouveau_bo_vma_del (nvbo, vma); +nouveau_bo_vma_del_reserved (nvbo, vma);kfree (vma); } }