aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_grctx.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-12-23 18:33:33 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-12-28 19:51:27 -0500
commitb1cd916ab96e5fcd16e2009410af2e8edfae2962 (patch)
treebdacd0667d133053b9c9c91465b42de89fbd251d /drivers/gpu/drm/nouveau/nvc0_grctx.c
parent8e91182bbdb8591be4835907d825a5b9a80495a9 (diff)
drm/nvc0: kill off a couple more magics
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_grctx.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grctx.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_grctx.c b/drivers/gpu/drm/nouveau/nvc0_grctx.c
index 88fa6211ac19..fddfab73a58d 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grctx.c
+++ b/drivers/gpu/drm/nouveau/nvc0_grctx.c
@@ -1875,9 +1875,11 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
1875 } 1875 }
1876 1876
1877 if (1) { 1877 if (1) {
1878 u32 data[6] = {}; 1878 u32 data[6] = {}, data2[2] = {};
1879 u8 tpnr[GPC_MAX]; 1879 u8 tpnr[GPC_MAX];
1880 u8 shift, ntpcv;
1880 1881
1882 /* calculate first set of magics */
1881 memcpy(tpnr, priv->tp_nr, sizeof(priv->tp_nr)); 1883 memcpy(tpnr, priv->tp_nr, sizeof(priv->tp_nr));
1882 1884
1883 for (tp = 0; tp < priv->tp_total; tp++) { 1885 for (tp = 0; tp < priv->tp_total; tp++) {
@@ -1892,6 +1894,20 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
1892 for (; tp < 32; tp++) 1894 for (; tp < 32; tp++)
1893 data[tp / 6] |= 7 << ((tp % 6) * 5); 1895 data[tp / 6] |= 7 << ((tp % 6) * 5);
1894 1896
1897 /* and the second... */
1898 shift = 0;
1899 ntpcv = priv->tp_total;
1900 while (!(ntpcv & (1 << 4))) {
1901 ntpcv <<= 1;
1902 shift++;
1903 }
1904
1905 data2[0] = (ntpcv << 16);
1906 data2[0] |= (shift << 21);
1907 data2[0] |= (((1 << (0 + 5)) % ntpcv) << 24);
1908 for (i = 1; i < 7; i++)
1909 data2[1] |= ((1 << (i + 5)) % ntpcv) << ((i - 1) * 5);
1910
1895 // GPC_BROADCAST 1911 // GPC_BROADCAST
1896 nv_wr32(dev, 0x418bb8, (priv->tp_total << 8) | 1912 nv_wr32(dev, 0x418bb8, (priv->tp_total << 8) |
1897 priv->magic_not_rop_nr); 1913 priv->magic_not_rop_nr);
@@ -1900,9 +1916,9 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
1900 1916
1901 // GPC_BROADCAST.TP_BROADCAST 1917 // GPC_BROADCAST.TP_BROADCAST
1902 nv_wr32(dev, 0x419bd0, (priv->tp_total << 8) | 1918 nv_wr32(dev, 0x419bd0, (priv->tp_total << 8) |
1903 priv->magic_not_rop_nr | 1919 priv->magic_not_rop_nr |
1904 priv->magic419bd0); 1920 data2[0]);
1905 nv_wr32(dev, 0x419be4, priv->magic419be4); 1921 nv_wr32(dev, 0x419be4, data2[1]);
1906 for (i = 0; i < 6; i++) 1922 for (i = 0; i < 6; i++)
1907 nv_wr32(dev, 0x419b00 + (i * 4), data[i]); 1923 nv_wr32(dev, 0x419b00 + (i * 4), data[i]);
1908 1924