diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2019-02-12 22:28:13 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2019-02-20 09:00:00 +1000 |
commit | b7f713b8d313d302588906078b92d919b44d5b75 (patch) | |
tree | 43425612960ca91061802bcf51c71a02b7bebafe /drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | |
parent | 8c7db7684448c51a406d07461aa74d436fba5b3e (diff) | |
download | linux-next-b7f713b8d313d302588906078b92d919b44d5b75.tar.gz |
drm/nouveau/gr/gf100-: move fecs bind_pointer into a function
Makes the code somewhat less magic.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index 5ab6468b25f4..0a38007ad17e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -715,6 +715,25 @@ gf100_gr_pack_mmio[] = { * PGRAPH engine/subdev functions ******************************************************************************/ +int +gf100_gr_fecs_bind_pointer(struct gf100_gr *gr, u32 inst) +{ + struct nvkm_device *device = gr->base.engine.subdev.device; + + nvkm_wr32(device, 0x409840, 0x00000030); + nvkm_wr32(device, 0x409500, inst); + nvkm_wr32(device, 0x409504, 0x00000003); + nvkm_msec(device, 2000, + u32 stat = nvkm_rd32(device, 0x409800); + if (stat & 0x00000020) + return -EIO; + if (stat & 0x00000010) + return 0; + ); + + return -ETIMEDOUT; +} + static int gf100_gr_fecs_set_reglist_virtual_address(struct gf100_gr *gr, u64 addr) { |