]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/nouveau/gr/gm200-: fix bad hardcoding of a max-tpcs-per-gpc value
authorBen Skeggs <bskeggs@redhat.com>
Thu, 14 Apr 2016 05:36:16 +0000 (15:36 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 20 May 2016 04:43:04 +0000 (14:43 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h

index 7a78d974ee1aff15339944c38d7a0e9c66b4609e..e65b70a01a88695fb6f6eae7200b5f9dfa613908 100644 (file)
@@ -33,7 +33,7 @@ gm200_grctx_generate_tpcid(struct gf100_gr *gr)
        struct nvkm_device *device = gr->base.engine.subdev.device;
        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++) {
                        if (tpc < gr->tpc_nr[gpc]) {
                                nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x698), id);
index be32330c58daaa791345997e0778a4e902676414..9a2c7bacc0e6b67a659291daeb9daaaa0616f24c 100644 (file)
@@ -31,7 +31,8 @@
 #include <subdev/mmu.h>
 
 #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_UNIT(u, r)    (0x410000 + (u) * 0x400 + (r))