drm/nouveau/gr/gf100-: virtualise init_fecs_exceptions + 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)
The value for GF100 has changed here, but it matches RM now.

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 0c53d456ebbcd32e873133b004b1e3382ed1403f..0493483597edaa0d70fe7b37868b25317b739192 100644 (file)
@@ -1914,6 +1914,13 @@ gf100_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
        return 0;
 }
 
+void
+gf100_gr_init_fecs_exceptions(struct gf100_gr *gr)
+{
+       const u32 data = gr->firmware ? 0x000e0000 : 0x000e0001;
+       nvkm_wr32(gr->base.engine.subdev.device, 0x409c24, data);
+}
+
 void
 gf100_gr_init_gpc_mmu(struct gf100_gr *gr)
 {
@@ -2010,7 +2017,8 @@ gf100_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x40013c, 0xffffffff);
        nvkm_wr32(device, 0x400124, 0x00000002);
 
-       nvkm_wr32(device, 0x409c24, 0x000f0000);
+       gr->func->init_fecs_exceptions(gr);
+
        nvkm_wr32(device, 0x404000, 0xc0000000);
        nvkm_wr32(device, 0x404600, 0xc0000000);
        nvkm_wr32(device, 0x408030, 0xc0000000);
@@ -2088,6 +2096,7 @@ gf100_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf100_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 858024ba11865b61b11b6e0dd7e4a2fe118bcf8e..387938fa352b0bf23ce4e8bd8ea137848f5ac90a 100644 (file)
@@ -130,6 +130,7 @@ struct gf100_gr_func {
        void (*init_rop_active_fbps)(struct gf100_gr *);
        void (*init_bios_2)(struct gf100_gr *);
        void (*init_swdx_pes_mask)(struct gf100_gr *);
+       void (*init_fecs_exceptions)(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;
@@ -151,6 +152,7 @@ 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 gf100_gr_init_fecs_exceptions(struct gf100_gr *);
 
 void gf117_gr_init_zcull(struct gf100_gr *);
 
@@ -166,6 +168,7 @@ 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 *);
+void gp100_gr_init_fecs_exceptions(struct gf100_gr *);
 
 void gp102_gr_init_swdx_pes_mask(struct gf100_gr *);
 
index b6d67f5e5e71220feb32618a4d9b6f8094f20330..f76995b54eabb326e6c8f280463fed8a2f043d6f 100644 (file)
@@ -119,6 +119,7 @@ gf104_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf104_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 9b5796bd1dc038a706f0b78157af5dc3543ee36a..ada2697a075a9f1be065a31085467a16557ed102 100644 (file)
@@ -117,6 +117,7 @@ gf108_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf108_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 7e346a0e9540377c65f5853160a9489fa8b59170..80ced8fc2e3ebac39e0c6658640ba15125cdafb2 100644 (file)
@@ -91,6 +91,7 @@ gf110_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf110_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 5c68c5f904ce1beb647d829563bb20a1915b38f4..37ca1216372c19a4ca37e6e68acaa8d3edeb8b03 100644 (file)
@@ -155,6 +155,7 @@ gf117_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf117_gr_pack_mmio,
        .fecs.ucode = &gf117_gr_fecs_ucode,
        .gpccs.ucode = &gf117_gr_gpccs_ucode,
index b642bd224ecf9182e44a0986d8860266823e0617..ddf05c5fa2fc560613bd251b20124e706e6c74e4 100644 (file)
@@ -182,6 +182,7 @@ gf119_gr = {
        .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,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .mmio = gf119_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 703aed48f73799f9d882735dbe8800eaa9d13215..746ad3d0d1cee85db36c2d4467acc128884ca0b2 100644 (file)
@@ -380,6 +380,15 @@ gk104_clkgate_pack[] = {
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
+static void
+gk104_gr_init_fecs_exceptions(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, 0x409ffc, 0x00000000);
+       nvkm_wr32(device, 0x409c14, 0x00003e3e);
+       nvkm_wr32(device, 0x409c24, 0x000f0001);
+}
+
 void
 gk104_gr_init_rop_active_fbps(struct gf100_gr *gr)
 {
@@ -436,9 +445,7 @@ gk104_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x40013c, 0xffffffff);
        nvkm_wr32(device, 0x400124, 0x00000002);
 
-       nvkm_wr32(device, 0x409ffc, 0x00000000);
-       nvkm_wr32(device, 0x409c14, 0x00003e3e);
-       nvkm_wr32(device, 0x409c24, 0x000f0001);
+       gr->func->init_fecs_exceptions(gr);
        nvkm_wr32(device, 0x404000, 0xc0000000);
        nvkm_wr32(device, 0x404600, 0xc0000000);
        nvkm_wr32(device, 0x408030, 0xc0000000);
@@ -519,6 +526,7 @@ gk104_gr = {
        .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_fecs_exceptions = gk104_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk104_gr_pack_mmio,
        .fecs.ucode = &gk104_gr_fecs_ucode,
index 9a8428c5df45c5b1a9fd588f0c7297857c18ba6a..8a6340d237662526330fee776b268e6f3ccd8652 100644 (file)
@@ -342,6 +342,7 @@ gk110_gr = {
        .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_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
index 08f3f8c2c2bfaef08b5c8e63d3ab930e868bf95c..b50e68165df76e68b507b82d5e323ebd3f5d575d 100644 (file)
@@ -108,6 +108,7 @@ gk110b_gr = {
        .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_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk110b_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
index 49ee5490c7c24d29af57bf591a72336f29a3260f..7a938bb3af9fab890ab7482d47dbd20968d3c7da 100644 (file)
@@ -167,6 +167,7 @@ gk208_gr = {
        .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_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gk208_gr_pack_mmio,
        .fecs.ucode = &gk208_gr_fecs_ucode,
index c653df323f1adfce04c36feca1d7a1aa95ab0517..9f2df29fd4e4b2da4ad9696a676edaca5cf1178e 100644 (file)
@@ -371,7 +371,7 @@ gm107_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x400100, 0xffffffff);
        nvkm_wr32(device, 0x40013c, 0xffffffff);
        nvkm_wr32(device, 0x400124, 0x00000002);
-       nvkm_wr32(device, 0x409c24, 0x000e0000);
+       gr->func->init_fecs_exceptions(gr);
 
        nvkm_wr32(device, 0x404000, 0xc0000000);
        nvkm_wr32(device, 0x404600, 0xc0000000);
@@ -455,6 +455,7 @@ gm107_gr = {
        .init_num_active_ltcs = gf100_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_bios_2 = gm107_gr_init_bios_2,
+       .init_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gm107_gr_pack_mmio,
        .fecs.ucode = &gm107_gr_fecs_ucode,
index 5007435e6f7d5f66cadd7eeb7936e1acadf971c6..a957993a0cc0ee6c9110be6b532122546586b642 100644 (file)
@@ -91,7 +91,7 @@ gm200_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x400100, 0xffffffff);
        nvkm_wr32(device, 0x40013c, 0xffffffff);
        nvkm_wr32(device, 0x400124, 0x00000002);
-       nvkm_wr32(device, 0x409c24, 0x000e0000);
+       gr->func->init_fecs_exceptions(gr);
        nvkm_wr32(device, 0x405848, 0xc0000000);
        nvkm_wr32(device, 0x40584c, 0x00000001);
        nvkm_wr32(device, 0x404000, 0xc0000000);
@@ -193,6 +193,7 @@ gm200_gr = {
        .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_fecs_exceptions = gf100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
index 1e6795956abc9260685a03f1fc9cc18e20c8d106..564b5b17b5033cfb1929a7166146e24acb7dda3b 100644 (file)
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
+void
+gp100_gr_init_fecs_exceptions(struct gf100_gr *gr)
+{
+       nvkm_wr32(gr->base.engine.subdev.device, 0x409c24, 0x000f0002);
+}
+
 void
 gp100_gr_init_rop_active_fbps(struct gf100_gr *gr)
 {
@@ -63,7 +69,7 @@ gp100_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x400100, 0xffffffff);
        nvkm_wr32(device, 0x40013c, 0xffffffff);
        nvkm_wr32(device, 0x400124, 0x00000002);
-       nvkm_wr32(device, 0x409c24, 0x000f0002);
+       gr->func->init_fecs_exceptions(gr);
        nvkm_wr32(device, 0x405848, 0xc0000000);
        nvkm_mask(device, 0x40584c, 0x00000000, 0x00000001);
        nvkm_wr32(device, 0x404000, 0xc0000000);
@@ -127,6 +133,7 @@ gp100_gr = {
        .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_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
index 860a7897698061c86693999affe90695d2bfb7a3..04803fa7937a3115aadbe5da154729277c31486a 100644 (file)
@@ -49,6 +49,7 @@ gp102_gr = {
        .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
+       .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 3,
index 03f22646eb78decb0c4a30ed5184ef6c29b31013..c21cb8ae9a8bcb8dba593d3af100975b62e7c63a 100644 (file)
@@ -35,6 +35,7 @@ gp107_gr = {
        .init_num_active_ltcs = gm200_gr_init_num_active_ltcs,
        .init_rop_active_fbps = gp100_gr_init_rop_active_fbps,
        .init_swdx_pes_mask = gp102_gr_init_swdx_pes_mask,
+       .init_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
index 97f86677a22c322ee781f53f420c287e87c336cd..222b5b0c6e38935f60b238869a600e29e65139d6 100644 (file)
@@ -33,6 +33,7 @@ gp10b_gr = {
        .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_fecs_exceptions = gp100_gr_init_fecs_exceptions,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,