diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 14:10:29 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 15:28:15 -0400 |
commit | b81146b03bfaa62218ea334d0c39ad1bc21f42e6 (patch) | |
tree | 3861d7773a8a9879ba4a3a0f3f68e5dfebf66340 | |
parent | f331a15f84a94dce6f12cf0b7012174b4a6bf804 (diff) |
drm/gf100-/gr: fetch tpcs-per-ppc info on startup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
9 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/gk110b.c b/drivers/gpu/drm/nouveau/core/engine/graph/gk110b.c index fe71375a5791..d07b19dc168d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/gk110b.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/gk110b.c | |||
@@ -113,4 +113,5 @@ gk110b_graph_oclass = &(struct nvc0_graph_oclass) { | |||
113 | .mmio = gk110b_graph_pack_mmio, | 113 | .mmio = gk110b_graph_pack_mmio, |
114 | .fecs.ucode = &nvf0_graph_fecs_ucode, | 114 | .fecs.ucode = &nvf0_graph_fecs_ucode, |
115 | .gpccs.ucode = &nvf0_graph_gpccs_ucode, | 115 | .gpccs.ucode = &nvf0_graph_gpccs_ucode, |
116 | .ppc_nr = 2, | ||
116 | }.base; | 117 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/gk20a.c b/drivers/gpu/drm/nouveau/core/engine/graph/gk20a.c index 74a51fc2ec8a..2420251ebc67 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/gk20a.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/gk20a.c | |||
@@ -44,4 +44,5 @@ gk20a_graph_oclass = &(struct nvc0_graph_oclass) { | |||
44 | .cclass = &gk20a_grctx_oclass, | 44 | .cclass = &gk20a_grctx_oclass, |
45 | .sclass = gk20a_graph_sclass, | 45 | .sclass = gk20a_graph_sclass, |
46 | .mmio = nve4_graph_pack_mmio, | 46 | .mmio = nve4_graph_pack_mmio, |
47 | .ppc_nr = 1, | ||
47 | }.base; | 48 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/gm107.c b/drivers/gpu/drm/nouveau/core/engine/graph/gm107.c index 60d86f314281..e20b98dbaf3e 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/gm107.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/gm107.c | |||
@@ -465,4 +465,5 @@ gm107_graph_oclass = &(struct nvc0_graph_oclass) { | |||
465 | .mmio = gm107_graph_pack_mmio, | 465 | .mmio = gm107_graph_pack_mmio, |
466 | .fecs.ucode = 0 ? &gm107_graph_fecs_ucode : NULL, | 466 | .fecs.ucode = 0 ? &gm107_graph_fecs_ucode : NULL, |
467 | .gpccs.ucode = &gm107_graph_gpccs_ucode, | 467 | .gpccs.ucode = &gm107_graph_gpccs_ucode, |
468 | .ppc_nr = 2, | ||
468 | }.base; | 469 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv108.c b/drivers/gpu/drm/nouveau/core/engine/graph/nv108.c index 01e99faeb9a0..2b0e8f48c029 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nv108.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nv108.c | |||
@@ -220,4 +220,5 @@ nv108_graph_oclass = &(struct nvc0_graph_oclass) { | |||
220 | .mmio = nv108_graph_pack_mmio, | 220 | .mmio = nv108_graph_pack_mmio, |
221 | .fecs.ucode = &nv108_graph_fecs_ucode, | 221 | .fecs.ucode = &nv108_graph_fecs_ucode, |
222 | .gpccs.ucode = &nv108_graph_gpccs_ucode, | 222 | .gpccs.ucode = &nv108_graph_gpccs_ucode, |
223 | .ppc_nr = 1, | ||
223 | }.base; | 224 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c index 0f9847237347..85d5c36c3f0a 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c | |||
@@ -1503,7 +1503,7 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
1503 | struct nouveau_device *device = nv_device(parent); | 1503 | struct nouveau_device *device = nv_device(parent); |
1504 | struct nvc0_graph_priv *priv; | 1504 | struct nvc0_graph_priv *priv; |
1505 | bool use_ext_fw, enable; | 1505 | bool use_ext_fw, enable; |
1506 | int ret, i; | 1506 | int ret, i, j; |
1507 | 1507 | ||
1508 | use_ext_fw = nouveau_boolopt(device->cfgopt, "NvGrUseFW", | 1508 | use_ext_fw = nouveau_boolopt(device->cfgopt, "NvGrUseFW", |
1509 | oclass->fecs.ucode == NULL); | 1509 | oclass->fecs.ucode == NULL); |
@@ -1549,6 +1549,11 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine, | |||
1549 | for (i = 0; i < priv->gpc_nr; i++) { | 1549 | for (i = 0; i < priv->gpc_nr; i++) { |
1550 | priv->tpc_nr[i] = nv_rd32(priv, GPC_UNIT(i, 0x2608)); | 1550 | priv->tpc_nr[i] = nv_rd32(priv, GPC_UNIT(i, 0x2608)); |
1551 | priv->tpc_total += priv->tpc_nr[i]; | 1551 | priv->tpc_total += priv->tpc_nr[i]; |
1552 | priv->ppc_nr[i] = oclass->ppc_nr; | ||
1553 | for (j = 0; j < priv->ppc_nr[i]; j++) { | ||
1554 | u8 mask = nv_rd32(priv, GPC_UNIT(i, 0x0c30 + (j * 4))); | ||
1555 | priv->ppc_tpc_nr[i][j] = hweight8(mask); | ||
1556 | } | ||
1552 | } | 1557 | } |
1553 | 1558 | ||
1554 | /*XXX: these need figuring out... though it might not even matter */ | 1559 | /*XXX: these need figuring out... though it might not even matter */ |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h index fde401017556..d52014368130 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.h | |||
@@ -101,6 +101,8 @@ struct nvc0_graph_priv { | |||
101 | u8 gpc_nr; | 101 | u8 gpc_nr; |
102 | u8 tpc_nr[GPC_MAX]; | 102 | u8 tpc_nr[GPC_MAX]; |
103 | u8 tpc_total; | 103 | u8 tpc_total; |
104 | u8 ppc_nr[GPC_MAX]; | ||
105 | u8 ppc_tpc_nr[GPC_MAX][4]; | ||
104 | 106 | ||
105 | struct nouveau_gpuobj *unk4188b4; | 107 | struct nouveau_gpuobj *unk4188b4; |
106 | struct nouveau_gpuobj *unk4188b8; | 108 | struct nouveau_gpuobj *unk4188b8; |
@@ -189,6 +191,7 @@ struct nvc0_graph_oclass { | |||
189 | struct { | 191 | struct { |
190 | struct nvc0_graph_ucode *ucode; | 192 | struct nvc0_graph_ucode *ucode; |
191 | } gpccs; | 193 | } gpccs; |
194 | int ppc_nr; | ||
192 | }; | 195 | }; |
193 | 196 | ||
194 | void nvc0_graph_mmio(struct nvc0_graph_priv *, const struct nvc0_graph_pack *); | 197 | void nvc0_graph_mmio(struct nvc0_graph_priv *, const struct nvc0_graph_pack *); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvd7.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvd7.c index 2a6a94e2a041..41e8445c7eea 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvd7.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvd7.c | |||
@@ -133,4 +133,5 @@ nvd7_graph_oclass = &(struct nvc0_graph_oclass) { | |||
133 | .mmio = nvd7_graph_pack_mmio, | 133 | .mmio = nvd7_graph_pack_mmio, |
134 | .fecs.ucode = &nvd7_graph_fecs_ucode, | 134 | .fecs.ucode = &nvd7_graph_fecs_ucode, |
135 | .gpccs.ucode = &nvd7_graph_gpccs_ucode, | 135 | .gpccs.ucode = &nvd7_graph_gpccs_ucode, |
136 | .ppc_nr = 1, | ||
136 | }.base; | 137 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c b/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c index 9ba01fbb2557..96c8d44e0f44 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nve4.c | |||
@@ -343,4 +343,5 @@ nve4_graph_oclass = &(struct nvc0_graph_oclass) { | |||
343 | .mmio = nve4_graph_pack_mmio, | 343 | .mmio = nve4_graph_pack_mmio, |
344 | .fecs.ucode = &nve4_graph_fecs_ucode, | 344 | .fecs.ucode = &nve4_graph_fecs_ucode, |
345 | .gpccs.ucode = &nve4_graph_gpccs_ucode, | 345 | .gpccs.ucode = &nve4_graph_gpccs_ucode, |
346 | .ppc_nr = 1, | ||
346 | }.base; | 347 | }.base; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvf0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvf0.c index b82b40a1dc11..979ac8aa9a03 100644 --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvf0.c +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvf0.c | |||
@@ -241,4 +241,5 @@ nvf0_graph_oclass = &(struct nvc0_graph_oclass) { | |||
241 | .mmio = nvf0_graph_pack_mmio, | 241 | .mmio = nvf0_graph_pack_mmio, |
242 | .fecs.ucode = &nvf0_graph_fecs_ucode, | 242 | .fecs.ucode = &nvf0_graph_fecs_ucode, |
243 | .gpccs.ucode = &nvf0_graph_gpccs_ucode, | 243 | .gpccs.ucode = &nvf0_graph_gpccs_ucode, |
244 | .ppc_nr = 2, | ||
244 | }.base; | 245 | }.base; |