drm/nouveau/gr/gf100-: implement chsw_load() method
authorBen Skeggs <bskeggs@redhat.com>
Mon, 16 Jan 2017 00:28:54 +0000 (10:28 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 07:38:11 +0000 (17:38 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c

index 88aa0b7385d9ed0010c5cc48c31cd396efa82b92..f9acb8a944d2d0b72a5ab9b02c4a92d590ab76a6 100644 (file)
@@ -702,6 +702,22 @@ gf100_gr_pack_mmio[] = {
  * PGRAPH engine/subdev functions
  ******************************************************************************/
 
+static bool
+gf100_gr_chsw_load(struct nvkm_gr *base)
+{
+       struct gf100_gr *gr = gf100_gr(base);
+       if (!gr->firmware) {
+               u32 trace = nvkm_rd32(gr->base.engine.subdev.device, 0x40981c);
+               if (trace & 0x00000040)
+                       return true;
+       } else {
+               u32 mthd = nvkm_rd32(gr->base.engine.subdev.device, 0x409808);
+               if (mthd & 0x00080000)
+                       return true;
+       }
+       return false;
+}
+
 int
 gf100_gr_rops(struct gf100_gr *gr)
 {
@@ -1770,6 +1786,7 @@ gf100_gr_ = {
        .units = gf100_gr_units,
        .chan_new = gf100_gr_chan_new,
        .object_get = gf100_gr_object_get,
+       .chsw_load = gf100_gr_chsw_load,
 };
 
 int