提交 e419cf09 编写于 作者: F Francisco Jerez 提交者: Ben Skeggs

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: NFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 1f6d2de2
......@@ -678,7 +678,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
chan = nvbo->channel;
if (!chan || nvbo->no_vm) {
chan = dev_priv->channel;
mutex_lock(&chan->mutex);
mutex_lock_nested(&chan->mutex, NOUVEAU_KCHANNEL_MUTEX);
}
if (dev_priv->card_type < NV_50)
......
......@@ -173,6 +173,11 @@ struct nouveau_page_flip_state {
uint64_t offset;
};
enum nouveau_channel_mutex_class {
NOUVEAU_UCHANNEL_MUTEX,
NOUVEAU_KCHANNEL_MUTEX
};
struct nouveau_channel {
struct drm_device *dev;
int id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册