drm/nouveau/gr/gf100-: move fecs set_watchdog_timeout method into a function

Makes the code somewhat less magic.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Ben Skeggs 2019-02-12 22:28:13 +10:00
parent f0eee9aec0
commit eb383e629c
1 changed files with 11 additions and 3 deletions

View File

@ -715,6 +715,16 @@ gf100_gr_pack_mmio[] = {
* PGRAPH engine/subdev functions * PGRAPH engine/subdev functions
******************************************************************************/ ******************************************************************************/
static void
gf100_gr_fecs_set_watchdog_timeout(struct gf100_gr *gr, u32 timeout)
{
struct nvkm_device *device = gr->base.engine.subdev.device;
nvkm_wr32(device, 0x409840, 0xffffffff);
nvkm_wr32(device, 0x409500, timeout);
nvkm_wr32(device, 0x409504, 0x00000021);
}
static bool static bool
gf100_gr_chsw_load(struct nvkm_gr *base) gf100_gr_chsw_load(struct nvkm_gr *base)
{ {
@ -1524,9 +1534,7 @@ gf100_gr_init_ctxctl_ext(struct gf100_gr *gr)
) < 0) ) < 0)
return -EBUSY; return -EBUSY;
nvkm_wr32(device, 0x409840, 0xffffffff); gf100_gr_fecs_set_watchdog_timeout(gr, 0x7fffffff);
nvkm_wr32(device, 0x409500, 0x7fffffff);
nvkm_wr32(device, 0x409504, 0x00000021);
nvkm_wr32(device, 0x409840, 0xffffffff); nvkm_wr32(device, 0x409840, 0xffffffff);
nvkm_wr32(device, 0x409500, 0x00000000); nvkm_wr32(device, 0x409500, 0x00000000);