drm/nouveau/fifo/gk208-: write pbdma timeout regs during initialisation
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/fifo/gk104.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk208.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk20a.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gm107.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gm200.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gm20b.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gp100.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gp10b.c

index bc87f18c3092849983ca5b70a177307f16b9116c..5c22ce91653084093dd93e40588f41504cc479fb 100644 (file)
@@ -962,6 +962,9 @@ gk104_fifo_init(struct nvkm_fifo *base)
 
        nvkm_wr32(device, 0x002254, 0x10000000 | fifo->user.bar->addr >> 12);
 
+       if (fifo->func->init_pbdma_timeout)
+               fifo->func->init_pbdma_timeout(fifo);
+
        nvkm_wr32(device, 0x002100, 0xffffffff);
        nvkm_wr32(device, 0x002140, 0x7fffffff);
 }
index dfb3da84c9d1ce7ad5c033e270e811a171efa453..e232cee1b83c47aefa1dd6768d056dc58d833525 100644 (file)
@@ -45,6 +45,8 @@ struct gk104_fifo {
 };
 
 struct gk104_fifo_func {
+       void (*init_pbdma_timeout)(struct gk104_fifo *);
+
        struct {
                const struct nvkm_enum *access;
                const struct nvkm_enum *engine;
@@ -87,6 +89,8 @@ extern const struct gk104_fifo_runlist_func gk110_fifo_runlist;
 void gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *,
                             struct nvkm_memory *, u32);
 
+void gk208_fifo_init_pbdma_timeout(struct gk104_fifo *);
+
 extern const struct nvkm_enum gm107_fifo_fault_engine[];
 extern const struct nvkm_enum gp100_fifo_fault_engine[];
 #endif
index b7385cd70b25ebc55b16b962b2f3fe51cc4d21d7..5ea7e452cc660d4f2120be5194ad2d9be2848891 100644 (file)
 
 #include <nvif/class.h>
 
+void
+gk208_fifo_init_pbdma_timeout(struct gk104_fifo *fifo)
+{
+       struct nvkm_device *device = fifo->base.engine.subdev.device;
+       int i;
+
+       for (i = 0; i < fifo->pbdma_nr; i++)
+               nvkm_wr32(device, 0x04012c + (i * 0x2000), 0x0000ffff);
+}
+
 static const struct gk104_fifo_func
 gk208_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gk104_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index 15cc80c02649fe9c44bc2b8da2852e555359ac17..535a0eb67a5fc83eda731e5fc60ca0853ba41206 100644 (file)
@@ -26,6 +26,7 @@
 
 static const struct gk104_fifo_func
 gk20a_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gk104_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index 99b89f6ae34bb4f9eb5f1dd89dbd87564eb4eb40..a28f5d213d6e161faac552a7193aa286bc591815 100644 (file)
@@ -51,6 +51,7 @@ gm107_fifo_fault_engine[] = {
 
 static const struct gk104_fifo_func
 gm107_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gm107_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index 16fd8de135a7b45ad727b87936718531f247ad01..0bd87a0b25e8a15c3c50890a5593e96110656cbc 100644 (file)
@@ -28,6 +28,7 @@
 
 static const struct gk104_fifo_func
 gm200_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gm107_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index bfa5fa5bc5e525c65921fb245f0264e3fc42c21e..32a8e3deb87d3e5e6d5574b7f4edee6088813c26 100644 (file)
@@ -26,6 +26,7 @@
 
 static const struct gk104_fifo_func
 gm20b_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gm107_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index c2852943fc3c1b1bac8770a2cd4e9eba96f8f383..69b201f29cd56826b4c7c76d4f5cdf6fba6dbed3 100644 (file)
@@ -52,6 +52,7 @@ gp100_fifo_fault_engine[] = {
 
 static const struct gk104_fifo_func
 gp100_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gp100_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,
index 29a4029694deffcc6e2aeddd87a757e81d59aa68..fac7be50376c7c02c83e9d6ec9c449415e3257a1 100644 (file)
@@ -26,6 +26,7 @@
 
 static const struct gk104_fifo_func
 gp10b_fifo = {
+       .init_pbdma_timeout = gk208_fifo_init_pbdma_timeout,
        .fault.access = gk104_fifo_fault_access,
        .fault.engine = gp100_fifo_fault_engine,
        .fault.reason = gk104_fifo_fault_reason,