]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/nouveau/gr/gf100-: virtualise init_shader_exceptions
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:23 +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 274ff014ab9e9d812ab48392df8547346b63833d..071b3c1a93ab78f4e0a158294035a1026a99b7ac 100644 (file)
@@ -1915,7 +1915,15 @@ gf100_gr_new_(const struct gf100_gr_func *func, struct nvkm_device *device,
 }
 
 void
-gf100_gr_init_tex_hww_esr(struct gf100_gr *gr, int tpc, int gpc)
+gf100_gr_init_shader_exceptions(struct gf100_gr *gr, int gpc, int tpc)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x001ffffe);
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x0000000f);
+}
+
+void
+gf100_gr_init_tex_hww_esr(struct gf100_gr *gr, int gpc, int tpc)
 {
        struct nvkm_device *device = gr->base.engine.subdev.device;
        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x224), 0xc0000000);
@@ -2094,8 +2102,7 @@ gf100_gr_init(struct gf100_gr *gr)
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
                        if (gr->func->init_504430)
                                gr->func->init_504430(gr, gpc, tpc);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x001ffffe);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x0000000f);
+                       gr->func->init_shader_exceptions(gr, gpc, tpc);
                }
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
@@ -2154,6 +2161,7 @@ gf100_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf100_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 81d5931eff325f9771d167fe816ca8f6ccd2f0bb..02505c020f6aa27f8ff997e37b38630545fd21fe 100644 (file)
@@ -140,6 +140,7 @@ struct gf100_gr_func {
        void (*init_ppc_exceptions)(struct gf100_gr *);
        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 (*set_hww_esr_report_mask)(struct gf100_gr *);
        const struct gf100_gr_pack *mmio;
        struct {
@@ -165,6 +166,7 @@ void gf100_gr_init_40601c(struct gf100_gr *);
 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 gf117_gr_init_zcull(struct gf100_gr *);
 
@@ -177,6 +179,7 @@ void gk104_gr_init_sked_hww_esr(struct gf100_gr *);
 void gk110_gr_init_419eb4(struct gf100_gr *);
 
 void gm107_gr_init_504430(struct gf100_gr *, int, int);
+void gm107_gr_init_shader_exceptions(struct gf100_gr *, int, int);
 
 int gk20a_gr_init(struct gf100_gr *);
 
@@ -187,6 +190,7 @@ void gm200_gr_init_ds_hww_esr_2(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 gp100_gr_init_shader_exceptions(struct gf100_gr *, int, int);
 
 void gp102_gr_init_swdx_pes_mask(struct gf100_gr *);
 
index ff03f13b087f65c64cf150ba3153c4d0232d41c1..c61544487ed719552e9bc3050a9b1c4f4cfa8beb 100644 (file)
@@ -124,6 +124,7 @@ gf104_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf104_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index ce60f5aa9901f1c8efc6a9e367d723bdc97b7499..8e8a99e54f56701b0de2f1c9c4ddf104f4d1f5fd 100644 (file)
@@ -122,6 +122,7 @@ gf108_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf108_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 4c21cbe3df97123bb976d0affee3a31afbbff98f..6496411b7dfee73b919df26485858a3da5a5bac2 100644 (file)
@@ -96,6 +96,7 @@ gf110_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf110_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 10340e9f3e1a81bb937dcd604af68d286f7a2993..21aa8e22700274707779645f3749b3166df9bf96 100644 (file)
@@ -160,6 +160,7 @@ gf117_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf117_gr_pack_mmio,
        .fecs.ucode = &gf117_gr_fecs_ucode,
        .gpccs.ucode = &gf117_gr_gpccs_ucode,
index 5147c590dc20b3a85630b2b4bf093ed8499f248d..7d73a9f8ca485750503e7ae482698f56915e85b1 100644 (file)
@@ -187,6 +187,7 @@ gf119_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .init_419eb4 = gf100_gr_init_419eb4,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
+       .init_shader_exceptions = gf100_gr_init_shader_exceptions,
        .mmio = gf119_gr_pack_mmio,
        .fecs.ucode = &gf100_gr_fecs_ucode,
        .gpccs.ucode = &gf100_gr_gpccs_ucode,
index 1805196372d51727077c18527e1d5b478db6cdfc..20735319e9205298daa96d639a61a8452ab0c765 100644 (file)
@@ -475,8 +475,7 @@ gk104_gr_init(struct gf100_gr *gr)
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x50c), 0xffffffff);
                        gr->func->init_tex_hww_esr(gr, gpc, tpc);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x001ffffe);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x0000000f);
