drm/nouveau/gr/gf100-: virtualise init_419cc0 + 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:23 +0000 (15:01 +1000)
Pulled some init out of main per-GPC/TPC loops to match RM.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
17 files changed:
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.h
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf108.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf110.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf117.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf119.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk110b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk208.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp102.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c

index 7ccd8f2..ad18ef9 100644 (file)
@@ -1914,6 +1914,20 @@ gf100_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
        return 0;
 }
 
+void
+gf100_gr_init_419cc0(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       int gpc, tpc;
+
+       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+
+       for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
+               for (tpc = 0; tpc < gr->tpc_nr[gpc]; tpc++)
+                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x48c), 0xc0000000);
+       }
+}
+
 void
 gf100_gr_init_40601c(struct gf100_gr *gr)
 {
@@ -2042,7 +2056,10 @@ gf100_gr_init(struct gf100_gr *gr)
 
        nvkm_wr32(device, 0x405840, 0xc0000000);
        nvkm_wr32(device, 0x405844, 0x00ffffff);
-       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+
+       if (gr->func->init_419cc0)
+               gr->func->init_419cc0(gr);
+
        nvkm_mask(device, 0x419eb4, 0x00001000, 0x00001000);
 
        for (gpc = 0; gpc < gr->gpc_nr; gpc++) {
@@ -2054,7 +2071,6 @@ gf100_gr_init(struct gf100_gr *gr)
                        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, 0x644), 0x001ffffe);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x0000000f);
@@ -2113,6 +2129,7 @@ gf100_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf100_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index c292cf3..cab0948 100644 (file)
@@ -134,6 +134,7 @@ struct gf100_gr_func {
        void (*init_ds_hww_esr_2)(struct gf100_gr *);
        void (*init_40601c)(struct gf100_gr *);
        void (*init_sked_hww_esr)(struct gf100_gr *);
+       void (*init_419cc0)(struct gf100_gr *);
        void (*init_ppc_exceptions)(struct gf100_gr *);
        void (*set_hww_esr_report_mask)(struct gf100_gr *);
        const struct gf100_gr_pack *mmio;
@@ -157,6 +158,7 @@ void gf100_gr_init_zcull(struct gf100_gr *);
 void gf100_gr_init_num_active_ltcs(struct gf100_gr *);
 void gf100_gr_init_fecs_exceptions(struct gf100_gr *);
 void gf100_gr_init_40601c(struct gf100_gr *);
+void gf100_gr_init_419cc0(struct gf100_gr *);
 
 void gf117_gr_init_zcull(struct gf100_gr *);
 
index 61d6eef..8598e15 100644 (file)
@@ -121,6 +121,7 @@ gf104_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf104_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index d4f712e..83c71ff 100644 (file)
@@ -119,6 +119,7 @@ gf108_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf108_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 1b6c2f3..b2b4489 100644 (file)
@@ -93,6 +93,7 @@ gf110_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf110_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index ae76e81..ec91a59 100644 (file)
@@ -157,6 +157,7 @@ gf117_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf117_gr_pack_mmio,
        .fecs.ucode = &gf117_gr_fecs_ucode,
        .gpccs.ucode = &gf117_gr_gpccs_ucode,
index a3970c3..570527f 100644 (file)
@@ -184,6 +184,7 @@ gf119_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_40601c = gf100_gr_init_40601c,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .mmio = gf119_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 6ba604e..dcd59af 100644 (file)
@@ -460,7 +460,7 @@ gk104_gr_init(struct gf100_gr *gr)
        gr->func->init_sked_hww_esr(gr);
        nvkm_wr32(device, 0x405840, 0xc0000000);
        nvkm_wr32(device, 0x405844, 0x00ffffff);
-       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+       gr->func->init_419cc0(gr);
        nvkm_mask(device, 0x419eb4, 0x00001000, 0x00001000);
 
        gr->func->init_ppc_exceptions(gr);
@@ -474,7 +474,6 @@ gk104_gr_init(struct gf100_gr *gr)
                        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, 0x644), 0x001ffffe);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x0000000f);
@@ -534,6 +533,7 @@ gk104_gr = {
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_fecs_exceptions = gk104_gr_init_fecs_exceptions,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk104_gr_pack_mmio,
        .fecs.ucode = &gk104_gr_fecs_ucode,
index 7a07d24..bea0cd3 100644 (file)
@@ -344,6 +344,7 @@ gk110_gr = {
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
index 1c9f59c..e4ae88d 100644 (file)
@@ -110,6 +110,7 @@ gk110b_gr = {
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110b_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
index 40c8724..1e214d9 100644 (file)
@@ -169,6 +169,7 @@ gk208_gr = {
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk208_gr_pack_mmio,
        .fecs.ucode = &gk208_gr_fecs_ucode,
index 3d180ed..df668b9 100644 (file)
@@ -381,7 +381,7 @@ gm107_gr_init(struct gf100_gr *gr)
        gr->func->init_sked_hww_esr(gr);
        nvkm_wr32(device, 0x405840, 0xc0000000);
        nvkm_wr32(device, 0x405844, 0x00ffffff);
-       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+       gr->func->init_419cc0(gr);
 
        gr->func->init_ppc_exceptions(gr);
 
@@ -394,7 +394,6 @@ gm107_gr_init(struct gf100_gr *gr)
                        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);
@@ -457,6 +456,7 @@ gm107_gr = {
        .init_bios_2 = gm107_gr_init_bios_2,
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gm107_gr_pack_mmio,
        .fecs.ucode = &gm107_gr_fecs_ucode,
index 9436ab3..9f8171a 100644 (file)
@@ -109,7 +109,7 @@ gm200_gr_init(struct gf100_gr *gr)
        gr->func->init_sked_hww_esr(gr);
        nvkm_wr32(device, 0x405840, 0xc0000000);
        nvkm_wr32(device, 0x405844, 0x00ffffff);
-       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+       gr->func->init_419cc0(gr);
 
        gr->func->init_ppc_exceptions(gr);
 
@@ -122,7 +122,6 @@ gm200_gr_init(struct gf100_gr *gr)
                        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);
@@ -203,6 +202,7 @@ gm200_gr = {
        .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
index 72ea16e..7518d24 100644 (file)
@@ -79,7 +79,7 @@ gp100_gr_init(struct gf100_gr *gr)
        gr->func->init_sked_hww_esr(gr);
        nvkm_wr32(device, 0x405840, 0xc0000000);
        nvkm_wr32(device, 0x405844, 0x00ffffff);
-       nvkm_mask(device, 0x419cc0, 0x00000008, 0x00000008);
+       gr->func->init_419cc0(gr);
 
        nvkm_mask(device, 0x419c9c, 0x00010000, 0x00010000);
        nvkm_mask(device, 0x419c9c, 0x00020000, 0x00020000);
@@ -95,7 +95,6 @@ gp100_gr_init(struct gf100_gr *gr)
                        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);
@@ -135,6 +134,7 @@ gp100_gr = {
        .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
index 309815b..230e2ee 100644 (file)
@@ -52,6 +52,7 @@ gp102_gr = {
        .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 3,
index 1ae9e7d..55b7a7e 100644 (file)
@@ -38,6 +38,7 @@ gp107_gr = {
        .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
index 68e2128..b13a48b 100644 (file)
@@ -36,6 +36,7 @@ gp10b_gr = {
        .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ds_hww_esr_2 = gm200_gr_init_ds_hww_esr_2,
        .init_sked_hww_esr = gk104_gr_init_sked_hww_esr,
+       .init_419cc0 = gf100_gr_init_419cc0,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,