summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2016-04-14 15:36:16 +1000
committerBen Skeggs <bskeggs@redhat.com>2016-05-20 14:43:04 +1000
commit06d4f26cc33b11be4b41fa0409130cbdf34d9343 (patch)
tree7818e74d47e3ee1932fb48e2b548558464823ab5 /drivers/gpu
parent734a0aa669fd032f40e27e3d3df7228e1fe27681 (diff)
downloadlinux-06d4f26cc33b11be4b41fa0409130cbdf34d9343.tar.gz
linux-06d4f26cc33b11be4b41fa0409130cbdf34d9343.tar.bz2
linux-06d4f26cc33b11be4b41fa0409130cbdf34d9343.zip
drm/nouveau/gr/gm200-: fix bad hardcoding of a max-tpcs-per-gpc value
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c
index 7a78d974ee1a..e65b70a01a88 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm200.c
@@ -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);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
index be32330c58da..9a2c7bacc0e6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
@@ -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))