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 7ccd8f21c1e0e52438f6f3489be22ba61adf77a9..ad18ef91d34e564ede0ce1e42aee1d22116d4b64 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 c292cf3bebb1c5e5fefc8caa8206f11844d32767..cab0948f507dbd8d27c12e2ea882c96d91093c3d 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 61d6eef70e6895b74e92e31f0aafda644d6d7359..8598e15b40affdc2379ec0e3cea3fa1c63b1ae09 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 d4f712e7d6e97d6948b79cf640eae6e9f0ec6c23..83c71ff51a2e20f4d8e7a056213b5ca441cc7ba3 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 1b6c2f32ec921198e89e71ae344b027e65608edc..b2b44890ae955f3475b13d8989c5031893092081 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 ae76e8183d1d175896e6137c0648029f29d28a89..ec91a595affe511ffac53aeda2eaa46f5ac689fa 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 a3970c31f95170e3fc70f8aa3cf6495fa9ff13d2..570527f0370c61507e5b5faea02e56bba1b92aa3 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 6ba604edaf952cc9590693cfbbaa8d4fba839adb..dcd59af25420202d937101d20205dc5c73a637dc 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 7a07d24cc22792c17f9529e8f6364f2a66e3aef0..bea0cd324a72ac400be88e3735d63efc14754d47 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 1c9f59cde3d2c7fde47ef6ef19d7bc76d16d9728..e4ae88de895858a0f7abc76879102d9a34dada0a 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 40c87242b54df5a88ff3521fc2b36dad60ab66ab..1e214d94ae98187d770dc89dd7ac923c112415f6 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 3d180edbdcd76c43167ff02a16864c198864ba43..df668b9e00e495f5d03ab587fac6eef164bbea12 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 9436ab37aa9e57e2ac821092fe4c7d5bebc59e89..9f8171aae6010388a69d0eb8eaf773dca590f5f3 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 72ea16ee842a74fd05ff60df3eb08cc3dd8efa52..7518d249f648ce2fb116d357d5c42d5a4cea0f16 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 309815bef601b02b245727eeb44b9b92f4b65117..230e2eeb17012dce6eb46b636084ad759be8763b 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 1ae9e7d991f935e678388962b04a4392e9fd4957..55b7a7e70cde0e968fb16876b0f1bb9872835444 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 68e212823063b22091666d7f42998f350c96a24a..b13a48bc7da7630757abfc4c0f28725440e54210 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,