drm/nouveau/gr/gf100-: move some init to init_exception2()
authorBen Skeggs <bskeggs@redhat.com>
Wed, 1 Jun 2022 10:48:12 +0000 (20:48 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 9 Nov 2022 00:45:12 +0000 (10:45 +1000)
Ampere.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
20 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/gp104.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gp10b.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gv100.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/tu102.c

index 5dcebda..b9961d2 100644 (file)
@@ -2155,6 +2155,15 @@ gf100_gr_init_400054(struct gf100_gr *gr)
 }
 
 void
+gf100_gr_init_exception2(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+
+       nvkm_wr32(device, 0x40011c, 0xffffffff);
+       nvkm_wr32(device, 0x400134, 0xffffffff);
+}
+
+void
 gf100_gr_init_rop_exceptions(struct gf100_gr *gr)
 {
        struct nvkm_device *device = gr->base.engine.subdev.device;
@@ -2395,8 +2404,8 @@ gf100_gr_init(struct gf100_gr *gr)
        nvkm_wr32(device, 0x400138, 0xffffffff);
        nvkm_wr32(device, 0x400118, 0xffffffff);
        nvkm_wr32(device, 0x400130, 0xffffffff);
-       nvkm_wr32(device, 0x40011c, 0xffffffff);
-       nvkm_wr32(device, 0x400134, 0xffffffff);
+       if (gr->func->init_exception2)
+               gr->func->init_exception2(gr);
 
        if (gr->func->init_400054)
                gr->func->init_400054(gr);
@@ -2474,6 +2483,7 @@ gf100_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf100_gr_pack_mmio,
index 6f1f4fc..cb1d7b2 100644 (file)
@@ -166,6 +166,7 @@ struct gf100_gr_func {
        void (*init_504430)(struct gf100_gr *, int gpc, int tpc);
        void (*init_shader_exceptions)(struct gf100_gr *, int gpc, int tpc);
        void (*init_rop_exceptions)(struct gf100_gr *);
+       void (*init_exception2)(struct gf100_gr *);
        void (*init_400054)(struct gf100_gr *);
        void (*init_4188a4)(struct gf100_gr *);
        void (*trap_mp)(struct gf100_gr *, int gpc, int tpc);
@@ -202,6 +203,7 @@ void gf100_gr_init_419eb4(struct gf100_gr *);
 void gf100_gr_init_tex_hww_esr(struct gf100_gr *, int, int);
 void gf100_gr_init_shader_exceptions(struct gf100_gr *, int, int);
 void gf100_gr_init_rop_exceptions(struct gf100_gr *);
+void gf100_gr_init_exception2(struct gf100_gr *);
 void gf100_gr_init_400054(struct gf100_gr *);
 void gf100_gr_init_num_tpc_per_gpc(struct gf100_gr *, bool, bool);
 extern const struct gf100_gr_func_zbc gf100_gr_zbc;
index a1a338c..63bd29c 100644 (file)
@@ -128,6 +128,7 @@ gf104_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf104_gr_pack_mmio,
index 5687835..495a844 100644 (file)
@@ -126,6 +126,7 @@ gf108_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf108_gr_pack_mmio,
index f6a7709..70fad23 100644 (file)
@@ -100,6 +100,7 @@ gf110_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf110_gr_pack_mmio,
index 065d183..68fd438 100644 (file)
@@ -164,6 +164,7 @@ gf117_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf117_gr_pack_mmio,
index e4add18..75ceb51 100644 (file)
@@ -191,6 +191,7 @@ gf119_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf119_gr_pack_mmio,
index 85db57b..3f7b4ef 100644 (file)
@@ -471,6 +471,7 @@ gk104_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk104_gr_pack_mmio,
index 157de00..c7e1c5d 100644 (file)
@@ -367,6 +367,7 @@ gk110_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk110_gr_pack_mmio,
index 7f590d3..458abae 100644 (file)
@@ -119,6 +119,7 @@ gk110b_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk110b_gr_pack_mmio,
index 68c74d4..d3f6b65 100644 (file)
@@ -177,6 +177,7 @@ gk208_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk208_gr_pack_mmio,
index 8ac7131..797b828 100644 (file)
@@ -412,6 +412,7 @@ gm107_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gm107_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gm107_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gm107_gr_pack_mmio,
index 0145d0c..b9d74d6 100644 (file)
@@ -200,6 +200,7 @@ gm200_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gm107_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_400054 = gm107_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
index 47cb5a2..576cabd 100644 (file)
@@ -120,6 +120,7 @@ gp100_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index e8a5dc8..f265ba0 100644 (file)
@@ -116,6 +116,7 @@ gp102_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index 4c9549e..6802cb9 100644 (file)
@@ -44,6 +44,7 @@ gp104_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index e624162..cc2bb0d 100644 (file)
@@ -46,6 +46,7 @@ gp107_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index 1034822..5008881 100644 (file)
@@ -56,6 +56,7 @@ gp10b_gr = {
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index 07507a0..25228d0 100644 (file)
@@ -104,6 +104,7 @@ gv100_gr = {
        .init_504430 = gv100_gr_init_504430,
        .init_shader_exceptions = gv100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .init_4188a4 = gv100_gr_init_4188a4,
        .trap_mp = gv100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
index bc5d77d..ce968be 100644 (file)
@@ -110,6 +110,7 @@ tu102_gr = {
        .init_504430 = gv100_gr_init_504430,
        .init_shader_exceptions = gv100_gr_init_shader_exceptions,
        .init_rop_exceptions = gf100_gr_init_rop_exceptions,
+       .init_exception2 = gf100_gr_init_exception2,
        .trap_mp = gv100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,