Skip to content

Commit

Permalink
drm/nv50-nv84/fifo: fix resume regression introduced by playlist race…
Browse files Browse the repository at this point in the history
… fix

Reported-by: Maarten Maathuis <madman2003@gmail.com>
Reported-by: Sven Joachim <svenjoac@gmx.de>
Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jun 5, 2013
1 parent beba44b commit 89e033a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
* FIFO channel objects
******************************************************************************/

void
nv50_fifo_playlist_update(struct nv50_fifo_priv *priv)
static void
nv50_fifo_playlist_update_locked(struct nv50_fifo_priv *priv)
{
struct nouveau_bar *bar = nouveau_bar(priv);
struct nouveau_gpuobj *cur;
int i, p;

mutex_lock(&nv_subdev(priv)->mutex);
cur = priv->playlist[priv->cur_playlist];
priv->cur_playlist = !priv->cur_playlist;

Expand All @@ -61,6 +60,13 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv)
nv_wr32(priv, 0x0032f4, cur->addr >> 12);
nv_wr32(priv, 0x0032ec, p);
nv_wr32(priv, 0x002500, 0x00000101);
}

void
nv50_fifo_playlist_update(struct nv50_fifo_priv *priv)
{
mutex_lock(&nv_subdev(priv)->mutex);
nv50_fifo_playlist_update_locked(priv);
mutex_unlock(&nv_subdev(priv)->mutex);
}

Expand Down Expand Up @@ -489,7 +495,7 @@ nv50_fifo_init(struct nouveau_object *object)

for (i = 0; i < 128; i++)
nv_wr32(priv, 0x002600 + (i * 4), 0x00000000);
nv50_fifo_playlist_update(priv);
nv50_fifo_playlist_update_locked(priv);

nv_wr32(priv, 0x003200, 0x00000001);
nv_wr32(priv, 0x003250, 0x00000001);
Expand Down

0 comments on commit 89e033a

Please sign in to comment.