aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-25 17:38:59 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 00:11:18 -0500
commite419cf0954901bb3a987f8b76cbc9654ca06121c (patch)
tree550f2a7c40b6112f88306f362dc0eaa4d0a8198f /drivers
parent1f6d2de2c539df6fe52ad2187191a9dfe10c7233 (diff)
drm/nouveau: Add a separate class for the kernel channel mutex.
nouveau_bo_move_m2mf() needs to lock the kernel channel, and it may be called from the pushbuf IOCTL with an user channel already locked. Use a separate subclass for the kernel channel mutex because this is legitimate mutex nesting. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index cdc8f544d47f..099f806f39ed 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -678,7 +678,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
678 chan = nvbo->channel; 678 chan = nvbo->channel;
679 if (!chan || nvbo->no_vm) { 679 if (!chan || nvbo->no_vm) {
680 chan = dev_priv->channel; 680 chan = dev_priv->channel;
681 mutex_lock(&chan->mutex); 681 mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX);
682 } 682 }
683 683
684 if (dev_priv->card_type < NV_50) 684 if (dev_priv->card_type < NV_50)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 5814db82f778..ce0475ead381 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -173,6 +173,11 @@ struct nouveau_page_flip_state {
173 uint64_t offset; 173 uint64_t offset;
174}; 174};
175 175
176enum nouveau_channel_mutex_class {
177 NOUVEAU_UCHANNEL_MUTEX,
178 NOUVEAU_KCHANNEL_MUTEX
179};
180
176struct nouveau_channel { 181struct nouveau_channel {
177 struct drm_device *dev; 182 struct drm_device *dev;
178 int id; 183 int id;