aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index ec54364ac828..7d15a774f9c9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -693,16 +693,12 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
693 struct ttm_mem_reg *new_mem) 693 struct ttm_mem_reg *new_mem)
694{ 694{
695 struct drm_nouveau_private *dev_priv = nouveau_bdev(bo->bdev); 695 struct drm_nouveau_private *dev_priv = nouveau_bdev(bo->bdev);
696 struct nouveau_channel *chan = chan = dev_priv->channel;
696 struct nouveau_bo *nvbo = nouveau_bo(bo); 697 struct nouveau_bo *nvbo = nouveau_bo(bo);
697 struct ttm_mem_reg *old_mem = &bo->mem; 698 struct ttm_mem_reg *old_mem = &bo->mem;
698 struct nouveau_channel *chan;
699 int ret; 699 int ret;
700 700
701 chan = nvbo->channel; 701 mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX);
702 if (!chan) {
703 chan = dev_priv->channel;
704 mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX);
705 }
706 702
707 /* create temporary vmas for the transfer and attach them to the 703 /* create temporary vmas for the transfer and attach them to the
708 * old nouveau_mem node, these will get cleaned up after ttm has 704 * old nouveau_mem node, these will get cleaned up after ttm has
@@ -734,8 +730,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
734 } 730 }
735 731
736out: 732out:
737 if (chan == dev_priv->channel) 733 mutex_unlock(&chan->mutex);
738 mutex_unlock(&chan->mutex);
739 return ret; 734 return ret;
740} 735}
741 736