Commit ed22e684 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gk104-gk20a: call pmu to disable any power-gating before ctor()

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent f02a0e84
...@@ -124,6 +124,9 @@ void gf100_gr_dtor(struct nvkm_object *); ...@@ -124,6 +124,9 @@ void gf100_gr_dtor(struct nvkm_object *);
int gf100_gr_init(struct nvkm_object *); int gf100_gr_init(struct nvkm_object *);
void gf100_gr_zbc_init(struct gf100_gr_priv *); 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 *); int gk104_gr_init(struct nvkm_object *);
extern struct nvkm_ofuncs gf100_fermi_ofuncs; extern struct nvkm_ofuncs gf100_fermi_ofuncs;
......
...@@ -310,6 +310,17 @@ gk104_gr_init(struct nvkm_object *object) ...@@ -310,6 +310,17 @@ gk104_gr_init(struct nvkm_object *object)
return gf100_gr_init_ctxctl(priv); 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" #include "fuc/hubgk104.fuc3.h"
static struct gf100_gr_ucode static struct gf100_gr_ucode
...@@ -334,7 +345,7 @@ struct nvkm_oclass * ...@@ -334,7 +345,7 @@ struct nvkm_oclass *
gk104_gr_oclass = &(struct gf100_gr_oclass) { gk104_gr_oclass = &(struct gf100_gr_oclass) {
.base.handle = NV_ENGINE(GR, 0xe4), .base.handle = NV_ENGINE(GR, 0xe4),
.base.ofuncs = &(struct nvkm_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gf100_gr_ctor, .ctor = gk104_gr_ctor,
.dtor = gf100_gr_dtor, .dtor = gf100_gr_dtor,
.init = gk104_gr_init, .init = gk104_gr_init,
.fini = _nvkm_gr_fini, .fini = _nvkm_gr_fini,
......
...@@ -197,7 +197,7 @@ struct nvkm_oclass * ...@@ -197,7 +197,7 @@ struct nvkm_oclass *
gk110_gr_oclass = &(struct gf100_gr_oclass) { gk110_gr_oclass = &(struct gf100_gr_oclass) {
.base.handle = NV_ENGINE(GR, 0xf0), .base.handle = NV_ENGINE(GR, 0xf0),
.base.ofuncs = &(struct nvkm_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gf100_gr_ctor, .ctor = gk104_gr_ctor,
.dtor = gf100_gr_dtor, .dtor = gf100_gr_dtor,
.init = gk104_gr_init, .init = gk104_gr_init,
.fini = _nvkm_gr_fini, .fini = _nvkm_gr_fini,
......
...@@ -102,7 +102,7 @@ struct nvkm_oclass * ...@@ -102,7 +102,7 @@ struct nvkm_oclass *
gk110b_gr_oclass = &(struct gf100_gr_oclass) { gk110b_gr_oclass = &(struct gf100_gr_oclass) {
.base.handle = NV_ENGINE(GR, 0xf1), .base.handle = NV_ENGINE(GR, 0xf1),
.base.ofuncs = &(struct nvkm_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gf100_gr_ctor, .ctor = gk104_gr_ctor,
.dtor = gf100_gr_dtor, .dtor = gf100_gr_dtor,
.init = gk104_gr_init, .init = gk104_gr_init,
.fini = _nvkm_gr_fini, .fini = _nvkm_gr_fini,
......
...@@ -176,7 +176,7 @@ struct nvkm_oclass * ...@@ -176,7 +176,7 @@ struct nvkm_oclass *
gk208_gr_oclass = &(struct gf100_gr_oclass) { gk208_gr_oclass = &(struct gf100_gr_oclass) {
.base.handle = NV_ENGINE(GR, 0x08), .base.handle = NV_ENGINE(GR, 0x08),
.base.ofuncs = &(struct nvkm_ofuncs) { .base.ofuncs = &(struct nvkm_ofuncs) {
.ctor = gf100_gr_ctor, .ctor = gk104_gr_ctor,
.dtor = gf100_gr_dtor, .dtor = gf100_gr_dtor,
.init = gk104_gr_init, .init = gk104_gr_init,
.fini = _nvkm_gr_fini, .fini = _nvkm_gr_fini,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment