drm/nouveau/gr/gf100-: virtualise init_num_active_ltcs
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>
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 56d9ead0b38010326b676f33acb54c40c12f13c7..d33e531bb1a0617fcd2617aa16d6c7d7f982befd 100644 (file)
@@ -1930,6 +1930,13 @@ gf100_gr_init_gpc_mmu(struct gf100_gr *gr)
        nvkm_wr32(device, 0x4188b8, nvkm_memory_addr(fb->mmu_rd) >> 8);
 }
 
+void
+gf100_gr_init_num_active_ltcs(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
+}
+
 void
 gf100_gr_init_zcull(struct gf100_gr *gr)
 {
@@ -1989,8 +1996,7 @@ gf100_gr_init(struct gf100_gr *gr)
 
        gr->func->init_vsc_stream_master(gr);
        gr->func->init_zcull(gr);
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
+       gr->func->init_num_active_ltcs(gr);
 
        nvkm_wr32(device, 0x400500, 0x00010001);
 
@@ -2074,6 +2080,7 @@ gf100_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf100_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf100_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index b322dc42476101aeeb0287158436931ad5ac505c..7f6aed873408fe2a5e5e8265010e7ed62be3dfdd 100644 (file)
@@ -126,10 +126,10 @@ struct gf100_gr_func {
        void (*init_bios)(struct gf100_gr *);
        void (*init_vsc_stream_master)(struct gf100_gr *);
        void (*init_zcull)(struct gf100_gr *);
+       void (*init_num_active_ltcs)(struct gf100_gr *);
        void (*init_rop_active_fbps)(struct gf100_gr *);
        void (*init_ppc_exceptions)(struct gf100_gr *);
        void (*init_swdx_pes_mask)(struct gf100_gr *);
-       void (*init_num_active_ltcs)(struct gf100_gr *);
        void (*set_hww_esr_report_mask)(struct gf100_gr *);
        const struct gf100_gr_pack *mmio;
        struct {
@@ -149,6 +149,7 @@ int gf100_gr_rops(struct gf100_gr *);
 int gf100_gr_init(struct gf100_gr *);
 void gf100_gr_init_vsc_stream_master(struct gf100_gr *);
 void gf100_gr_init_zcull(struct gf100_gr *);
+void gf100_gr_init_num_active_ltcs(struct gf100_gr *);
 
 void gf117_gr_init_zcull(struct gf100_gr *);
 
@@ -160,6 +161,7 @@ void gk104_gr_init_ppc_exceptions(struct gf100_gr *);
 int gk20a_gr_init(struct gf100_gr *);
 
 int gm200_gr_rops(struct gf100_gr *);
+void gm200_gr_init_num_active_ltcs(struct gf100_gr *);
 
 int gp100_gr_init(struct gf100_gr *);
 void gp100_gr_init_rop_active_fbps(struct gf100_gr *);
@@ -315,7 +317,5 @@ void gm107_gr_init_bios(struct gf100_gr *);
 
 void gm200_gr_init_gpc_mmu(struct gf100_gr *);
 
-void gp100_gr_init_num_active_ltcs(struct gf100_gr *gr);
-
 void gp102_gr_init_swdx_pes_mask(struct gf100_gr *);
 #endif
index 23c2613fa6bfa3d5834ac72586c801318e7ecea0..b6d67f5e5e71220feb32618a4d9b6f8094f20330 100644 (file)
@@ -118,6 +118,7 @@ gf104_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf100_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf104_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index a79a7860732a9cc0b2b7c91d62e3836ed6ec3580..9b5796bd1dc038a706f0b78157af5dc3543ee36a 100644 (file)
@@ -116,6 +116,7 @@ gf108_gr = {
        .init_r405a14 = gf108_gr_init_r405a14,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf100_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf108_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index fd8e13716d94f9b44c239356101b77fc2655763b..7e346a0e9540377c65f5853160a9489fa8b59170 100644 (file)
@@ -90,6 +90,7 @@ gf110_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf100_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf110_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 01e213e4d1a908b5215443864028c1b90f6e077d..5c68c5f904ce1beb647d829563bb20a1915b38f4 100644 (file)
@@ -154,6 +154,7 @@ gf117_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf117_gr_pack_mmio,
        .fecs.ucode = &gf117_gr_fecs_ucode,
        .gpccs.ucode = &gf117_gr_gpccs_ucode,
index 269922e9fca237c020862d63aa06c66d496914e5..b642bd224ecf9182e44a0986d8860266823e0617 100644 (file)
@@ -181,6 +181,7 @@ gf119_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gf100_gr_init_vsc_stream_master,
        .init_zcull = gf100_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .mmio = gf119_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index d1b7fb8957fb19af377e01828be8898f626ebeca..3f19de24ef6995bd9cd80a59d256ce5e601bc6d7 100644 (file)
@@ -426,8 +426,7 @@ gk104_gr_init(struct gf100_gr *gr)
 
        gr->func->init_vsc_stream_master(gr);
        gr->func->init_zcull(gr);
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
+       gr->func->init_num_active_ltcs(gr);
 
        gr->func->init_rop_active_fbps(gr);
 
@@ -517,6 +516,7 @@ gk104_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk104_gr_pack_mmio,
index 0eba041cd399cc1547c9c828b158d4d1b1006318..9a8428c5df45c5b1a9fd588f0c7297857c18ba6a 100644 (file)
@@ -340,6 +340,7 @@ gk110_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110_gr_pack_mmio,
index 84a1664f9e46712ab39a648f8070560de366a8f7..08f3f8c2c2bfaef08b5c8e63d3ab930e868bf95c 100644 (file)
@@ -106,6 +106,7 @@ gk110b_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110b_gr_pack_mmio,
index 701199abf5f9ee73b9ea531a93ce561448d947fa..49ee5490c7c24d29af57bf591a72336f29a3260f 100644 (file)
@@ -165,6 +165,7 @@ gk208_gr = {
        .init_gpc_mmu = gf100_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk208_gr_pack_mmio,
index a5f5e05c21ac592728119a6ff57d8ee3ae2854fe..bbb0a28365f54074708dd0103b9cc977ba06f9ae 100644 (file)
@@ -335,8 +335,7 @@ gm107_gr_init(struct gf100_gr *gr)
 
        gr->func->init_vsc_stream_master(gr);
        gr->func->init_zcull(gr);
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
+       gr->func->init_num_active_ltcs(gr);
 
        gr->func->init_rop_active_fbps(gr);
 
@@ -426,6 +425,7 @@ gm107_gr = {
        .init_bios = gm107_gr_init_bios,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gm107_gr_pack_mmio,
index 2ceef1737f8420c82494d99467ca2837e5a6f0a4..5007435e6f7d5f66cadd7eeb7936e1acadf971c6 100644 (file)
@@ -38,6 +38,14 @@ gm200_gr_rops(struct gf100_gr *gr)
        return nvkm_rd32(gr->base.engine.subdev.device, 0x12006c);
 }
 
+void
+gm200_gr_init_num_active_ltcs(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
+       nvkm_wr32(device, GPC_BCAST(0x033c), nvkm_rd32(device, 0x100804));
+}
+
 void
 gm200_gr_init_gpc_mmu(struct gf100_gr *gr)
 {
@@ -75,9 +83,7 @@ gm200_gr_init(struct gf100_gr *gr)
 
        gr->func->init_vsc_stream_master(gr);
        gr->func->init_zcull(gr);
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
-       nvkm_wr32(device, GPC_BCAST(0x033c), nvkm_rd32(device, 0x100804));
+       gr->func->init_num_active_ltcs(gr);
 
        gr->func->init_rop_active_fbps(gr);
 
@@ -185,6 +191,7 @@ gm200_gr = {
        .init_bios = gm107_gr_init_bios,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gm200_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
index 7d3317eb3e54e5d2d080fc1c3902c5938dfc9f3a..1e6795956abc9260685a03f1fc9cc18e20c8d106 100644 (file)
@@ -40,15 +40,6 @@ gp100_gr_init_rop_active_fbps(struct gf100_gr *gr)
        nvkm_mask(device, 0x408958, 0x0000000f, fbp_count); /* crop */
 }
 
-void
-gp100_gr_init_num_active_ltcs(struct gf100_gr *gr)
-{
-       struct nvkm_device *device = gr->base.engine.subdev.device;
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
-       nvkm_wr32(device, GPC_BCAST(0x033c), nvkm_rd32(device, 0x100804));
-}
-
 int
 gp100_gr_init(struct gf100_gr *gr)
 {
@@ -134,9 +125,9 @@ gp100_gr = {
        .init_gpc_mmu = gm200_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
-       .init_num_active_ltcs = gp100_gr_init_num_active_ltcs,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
        .grctx = &gp100_grctx,
index 0d9bf6c27a7b6a710fd4d64ddea56373405cad04..17bd872b8dc9c332ecf28463bd1c30c65c75e8d4 100644 (file)
@@ -46,10 +46,10 @@ gp102_gr = {
        .init_gpc_mmu = gm200_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
-       .init_num_active_ltcs = gp100_gr_init_num_active_ltcs,
        .rops = gm200_gr_rops,
        .ppc_nr = 3,
        .grctx = &gp102_grctx,
index 67d567e3a2ac89a0e8d220dc4420d45e6ca42eac..3fba3af2f5a61374b66cd95de2a5764915640d74 100644 (file)
@@ -32,10 +32,10 @@ gp107_gr = {
        .init_gpc_mmu = gm200_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
-       .init_num_active_ltcs = gp100_gr_init_num_active_ltcs,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
        .grctx = &gp107_grctx,
index af06b10ba92f67cf257a3f40f85786694fd8bf42..97f86677a22c322ee781f53f420c287e87c336cd 100644 (file)
 
 #include <nvif/class.h>
 
-static void
-gp10b_gr_init_num_active_ltcs(struct gf100_gr *gr)
-{
-       struct nvkm_device *device = gr->base.engine.subdev.device;
-
-       nvkm_wr32(device, GPC_BCAST(0x08ac), nvkm_rd32(device, 0x100800));
-}
-
 static const struct gf100_gr_func
 gp10b_gr = {
        .init = gp100_gr_init,
        .init_gpc_mmu = gm200_gr_init_gpc_mmu,
        .init_vsc_stream_master = gk104_gr_init_vsc_stream_master,
        .init_zcull = gf117_gr_init_zcull,
+       .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
-       .init_num_active_ltcs = gp10b_gr_init_num_active_ltcs,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
        .grctx = &gp102_grctx,