aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-02-22 18:00:35 -0500
committerBen Skeggs <bskeggs@redhat.com>2011-02-24 15:46:10 -0500
commit562af10c676936ba510860d3a25e60e55312d5cd (patch)
treee67c014bf376d703e0b0a713bdfb2da7221df161
parent8f7286f8e4e80f7b868ba3d117ae900f0d207cbe (diff)
drm/nv50: flesh out ZCULL init and match nvidia on later chipsets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nv50_graph.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_graph.c b/drivers/gpu/drm/nouveau/nv50_graph.c
index 289c0dd6c53d..e1267a1f6d10 100644
--- a/drivers/gpu/drm/nouveau/nv50_graph.c
+++ b/drivers/gpu/drm/nouveau/nv50_graph.c
@@ -95,13 +95,41 @@ nv50_graph_init_regs__nv(struct drm_device *dev)
95} 95}
96 96
97static void 97static void
98nv50_graph_init_regs(struct drm_device *dev) 98nv50_graph_init_zcull(struct drm_device *dev)
99{ 99{
100 struct drm_nouveau_private *dev_priv = dev->dev_private;
101 int i;
102
100 NV_DEBUG(dev, "\n"); 103 NV_DEBUG(dev, "\n");
101 104
102 nv_wr32(dev, NV04_PGRAPH_DEBUG_3, 105 switch (dev_priv->chipset & 0xf0) {
103 (1 << 2) /* HW_CONTEXT_SWITCH_ENABLED */); 106 case 0x50:
104 nv_wr32(dev, 0x402ca8, 0x800); 107 case 0x80:
108 case 0x90:
109 nv_wr32(dev, 0x402ca8, 0x00000800);
110 break;
111 case 0xa0:
112 default:
113 nv_wr32(dev, 0x402cc0, 0x00000000);
114 if (dev_priv->chipset == 0xa0 ||
115 dev_priv->chipset == 0xaa ||
116 dev_priv->chipset == 0xac) {
117 nv_wr32(dev, 0x402ca8, 0x00000802);
118 } else {
119 nv_wr32(dev, 0x402cc0, 0x00000000);
120 nv_wr32(dev, 0x402ca8, 0x00000002);
121 }
122
123 break;
124 }
125
126 /* zero out zcull regions */
127 for (i = 0; i < 8; i++) {
128 nv_wr32(dev, 0x402c20 + (i * 8), 0x00000000);
129 nv_wr32(dev, 0x402c24 + (i * 8), 0x00000000);
130 nv_wr32(dev, 0x402c28 + (i * 8), 0x00000000);
131 nv_wr32(dev, 0x402c2c + (i * 8), 0x00000000);
132 }
105} 133}
106 134
107static int 135static int
@@ -136,6 +164,7 @@ nv50_graph_init_ctxctl(struct drm_device *dev)
136 } 164 }
137 kfree(cp); 165 kfree(cp);
138 166
167 nv_wr32(dev, 0x40008c, 0x00000004); /* HW_CTX_SWITCH_ENABLED */
139 nv_wr32(dev, 0x400320, 4); 168 nv_wr32(dev, 0x400320, 4);
140 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0); 169 nv_wr32(dev, NV40_PGRAPH_CTXCTL_CUR, 0);
141 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, 0); 170 nv_wr32(dev, NV20_PGRAPH_CHANNEL_CTX_POINTER, 0);
@@ -151,7 +180,7 @@ nv50_graph_init(struct drm_device *dev)
151 180
152 nv50_graph_init_reset(dev); 181 nv50_graph_init_reset(dev);
153 nv50_graph_init_regs__nv(dev); 182 nv50_graph_init_regs__nv(dev);
154 nv50_graph_init_regs(dev); 183 nv50_graph_init_zcull(dev);
155 184
156 ret = nv50_graph_init_ctxctl(dev); 185 ret = nv50_graph_init_ctxctl(dev);
157 if (ret) 186 if (ret)