Commit 06d4f26c authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gr/gm200-: fix bad hardcoding of a max-tpcs-per-gpc value

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 734a0aa6
...@@ -33,7 +33,7 @@ gm200_grctx_generate_tpcid(struct gf100_gr *gr) ...@@ -33,7 +33,7 @@ gm200_grctx_generate_tpcid(struct gf100_gr *gr)
struct nvkm_device *device = gr->base.engine.subdev.device; struct nvkm_device *device = gr->base.engine.subdev.device;
int gpc, tpc, id; int gpc, tpc, id;
for (tpc = 0, id = 0; tpc < 4; tpc++) { for (tpc = 0, id = 0; tpc < TPC_MAX_PER_GPC; tpc++) {
for (gpc = 0; gpc < gr->gpc_nr; gpc++) { for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
if (tpc < gr->tpc_nr[gpc]) { if (tpc < gr->tpc_nr[gpc]) {
nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x698), id); nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x698), id);
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
#include <subdev/mmu.h> #include <subdev/mmu.h>
#define GPC_MAX 32 #define GPC_MAX 32
#define TPC_MAX (GPC_MAX * 8) #define TPC_MAX_PER_GPC 8
#define TPC_MAX (GPC_MAX * TPC_MAX_PER_GPC)
#define ROP_BCAST(r) (0x408800 + (r)) #define ROP_BCAST(r) (0x408800 + (r))
#define ROP_UNIT(u, r) (0x410000 + (u) * 0x400 + (r)) #define ROP_UNIT(u, r) (0x410000 + (u) * 0x400 + (r))
......
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