Merge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2...
[pandora-kernel.git] / drivers / gpu / drm / nouveau / nvc0_grctx.c
index a45cdc4..f880ff7 100644 (file)
@@ -1801,7 +1801,7 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
        struct nvc0_graph_chan *grch = chan->pgraph_ctx;
        struct drm_device *dev = chan->dev;
        int i, gpc, tp, id;
-       u32 r000260;
+       u32 r000260, tmp;
 
        r000260 = nv_rd32(dev, 0x000260);
        nv_wr32(dev, 0x000260, r000260 & ~1);
@@ -1830,7 +1830,7 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
 
        for (tp = 0, id = 0; tp < 4; tp++) {
                for (gpc = 0; gpc < priv->gpc_nr; gpc++) {
-                       if (tp <= priv->tp_nr[gpc]) {
+                       if (tp < priv->tp_nr[gpc]) {
                                nv_wr32(dev, TP_UNIT(gpc, tp, 0x698), id);
                                nv_wr32(dev, TP_UNIT(gpc, tp, 0x4e8), id);
                                nv_wr32(dev, GPC_UNIT(gpc, 0x0c10 + tp * 4), id);
@@ -1843,8 +1843,12 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
                }
        }
 
-       nv_wr32(dev, 0x406028, 0x00000443);
-       nv_wr32(dev, 0x405870, 0x00000443);
+       tmp = 0;
+       for (i = 0; i < priv->gpc_nr; i++)
+               tmp |= priv->tp_nr[i] << (i * 4);
+       nv_wr32(dev, 0x406028, tmp);
+       nv_wr32(dev, 0x405870, tmp);
+
        nv_wr32(dev, 0x40602c, 0x00000000);
        nv_wr32(dev, 0x405874, 0x00000000);
        nv_wr32(dev, 0x406030, 0x00000000);