drm/nouveau/gr/gf100-: move some init to init_rop_exceptions()
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:11 +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 8f935b9064b38dad60314399c0c8bcf585271958..5dcebda6ddc00493c28a53ca4ac7ad11d734196e 100644 (file)
@@ -2154,6 +2154,20 @@ gf100_gr_init_400054(struct gf100_gr *gr)
        nvkm_wr32(gr->base.engine.subdev.device, 0x400054, 0x34ce3464);
 }
 
+void
+gf100_gr_init_rop_exceptions(struct gf100_gr *gr)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       int rop;
+
+       for (rop = 0; rop < gr->rop_nr; rop++) {
+               nvkm_wr32(device, ROP_UNIT(rop, 0x144), 0x40000000);
+               nvkm_wr32(device, ROP_UNIT(rop, 0x070), 0x40000000);
+               nvkm_wr32(device, ROP_UNIT(rop, 0x204), 0xffffffff);
+               nvkm_wr32(device, ROP_UNIT(rop, 0x208), 0xffffffff);
+       }
+}
+
 void
 gf100_gr_init_shader_exceptions(struct gf100_gr *gr, int gpc, int tpc)
 {
@@ -2283,7 +2297,7 @@ int
 gf100_gr_init(struct gf100_gr *gr)
 {
        struct nvkm_device *device = gr->base.engine.subdev.device;
-       int gpc, tpc, rop;
+       int gpc, tpc;
 
        nvkm_mask(device, 0x400500, 0x00010001, 0x00000000);
 
@@ -2375,12 +2389,7 @@ gf100_gr_init(struct gf100_gr *gr)
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
        }
 
-       for (rop = 0; rop < gr->rop_nr; rop++) {
-               nvkm_wr32(device, ROP_UNIT(rop, 0x144), 0x40000000);
-               nvkm_wr32(device, ROP_UNIT(rop, 0x070), 0x40000000);
-               nvkm_wr32(device, ROP_UNIT(rop, 0x204), 0xffffffff);
-               nvkm_wr32(device, ROP_UNIT(rop, 0x208), 0xffffffff);
-       }
+       gr->func->init_rop_exceptions(gr);
 
        nvkm_wr32(device, 0x400108, 0xffffffff);
        nvkm_wr32(device, 0x400138, 0xffffffff);
@@ -2464,6 +2473,7 @@ gf100_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf100_gr_pack_mmio,
index f98c739fb0b96d0c19632cd27f56249395c9971e..6f1f4fc1fd8859569747e412b56dfef9d1097d24 100644 (file)
@@ -165,6 +165,7 @@ struct gf100_gr_func {
        void (*init_tex_hww_esr)(struct gf100_gr *, int gpc, int tpc);
        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_400054)(struct gf100_gr *);
        void (*init_4188a4)(struct gf100_gr *);
        void (*trap_mp)(struct gf100_gr *, int gpc, int tpc);
@@ -200,6 +201,7 @@ void gf100_gr_init_419cc0(struct gf100_gr *);
 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_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 bb82c0a25ef87a1ef307bd63ec1e1246a2c7b982..a1a338c1626a8fde222391eaa6c2c60ec02e7a76 100644 (file)
@@ -127,6 +127,7 @@ gf104_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf104_gr_pack_mmio,
index e62520653e40f28a4172a187d9356d4a76bbd6e5..5687835f5fec960571054445057e2e318fc3c2cd 100644 (file)
@@ -125,6 +125,7 @@ gf108_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf108_gr_pack_mmio,
index d489602be1d34e5e1eaadce597d50d8c07979388..f6a77094fb5a22439d427a48d80f8b315f8311a1 100644 (file)
@@ -99,6 +99,7 @@ gf110_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf110_gr_pack_mmio,
index e3e69ab34fa3c0ec668985e285d08e4850cf6993..065d1831f1b1402bca3a9d767d4124583f1c47a4 100644 (file)
@@ -163,6 +163,7 @@ gf117_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf117_gr_pack_mmio,
index 4dccf0bf25b7c891a5a4ae94961fea301253cd89..e4add185d2663f7e3d47b3ca86fc042d17ab7daf 100644 (file)
@@ -190,6 +190,7 @@ gf119_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gf119_gr_pack_mmio,
index cff24a01ddc0167572a87c0c74477c5db5716a1f..85db57b50c2c6b8b6d0a9380f9e469ff87917b28 100644 (file)
@@ -470,6 +470,7 @@ gk104_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk104_gr_pack_mmio,
index ae430b351d4f719369059a7bb148268f951c8288..157de0003c18369fe221700e6b61c0c2f8e163c7 100644 (file)
@@ -366,6 +366,7 @@ gk110_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk110_gr_pack_mmio,
index c22eadaee1619cd82a63c4dce1db8b733fed425b..7f590d36b6f8e71a343a633ff2c5c2477ffb46cc 100644 (file)
@@ -118,6 +118,7 @@ gk110b_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk110b_gr_pack_mmio,
index 35a70a48ed7918f039701d30245af1f440a2ecaa..68c74d425ddfdabb27b74fc2ea7f1a0525437094 100644 (file)
@@ -176,6 +176,7 @@ gk208_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .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_400054 = gf100_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gk208_gr_pack_mmio,
index 17c36f30c86c4c3d8330ce9e5f43a806f2efb1c5..8ac7131877fa121d207dfa291316e41c7e41d7f8 100644 (file)
@@ -411,6 +411,7 @@ gm107_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gm107_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .init_400054 = gm107_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .mmio = gm107_gr_pack_mmio,
index 31e753f0aaf4ef145899a348895c83b1f8b522e8..0145d0cc32eee554c29b31db99f179d9e5cab21e 100644 (file)
@@ -199,6 +199,7 @@ gm200_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gm107_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .init_400054 = gm107_gr_init_400054,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
index 7a6657bcc7c35fcd691a8e8c2a6b1f9133111d5c..47cb5a20fec66b221245386fb24df48b504cffc6 100644 (file)
@@ -119,6 +119,7 @@ gp100_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index ebde815ac9d9e1b105a29502b595bdaa4029c396..e8a5dc8d14a6222c991eb6a1c8ef3266d8dce929 100644 (file)
@@ -115,6 +115,7 @@ gp102_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index 3d824bd7180c4855c5dfc1d6ae24f6fa18d280d1..4c9549e5c90173f419c81e41b720732c9671a29a 100644 (file)
@@ -43,6 +43,7 @@ gp104_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index d4f87d92378718475db817d0a2468d6d9058fbaa..e624162453a2fd665e5046ca2462a2b0cb09d5c0 100644 (file)
@@ -45,6 +45,7 @@ gp107_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index a20db4d93b28f8475e3c70fe5ec0a2e7c55b74fa..10348223e9a7307a4efb0240cbecfa542bb2c820 100644 (file)
@@ -55,6 +55,7 @@ gp10b_gr = {
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
        .init_shader_exceptions = gp100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gf100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,
index c57bb3970eb6d32637414c0edf4198efe032fbac..07507a0ee3182d8ba80ebc9da38be38076f9653f 100644 (file)
@@ -103,6 +103,7 @@ gv100_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_504430 = gv100_gr_init_504430,
        .init_shader_exceptions = gv100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .init_4188a4 = gv100_gr_init_4188a4,
        .trap_mp = gv100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
index 88f768ca8e47e56280d3f67f9fa516793e9ee763..bc5d77ded240c0a9a2e0509eaaee252a9fb74363 100644 (file)
@@ -109,6 +109,7 @@ tu102_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_504430 = gv100_gr_init_504430,
        .init_shader_exceptions = gv100_gr_init_shader_exceptions,
+       .init_rop_exceptions = gf100_gr_init_rop_exceptions,
        .trap_mp = gv100_gr_trap_mp,
        .fecs.reset = gf100_gr_fecs_reset,
        .rops = gm200_gr_rops,