drm/nvc0/fifo: prevent races between clients updating playlists

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Ben Skeggs 2013-05-13 10:02:11 +10:00
Родитель c2e3259b7b
Коммит fadb171902
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -71,6 +71,7 @@ nvc0_fifo_playlist_update(struct nvc0_fifo_priv *priv)
struct nouveau_gpuobj *cur; struct nouveau_gpuobj *cur;
int i, p; int i, p;
mutex_lock(&nv_subdev(priv)->mutex);
cur = priv->playlist[priv->cur_playlist]; cur = priv->playlist[priv->cur_playlist];
priv->cur_playlist = !priv->cur_playlist; priv->cur_playlist = !priv->cur_playlist;
@ -87,6 +88,7 @@ nvc0_fifo_playlist_update(struct nvc0_fifo_priv *priv)
nv_wr32(priv, 0x002274, 0x01f00000 | (p >> 3)); nv_wr32(priv, 0x002274, 0x01f00000 | (p >> 3));
if (!nv_wait(priv, 0x00227c, 0x00100000, 0x00000000)) if (!nv_wait(priv, 0x00227c, 0x00100000, 0x00000000))
nv_error(priv, "playlist update failed\n"); nv_error(priv, "playlist update failed\n");
mutex_unlock(&nv_subdev(priv)->mutex);
} }
static int static int