Commit fadb1719 authored by Ben Skeggs's avatar Ben Skeggs

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

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent c2e3259b
...@@ -71,6 +71,7 @@ nvc0_fifo_playlist_update(struct nvc0_fifo_priv *priv) ...@@ -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) ...@@ -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
......
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