Commit b5096566 authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9426eedb
...@@ -47,6 +47,7 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) ...@@ -47,6 +47,7 @@ nv50_fifo_playlist_update(struct nv50_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;
...@@ -60,6 +61,7 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) ...@@ -60,6 +61,7 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv)
nv_wr32(priv, 0x0032f4, cur->addr >> 12); nv_wr32(priv, 0x0032f4, cur->addr >> 12);
nv_wr32(priv, 0x0032ec, p); nv_wr32(priv, 0x0032ec, p);
nv_wr32(priv, 0x002500, 0x00000101); nv_wr32(priv, 0x002500, 0x00000101);
mutex_unlock(&nv_subdev(priv)->mutex);
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment