summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:10 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:40:17 +1000
commit276836d46e535c8ca299a1ea8302879dbdd3e93a (patch)
tree1d74d68b4998edf42bc88c667fe33388f988a603 /drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
parent8774440390cdfe37c5d003f850847c9fd67cdf61 (diff)
downloadlinux-276836d46e535c8ca299a1ea8302879dbdd3e93a.tar.bz2
drm/nouveau/gr: switch to device pri macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c118
1 files changed, 60 insertions, 58 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
index 5e9560f6ac0e..1e451a9e2290 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
@@ -304,7 +304,8 @@ gm107_gr_init_bios(struct gf100_gr *gr)
{ 0x419af0, 0x419af4 },
{ 0x419af8, 0x419afc },
};
- struct nvkm_bios *bios = nvkm_bios(gr);
+ struct nvkm_device *device = gr->base.engine.subdev.device;
+ struct nvkm_bios *bios = device->bios;
struct nvbios_P0260E infoE;
struct nvbios_P0260X infoX;
int E = -1, X;
@@ -312,9 +313,9 @@ gm107_gr_init_bios(struct gf100_gr *gr)
while (nvbios_P0260Ep(bios, ++E, &ver, &hdr, &infoE)) {
if (X = -1, E < ARRAY_SIZE(regs)) {
- nv_wr32(gr, regs[E].ctrl, infoE.data);
+ nvkm_wr32(device, regs[E].ctrl, infoE.data);
while (nvbios_P0260Xp(bios, ++X, &ver, &hdr, &infoX))
- nv_wr32(gr, regs[E].data, infoX.data);
+ nvkm_wr32(device, regs[E].data, infoX.data);
}
}
}
@@ -324,6 +325,7 @@ gm107_gr_init(struct nvkm_object *object)
{
struct gf100_gr_oclass *oclass = (void *)object->oclass;
struct gf100_gr *gr = (void *)object;
+ struct nvkm_device *device = gr->base.engine.subdev.device;
const u32 magicgpc918 = DIV_ROUND_UP(0x00800000, gr->tpc_total);
u32 data[TPC_MAX / 8] = {};
u8 tpcnr[GPC_MAX];
@@ -334,17 +336,17 @@ gm107_gr_init(struct nvkm_object *object)
if (ret)
return ret;
- nv_wr32(gr, GPC_BCAST(0x0880), 0x00000000);
- nv_wr32(gr, GPC_BCAST(0x0890), 0x00000000);
- nv_wr32(gr, GPC_BCAST(0x0894), 0x00000000);
- nv_wr32(gr, GPC_BCAST(0x08b4), gr->unk4188b4->addr >> 8);
- nv_wr32(gr, GPC_BCAST(0x08b8), gr->unk4188b8->addr >> 8);
+ nvkm_wr32(device, GPC_BCAST(0x0880), 0x00000000);
+ nvkm_wr32(device, GPC_BCAST(0x0890), 0x00000000);
+ nvkm_wr32(device, GPC_BCAST(0x0894), 0x00000000);
+ nvkm_wr32(device, GPC_BCAST(0x08b4), gr->unk4188b4->addr >> 8);
+ nvkm_wr32(device, GPC_BCAST(0x08b8), gr->unk4188b8->addr >> 8);
gf100_gr_mmio(gr, oclass->mmio);
gm107_gr_init_bios(gr);
- nv_wr32(gr, GPC_UNIT(0, 0x3018), 0x00000001);
+ nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001);
memset(data, 0x00, sizeof(data));
memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
@@ -357,75 +359,75 @@ gm107_gr_init(struct nvkm_object *object)
data[i / 8] |= tpc << ((i % 8) * 4);
}
- nv_wr32(gr, GPC_BCAST(0x0980), data[0]);
- nv_wr32(gr, GPC_BCAST(0x0984), data[1]);
- nv_wr32(gr, GPC_BCAST(0x0988), data[2]);
- nv_wr32(gr, GPC_BCAST(0x098c), data[3]);
+ nvkm_wr32(device, GPC_BCAST(0x0980), data[0]);
+ nvkm_wr32(device, GPC_BCAST(0x0984), data[1]);
+ nvkm_wr32(device, GPC_BCAST(0x0988), data[2]);
+ nvkm_wr32(device, GPC_BCAST(0x098c), data[3]);
for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
- nv_wr32(gr, GPC_UNIT(gpc, 0x0914),
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0914),
gr->magic_not_rop_nr << 8 | gr->tpc_nr[gpc]);
- nv_wr32(gr, GPC_UNIT(gpc, 0x0910), 0x00040000 |
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0910), 0x00040000 |
gr->tpc_total);
- nv_wr32(gr, GPC_UNIT(gpc, 0x0918), magicgpc918);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0918), magicgpc918);
}
- nv_wr32(gr, GPC_BCAST(0x3fd4), magicgpc918);
- nv_wr32(gr, GPC_BCAST(0x08ac), nv_rd32(gr, 0x100800));
+ nvkm_wr32(device, GPC_BCAST(0x3fd4), magicgpc918);
+ nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
- nv_wr32(gr, 0x400500, 0x00010001);
+ nvkm_wr32(device, 0x400500, 0x00010001);
- nv_wr32(gr, 0x400100, 0xffffffff);
- nv_wr32(gr, 0x40013c, 0xffffffff);
- nv_wr32(gr, 0x400124, 0x00000002);
- nv_wr32(gr, 0x409c24, 0x000e0000);
+ nvkm_wr32(device, 0x400100, 0xffffffff);
+ nvkm_wr32(device, 0x40013c, 0xffffffff);
+ nvkm_wr32(device, 0x400124, 0x00000002);
+ nvkm_wr32(device, 0x409c24, 0x000e0000);
- nv_wr32(gr, 0x404000, 0xc0000000);
- nv_wr32(gr, 0x404600, 0xc0000000);
- nv_wr32(gr, 0x408030, 0xc0000000);
- nv_wr32(gr, 0x404490, 0xc0000000);
- nv_wr32(gr, 0x406018, 0xc0000000);
- nv_wr32(gr, 0x407020, 0x40000000);
- nv_wr32(gr, 0x405840, 0xc0000000);
- nv_wr32(gr, 0x405844, 0x00ffffff);
- nv_mask(gr, 0x419cc0, 0x00000008, 0x00000008);
+ nvkm_wr32(device, 0x404000, 0xc0000000);
+ nvkm_wr32(device, 0x404600, 0xc0000000);
+ nvkm_wr32(device, 0x408030, 0xc0000000);
+ nvkm_wr32(device, 0x404490, 0xc0000000);
+ nvkm_wr32(device, 0x406018, 0xc0000000);
+ nvkm_wr32(device, 0x407020, 0x40000000);
+ nvkm_wr32(device, 0x405840, 0xc0000000);
+ nvkm_wr32(device, 0x405844, 0x00ffffff);
+ nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
for (ppc = 0; ppc < 2 /* gr->ppc_nr[gpc] */; ppc++)
- nv_wr32(gr, PPC_UNIT(gpc, ppc, 0x038), 0xc0000000);
- nv_wr32(gr, GPC_UNIT(gpc, 0x0420), 0xc0000000);
- nv_wr32(gr, GPC_UNIT(gpc, 0x0900), 0xc0000000);
- nv_wr32(gr, GPC_UNIT(gpc, 0x1028), 0xc0000000);
- nv_wr32(gr, GPC_UNIT(gpc, 0x0824), 0xc0000000);
+ nvkm_wr32(device, PPC_UNIT(gpc, ppc, 0x038), 0xc0000000);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0420), 0xc0000000);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0900), 0xc0000000);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x1028), 0xc0000000);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x0824), 0xc0000000);
for (tpc = 0; tpc < gr->tpc_nr[gpc]; tpc++) {
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x508), 0xffffffff);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x50c), 0xffffffff);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x224), 0xc0000000);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x48c), 0xc0000000);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x430), 0xc0000000);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
- nv_wr32(gr, TPC_UNIT(gpc, tpc, 0x64c), 0x00000005);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x508), 0xffffffff);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x50c), 0xffffffff);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x224), 0xc0000000);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x48c), 0xc0000000);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x430), 0xc0000000);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
+ nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000005);
}
- nv_wr32(gr, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
- nv_wr32(gr, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
+ nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
}
for (rop = 0; rop < gr->rop_nr; rop++) {
- nv_wr32(gr, ROP_UNIT(rop, 0x144), 0x40000000);
- nv_wr32(gr, ROP_UNIT(rop, 0x070), 0x40000000);
- nv_wr32(gr, ROP_UNIT(rop, 0x204), 0xffffffff);
- nv_wr32(gr, ROP_UNIT(rop, 0x208), 0xffffffff);
+ nvkm_wr32(device, ROP_UNIT(rop, 0x144), 0x40000000);
+ nvkm_wr32(device, ROP_UNIT(rop, 0x070), 0x40000000);
+ nvkm_wr32(device, ROP_UNIT(rop, 0x204), 0xffffffff);
+ nvkm_wr32(device, ROP_UNIT(rop, 0x208), 0xffffffff);
}
- nv_wr32(gr, 0x400108, 0xffffffff);
- nv_wr32(gr, 0x400138, 0xffffffff);
- nv_wr32(gr, 0x400118, 0xffffffff);
- nv_wr32(gr, 0x400130, 0xffffffff);
- nv_wr32(gr, 0x40011c, 0xffffffff);
- nv_wr32(gr, 0x400134, 0xffffffff);
+ nvkm_wr32(device, 0x400108, 0xffffffff);
+ nvkm_wr32(device, 0x400138, 0xffffffff);
+ nvkm_wr32(device, 0x400118, 0xffffffff);
+ nvkm_wr32(device, 0x400130, 0xffffffff);
+ nvkm_wr32(device, 0x40011c, 0xffffffff);
+ nvkm_wr32(device, 0x400134, 0xffffffff);
- nv_wr32(gr, 0x400054, 0x2c350f63);
+ nvkm_wr32(device, 0x400054, 0x2c350f63);
gf100_gr_zbc_init(gr);