drm/nouveau/gr/gk104-gk20a: call pmu to disable any power-gating before ctor()
authorBen Skeggs <bskeggs@redhat.com>
Fri, 20 Mar 2015 05:38:23 +0000 (15:38 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 14 Apr 2015 07:00:51 +0000 (17:00 +1000)
On some of these chipsets, reading NV_PGRAPH_GPC_GPM_PD_PES_TPC_ID_MASK
can trigger a PRI fault and return an error code instead of a TPC mask,
unless PGOB has been disabled first.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.c

index fc821825a3cf1b49f05a685dffb0c6c4cefbf8a9..3110f63e00cb151ce763d6b778cae48d3b93dd79 100644 (file)
@@ -124,6 +124,9 @@ void gf100_gr_dtor(struct nvkm_object *);
 int  gf100_gr_init(struct nvkm_object *);
 void gf100_gr_zbc_init(struct gf100_gr_priv *);
 
+int  gk104_gr_ctor(struct nvkm_object *, struct nvkm_object *,
+                    struct nvkm_oclass *, void *data, u32 size,
+                    struct nvkm_object **);
 int  gk104_gr_init(struct nvkm_object *);
 
 extern struct nvkm_ofuncs gf100_fermi_ofuncs;
index 489fdd94b885c375dc160e5ff58a399fad83a70e..9d85238d024a03e937b19ac40a390ed923faa582 100644 (file)
@@ -310,6 +310,17 @@ gk104_gr_init(struct nvkm_object *object)
        return gf100_gr_init_ctxctl(priv);
 }
 
+int
+gk104_gr_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
+             struct nvkm_oclass *oclass, void *data, u32 size,
+             struct nvkm_object **pobject)
+{
+       struct nvkm_pmu *pmu = nvkm_pmu(parent);
+       if (pmu)
+               pmu->pgob(pmu, false);
+       return gf100_gr_ctor(parent, engine, oclass, data, size, pobject);
+}
+
 #include "fuc/hubgk104.fuc3.h"
 
 static struct gf100_gr_ucode
@@ -334,7 +345,7 @@ struct nvkm_oclass *
 gk104_gr_oclass = &(struct gf100_gr_oclass) {
        .base.handle = NV_ENGINE(GR, 0xe4),
        .base.ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = gf100_gr_ctor,
+               .ctor = gk104_gr_ctor,
                .dtor = gf100_gr_dtor,
                .init = gk104_gr_init,
                .fini = _nvkm_gr_fini,
index 29569ac6b47babee1b398a3186e87d43c72959d5..291b60a9262e2492b19b86c611495ce09b73b3ca 100644 (file)
@@ -197,7 +197,7 @@ struct nvkm_oclass *
 gk110_gr_oclass = &(struct gf100_gr_oclass) {
        .base.handle = NV_ENGINE(GR, 0xf0),
        .base.ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = gf100_gr_ctor,
+               .ctor = gk104_gr_ctor,
                .dtor = gf100_gr_dtor,
                .init = gk104_gr_init,
                .fini = _nvkm_gr_fini,
index 7771451af50b6fa85c0f3aad5c3e27c16046529a..9ff9eab0ccaff2dd1ab48ef384ac9b10eefe939e 100644 (file)
@@ -102,7 +102,7 @@ struct nvkm_oclass *
 gk110b_gr_oclass = &(struct gf100_gr_oclass) {
        .base.handle = NV_ENGINE(GR, 0xf1),
        .base.ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = gf100_gr_ctor,
+               .ctor = gk104_gr_ctor,
                .dtor = gf100_gr_dtor,
                .init = gk104_gr_init,
                .fini = _nvkm_gr_fini,
index 31d8e6055376da286540bc743921c97b6c0c3e42..22d67fd8c323b04eadbd775ec2ffa56897940045 100644 (file)
@@ -176,7 +176,7 @@ struct nvkm_oclass *
 gk208_gr_oclass = &(struct gf100_gr_oclass) {
        .base.handle = NV_ENGINE(GR, 0x08),
        .base.ofuncs = &(struct nvkm_ofuncs) {
-               .ctor = gf100_gr_ctor,
+               .ctor = gk104_gr_ctor,
                .dtor = gf100_gr_dtor,
                .init = gk104_gr_init,
                .fini = _nvkm_gr_fini,