drm/nouveau/gr/gf100-: support firmware-provided sw_ctx everywhere
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>
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.c

index 881015080d83826fb3e35f342f5d33739e34b6aa..e2c8077b70df987bc4f6c280ab7aff8aa1b3b70c 100644 (file)
@@ -1239,11 +1239,15 @@ gf100_grctx_generate_main(struct gf100_gr *gr, struct gf100_grctx *info)
 
        nvkm_mc_unk260(device, 0);
 
-       gf100_gr_mmio(gr, grctx->hub);
-       gf100_gr_mmio(gr, grctx->gpc);
-       gf100_gr_mmio(gr, grctx->zcull);
-       gf100_gr_mmio(gr, grctx->tpc);
-       gf100_gr_mmio(gr, grctx->ppc);
+       if (!gr->fuc_sw_ctx) {
+               gf100_gr_mmio(gr, grctx->hub);
+               gf100_gr_mmio(gr, grctx->gpc);
+               gf100_gr_mmio(gr, grctx->zcull);
+               gf100_gr_mmio(gr, grctx->tpc);
+               gf100_gr_mmio(gr, grctx->ppc);
+       } else {
+               gf100_gr_mmio(gr, gr->fuc_sw_ctx);
+       }
 
        idle_timeout = nvkm_mask(device, 0x404154, 0xffffffff, 0x00000000);