drm/nve0/fifo: use runlist event instead of polling
authorBen Skeggs <bskeggs@redhat.com>
Sun, 23 Feb 2014 13:27:25 +0000 (23:27 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 26 Mar 2014 04:00:52 +0000 (14:00 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c

index ad8e678d384ce850fb2c234ada0d79922c39be96..bd67906ba0b7a04d40fcb3f8b8adbac7dbb70594 100644 (file)
@@ -118,7 +118,9 @@ nve0_fifo_runlist_update(struct nve0_fifo_priv *priv, u32 engine)
        nv_wr32(priv, 0x002270, cur->addr >> 12);
        nv_wr32(priv, 0x002274, (engine << 20) | (p >> 3));
 
-       if (!nv_wait(priv, 0x002284 + (engine * 8), 0x00100000, 0x00000000))
+       if (wait_event_timeout(engn->wait, !(nv_rd32(priv, 0x002284 +
+                              (engine * 0x08)) & 0x00100000),
+                               msecs_to_jiffies(2000)) == 0)
                nv_error(priv, "runlist %d update timeout\n", engine);
        mutex_unlock(&nv_subdev(priv)->mutex);
 }