drm/nv50: wait for pgraph to idle before unloading the context
authorMaarten Maathuis <madman2003@gmail.com>
Mon, 11 Jan 2010 20:18:53 +0000 (21:18 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Jan 2010 08:48:21 +0000 (18:48 +1000)
This should fix the problem with gpu hangs people have had when closing
channels.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nv50_graph.c

index ca79f32be44c13bcaba47e00f189b8e3067bbf55..56a9753db23c9dad2c219a13aa1eaf7706ae70cd 100644 (file)
@@ -282,6 +282,7 @@ nv50_graph_unload_context(struct drm_device *dev)
                return 0;
        inst &= NV50_PGRAPH_CTXCTL_CUR_INSTANCE;
 
+       nouveau_wait_for_idle(dev);
        nv_wr32(dev, 0x400500, fifo & ~1);
        nv_wr32(dev, 0x400784, inst);
        nv_wr32(dev, 0x400824, nv_rd32(dev, 0x400824) | 0x20);