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 5dcebda6ddc00493c28a53ca4ac7ad11d734196e..b9961d254749f548cf5842186fcfd391f8b90509 100644 (file)
@@ -2154,6 +2154,15 @@ gf100_gr_init_400054(struct gf100_gr *gr)
        nvkm_wr32(gr->base.engine.subdev.device, 0x400054, 0x34ce3464);
 }
 
+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)
 {
@@ -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 6f1f4fc1fd8859569747e412b56dfef9d1097d24..cb1d7b2c0558773b9cd253ab02927da1e9b38e88 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 a1a338c1626a8fde222391eaa6c2c60ec02e7a76..63bd29c22fe15c91023a819af50434612a3fe862 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 5687835f5fec960571054445057e2e318fc3c2cd..495a844f925f195dece57c4460f076f2a71fbced 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 f6a77094fb5a22439d427a48d80f8b315f8311a1..70fad235d161f51b959202f4b6d235d02c0e5ea4 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 065d1831f1b1402bca3a9d767d4124583f1c47a4..68fd4384b5e5daddbc6d239e2189f52b69012487 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 e4add185d2663f7e3d47b3ca86fc042d17ab7daf..75ceb514c06ed40b4af49eb8f54782b03a6e4a08 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 85db57b50c2c6b8b6d0a9380f9e469ff87917b28..3f7b4ef3529ef5db1e02393e8cb39c6998c5b75e 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 157de0003c18369fe221700e6b61c0c2f8e163c7..c7e1c5dbc6a9e62b0f4ae97707bd076aa5e8f960 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 7f590d36b6f8e71a343a633ff2c5c2477ffb46cc..458abae571bf7091632738be28315c5b2a14f26f 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 68c74d425ddfdabb27b74fc2ea7f1a0525437094..d3f6b65c21d22a70954752b3c13afa96e1730ad2 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 8ac7131877fa121d207dfa291316e41c7e41d7f8..797b828a943bdfedfd48e1ae9ffe5cae50e6c4bb 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 0145d0cc32eee554c29b31db99f179d9e5cab21e..b9d74d65038d49586e055d424a1fab87bf02ec28 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 47cb5a20fec66b221245386fb24df48b504cffc6..576cabd80a4a83b2e6085509166b2d1e41e5e54a 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 e8a5dc8d14a6222c991eb6a1c8ef3266d8dce929..f265ba08c5ef4562ab993fff3096115f22b7b43e 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 4c9549e5c90173f419c81e41b720732c9671a29a..6802cb9b199f02b47e15d7a5050e335a0255dc08 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 e624162453a2fd665e5046ca2462a2b0cb09d5c0..cc2bb0d0a9870e6145edef92babc480062e2d8c8 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 10348223e9a7307a4efb0240cbecfa542bb2c820..5008881ca079fc913bf353d22ecc09c1e7da6c78 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 07507a0ee3182d8ba80ebc9da38be38076f9653f..25228d09a30b0ef4316944df888fbda88c511c99 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 bc5d77ded240c0a9a2e0509eaaee252a9fb74363..ce968be6f290c055f6e8a3fd9da6a8fb60a2dc41 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,