aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-03-04 23:46:48 -0500
committerBen Skeggs <bskeggs@redhat.com>2014-03-26 00:08:16 -0400
commit1f1ac3bf2a804911ad46076b10ce15364237a698 (patch)
treeaa5a6ec206fba9a6ffb9ae535ea97a978c80f6dc
parent6f1e9b99b329238e3a3989785cf0dff67db78b1a (diff)
drm/gk104/gr: therm magic needed on some kepler boards
Not needed everywhere, and potentially not safe to do depending on how the rest of PTHERM is configured... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nve4.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c
index 6e73b18920b8..f7c011217175 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c
@@ -189,6 +189,29 @@ nve4_graph_pack_mmio[] = {
189 * PGRAPH engine/subdev functions 189 * PGRAPH engine/subdev functions
190 ******************************************************************************/ 190 ******************************************************************************/
191 191
192static int
193nve4_graph_fini(struct nouveau_object *object, bool suspend)
194{
195 struct nvc0_graph_priv *priv = (void *)object;
196
197 /*XXX: this is a nasty hack to power on gr on certain boards
198 * where it's disabled by therm, somehow. ideally it'd
199 * be nice to know when we should be doing this, and why,
200 * but, it's yet to be determined. for now we test for
201 * the particular mmio error that occurs in the situation,
202 * and then bash therm in the way nvidia do.
203 */
204 nv_mask(priv, 0x000200, 0x08001000, 0x08001000);
205 nv_rd32(priv, 0x000200);
206 if (nv_rd32(priv, 0x400700) == 0xbadf1000) {
207 nv_mask(priv, 0x000200, 0x08001000, 0x00000000);
208 nv_rd32(priv, 0x000200);
209 nv_mask(priv, 0x020004, 0xc0000000, 0x40000000);
210 }
211
212 return nouveau_graph_fini(&priv->base, suspend);
213}
214
192int 215int
193nve4_graph_init(struct nouveau_object *object) 216nve4_graph_init(struct nouveau_object *object)
194{ 217{
@@ -327,7 +350,7 @@ nve4_graph_oclass = &(struct nvc0_graph_oclass) {
327 .ctor = nvc0_graph_ctor, 350 .ctor = nvc0_graph_ctor,
328 .dtor = nvc0_graph_dtor, 351 .dtor = nvc0_graph_dtor,
329 .init = nve4_graph_init, 352 .init = nve4_graph_init,
330 .fini = _nouveau_graph_fini, 353 .fini = nve4_graph_fini,
331 }, 354 },
332 .cclass = &nve4_grctx_oclass, 355 .cclass = &nve4_grctx_oclass,
333 .sclass = nve4_graph_sclass, 356 .sclass = nve4_graph_sclass,