]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
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 eaf32f79ee470e1d0a6e860267c9d0f52b1ab1a2..6ecb4a05096d5724231b76731ae9a6780d2130c3 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 d940a1a239e8d0c5a944e5bc83573710179bc257..1320befd4f10c0167783c821fd9c379ba5f563f2 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 5ea74f62cee4f7b5738c4c9e572c2df980dc0b03..d5629cdddf4a696157488014ba6621928ee5d923 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 6435f125757232a884c72477c44b19eef84f7d56..7a793a0bb28ed94ed4457e373de8e2087d3771c5 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,