drm/nouveau/gr/gf100-: virtualise init_gpc_mmu + apply fixes from traces
authorBen Skeggs <bskeggs@redhat.com>
Tue, 8 May 2018 10:39:46 +0000 (20:39 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 18 May 2018 05:01:22 +0000 (15:01 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c

index 2f8dc107047dc8c14b91f60af01304f189ce68c1..5be4111b06686c6a5019c42220b81424f53e0144 100644 (file)
@@ -1920,7 +1920,7 @@ gf100_gr_init_gpc_mmu(struct gf100_gr *gr)
        struct nvkm_fb *fb = device->fb;
 
        nvkm_wr32(device, 0x418880, nvkm_rd32(device, 0x100c80) & 0x00000001);
-       nvkm_wr32(device, 0x4188a4, 0x00000000);
+       nvkm_wr32(device, 0x4188a4, 0x03000000);
        nvkm_wr32(device, 0x418888, 0x00000000);
        nvkm_wr32(device, 0x41888c, 0x00000000);
        nvkm_wr32(device, 0x418890, 0x00000000);
index 2c67fac576d1f3e0afed511e1a09c6afef803c88..5ea74f62cee4f7b5738c4c9e572c2df980dc0b03 100644 (file)
@@ -308,22 +308,30 @@ gm107_gr_init_bios(struct gf100_gr *gr)
        }
 }
 
+static void
+gm107_gr_init_gpc_mmu(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       struct nvkm_fb *fb = device->fb;
+
+       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), nvkm_memory_addr(fb->mmu_wr) >> 8);
+       nvkm_wr32(device, GPC_BCAST(0x08b8), nvkm_memory_addr(fb->mmu_rd) >> 8);
+}
+
 static int
 gm107_gr_init(struct gf100_gr *gr)
 {
        struct nvkm_device *device = gr->base.engine.subdev.device;
-       struct nvkm_fb *fb = device->fb;
        const u32 magicgpc918 = DIV_ROUND_UP(0x00800000, gr->tpc_total);
        u32 data[TPC_MAX / 8] = {};
        u8  tpcnr[GPC_MAX];
        int gpc, tpc, rop;
        int i;
 
-       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), nvkm_memory_addr(fb->mmu_wr) >> 8);
-       nvkm_wr32(device, GPC_BCAST(0x08b8), nvkm_memory_addr(fb->mmu_rd) >> 8);
+       gr->func->init_gpc_mmu(gr);
 
        gf100_gr_mmio(gr, gr->func->mmio);
 
@@ -442,6 +450,7 @@ gm107_gr_gpccs_ucode = {
 static const struct gf100_gr_func
 gm107_gr = {
        .init = gm107_gr_init,
+       .init_gpc_mmu = gm107_gr_init_gpc_mmu,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gm107_gr_pack_mmio,