drm/nouveau/gr/gf100-: virtualise init_bios
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)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
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/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm200.c

index eaf32f7..6ecb4a0 100644 (file)
@@ -1953,6 +1953,9 @@ gf100_gr_init(struct gf100_gr *gr)
        if (gr->func->clkgate_pack)
                nvkm_therm_clkgate_init(device->therm, gr->func->clkgate_pack);
 
+       if (gr->func->init_bios)
+               gr->func->init_bios(gr);
+
        nvkm_mask(device, TPC_UNIT(0, 0, 0x05c), 0x00000001, 0x00000001);
 
        memcpy(tpcnr, gr->tpc_nr, sizeof(gr->tpc_nr));
index d940a1a..1320bef 100644 (file)
@@ -123,6 +123,7 @@ struct gf100_gr_func {
        int (*init)(struct gf100_gr *);
        void (*init_gpc_mmu)(struct gf100_gr *);
        void (*init_r405a14)(struct gf100_gr *);
+       void (*init_bios)(struct gf100_gr *);
        void (*init_rop_active_fbps)(struct gf100_gr *);
        void (*init_ppc_exceptions)(struct gf100_gr *);
        void (*init_swdx_pes_mask)(struct gf100_gr *);
@@ -151,7 +152,6 @@ void gk104_gr_init_ppc_exceptions(struct gf100_gr *);
 
 int gk20a_gr_init(struct gf100_gr *);
 
-int gm200_gr_init(struct gf100_gr *);
 int gm200_gr_rops(struct gf100_gr *);
 
 int gp100_gr_init(struct gf100_gr *);
index 5ea74f6..d5629cd 100644 (file)
@@ -335,7 +335,7 @@ gm107_gr_init(struct gf100_gr *gr)
 
        gf100_gr_mmio(gr, gr->func->mmio);
 
-       gm107_gr_init_bios(gr);
+       gr->func->init_bios(gr);
 
        nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001);
 
@@ -451,6 +451,7 @@ static const struct gf100_gr_func
 gm107_gr = {
        .init = gm107_gr_init,
        .init_gpc_mmu = gm107_gr_init_gpc_mmu,
+       .init_bios = gm107_gr_init_bios,
        .init_rop_active_fbps = gk104_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .mmio = gm107_gr_pack_mmio,
index 6435f12..7a793a0 100644 (file)
@@ -61,7 +61,7 @@ gm200_gr_init_rop_active_fbps(struct gf100_gr *gr)
        nvkm_mask(device, 0x408958, 0x0000000f, fbp_count); /* crop */
 }
 
-int
+static int
 gm200_gr_init(struct gf100_gr *gr)
 {
        struct nvkm_device *device = gr->base.engine.subdev.device;
@@ -75,7 +75,7 @@ gm200_gr_init(struct gf100_gr *gr)
 
        gf100_gr_mmio(gr, gr->fuc_sw_nonctx);
 
-       gm107_gr_init_bios(gr);
+       gr->func->init_bios(gr);
 
        nvkm_wr32(device, GPC_UNIT(0, 0x3018), 0x00000001);
 
@@ -210,6 +210,7 @@ static const struct gf100_gr_func
 gm200_gr = {
        .init = gm200_gr_init,
        .init_gpc_mmu = gm200_gr_init_gpc_mmu,
+       .init_bios = gm107_gr_init_bios,
        .init_rop_active_fbps = gm200_gr_init_rop_active_fbps,
        .init_ppc_exceptions = gk104_gr_init_ppc_exceptions,
        .rops = gm200_gr_rops,