aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-03-15 22:40:17 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-03-22 03:17:26 -0400
commitaccf94969f226ddfe7dd3a6a76ce093ace839b26 (patch)
treed376e4f4240ed414388d19aaa1fd1df3d1a2e54e /drivers/gpu/drm/nouveau/nouveau_bo.c
parent2f5394c3ed573de2ab18cdac503b8045cd16ac5e (diff)
drm/nouveau/ttm: always do buffer moves on kernel channel
There was once good reasons for wanting the drm to be able to use M2MF etc on user channels, but they're not relevant anymore. For the general buffer move case, we've already lost by transferring between vram/sysmem already so the context switching overhead is minimal in comparison. 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.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