+                       gr->func->init_shader_exceptions(gr, gpc, tpc);
                }
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
@@ -537,6 +536,7 @@ gk104_gr = {
        .init_419eb4 = gf100_gr_init_419eb4,
        .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,
        .mmio = gk104_gr_pack_mmio,
        .fecs.ucode = &gk104_gr_fecs_ucode,
        .gpccs.ucode = &gk104_gr_gpccs_ucode,
index f4c73a929756f19d16741d0184dde851ec97d7a0..e52cc2423353835b9b84378da2b3b42f99475587 100644 (file)
@@ -362,6 +362,7 @@ gk110_gr = {
        .init_419eb4 = gk110_gr_init_419eb4,
        .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,
        .mmio = gk110_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
        .gpccs.ucode = &gk110_gr_gpccs_ucode,
index b585ab22ccc1dfe3b6acbd42e7b8f7d253d30474..35303818c4a29ca8b2b9d393d86236b15230d600 100644 (file)
@@ -114,6 +114,7 @@ gk110b_gr = {
        .init_419eb4 = gk110_gr_init_419eb4,
        .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,
        .mmio = gk110b_gr_pack_mmio,
        .fecs.ucode = &gk110_gr_fecs_ucode,
        .gpccs.ucode = &gk110_gr_gpccs_ucode,
index 7d1f585a7e545062315a84f82fc9a7f0ea2f0436..4e5cd540a321cb3e9a4e9175790e46367b77f07b 100644 (file)
@@ -172,6 +172,7 @@ gk208_gr = {
        .init_419cc0 = gf100_gr_init_419cc0,
        .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,
        .mmio = gk208_gr_pack_mmio,
        .fecs.ucode = &gk208_gr_fecs_ucode,
        .gpccs.ucode = &gk208_gr_gpccs_ucode,
index 4c8c2561282b297e196ade0a0170d0a3da50a9f3..3b8ae137798f4325efd44de571810fd4b3096e8c 100644 (file)
@@ -281,6 +281,14 @@ gm107_gr_pack_mmio[] = {
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
+void
+gm107_gr_init_shader_exceptions(struct gf100_gr *gr, int gpc, int tpc)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000005);
+}
+
 void
 gm107_gr_init_504430(struct gf100_gr *gr, int gpc, int tpc)
 {
@@ -403,8 +411,7 @@ gm107_gr_init(struct gf100_gr *gr)
                        gr->func->init_tex_hww_esr(gr, gpc, tpc);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
                        gr->func->init_504430(gr, gpc, tpc);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000005);
+                       gr->func->init_shader_exceptions(gr, gpc, tpc);
                }
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
@@ -467,6 +474,7 @@ gm107_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gm107_gr_init_shader_exceptions,
        .mmio = gm107_gr_pack_mmio,
        .fecs.ucode = &gm107_gr_fecs_ucode,
        .gpccs.ucode = &gm107_gr_gpccs_ucode,
index 69f191ec78ab6bb2db141816cde45cbb5fe26b63..3e2a78dfb1fdfacc51d6f8b4d82b3637779a9d47 100644 (file)
@@ -124,8 +124,7 @@ gm200_gr_init(struct gf100_gr *gr)
                        gr->func->init_tex_hww_esr(gr, gpc, tpc);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
                        gr->func->init_504430(gr, gpc, tpc);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000005);
+                       gr->func->init_shader_exceptions(gr, gpc, tpc);
                }
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
@@ -206,6 +205,7 @@ gm200_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gm107_gr_init_shader_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
        .grctx = &gm200_grctx,
index 76a9416fa4ede57ab857d6533158b667936d35d5..48a0e144d98385cb96929fc7af7f115d62c8ef01 100644 (file)
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
+void
+gp100_gr_init_shader_exceptions(struct gf100_gr *gr, int gpc, int tpc)
+{
+       struct nvkm_device *device = gr->base.engine.subdev.device;
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
+       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000105);
+}
+
 static void
 gp100_gr_init_419c9c(struct gf100_gr *gr)
 {
@@ -104,8 +112,7 @@ gp100_gr_init(struct gf100_gr *gr)
                        gr->func->init_tex_hww_esr(gr, gpc, tpc);
                        nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x084), 0xc0000000);
                        gr->func->init_504430(gr, gpc, gpc);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x644), 0x00dffffe);
-                       nvkm_wr32(device, TPC_UNIT(gpc, tpc, 0x64c), 0x00000105);
+                       gr->func->init_shader_exceptions(gr, gpc, tpc);
                }
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c90), 0xffffffff);
                nvkm_wr32(device, GPC_UNIT(gpc, 0x2c94), 0xffffffff);
@@ -146,6 +153,7 @@ gp100_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 2,
        .grctx = &gp100_grctx,
index 7072578be6484b343bf72ee3ac109e868fd6d2a5..7ce06520fdc9935a5e2397ec11e195e50c824f33 100644 (file)
@@ -56,6 +56,7 @@ gp102_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 3,
        .grctx = &gp102_grctx,
index f23f70f027e27882b07a0027a7b36867cde126a1..dbb2d4e71442de977ffa9770449cee55b23a8e47 100644 (file)
@@ -42,6 +42,7 @@ gp107_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
        .grctx = &gp107_grctx,
index 0ff175960a36ca925ab8517019805a63071c8de0..7f23d8bd977fee47235a2c52dbde723ab2337958 100644 (file)
@@ -40,6 +40,7 @@ gp10b_gr = {
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .init_tex_hww_esr = gf100_gr_init_tex_hww_esr,
        .init_504430 = gm107_gr_init_504430,
+       .init_shader_exceptions = gp100_gr_init_shader_exceptions,
        .rops = gm200_gr_rops,
        .ppc_nr = 1,
        .grctx = &gp102_grctx,