Commit fb80ad15 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fifo/gk104-: group pbdma functions together

We're about to be adding more of them.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent efa44c66
...@@ -249,6 +249,10 @@ gk104_fifo_runlist = { ...@@ -249,6 +249,10 @@ gk104_fifo_runlist = {
.commit = gk104_fifo_runlist_commit, .commit = gk104_fifo_runlist_commit,
}; };
const struct gk104_fifo_pbdma_func
gk104_fifo_pbdma = {
};
static void static void
gk104_fifo_recover_work(struct work_struct *w) gk104_fifo_recover_work(struct work_struct *w)
{ {
...@@ -1004,8 +1008,8 @@ gk104_fifo_init(struct nvkm_fifo *base) ...@@ -1004,8 +1008,8 @@ gk104_fifo_init(struct nvkm_fifo *base)
nvkm_wr32(device, 0x002254, 0x10000000 | fifo->user.bar->addr >> 12); nvkm_wr32(device, 0x002254, 0x10000000 | fifo->user.bar->addr >> 12);
if (fifo->func->init_pbdma_timeout) if (fifo->func->pbdma->init_timeout)
fifo->func->init_pbdma_timeout(fifo); fifo->func->pbdma->init_timeout(fifo);
nvkm_wr32(device, 0x002100, 0xffffffff); nvkm_wr32(device, 0x002100, 0xffffffff);
nvkm_wr32(device, 0x002140, 0x7fffffff); nvkm_wr32(device, 0x002140, 0x7fffffff);
...@@ -1184,6 +1188,7 @@ gk104_fifo_fault_gpcclient[] = { ...@@ -1184,6 +1188,7 @@ gk104_fifo_fault_gpcclient[] = {
static const struct gk104_fifo_func static const struct gk104_fifo_func
gk104_fifo = { gk104_fifo = {
.pbdma = &gk104_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gk104_fifo_fault_engine, .fault.engine = gk104_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -45,7 +45,9 @@ struct gk104_fifo { ...@@ -45,7 +45,9 @@ struct gk104_fifo {
}; };
struct gk104_fifo_func { struct gk104_fifo_func {
void (*init_pbdma_timeout)(struct gk104_fifo *); const struct gk104_fifo_pbdma_func {
void (*init_timeout)(struct gk104_fifo *);
} *pbdma;
struct { struct {
const struct nvkm_enum *access; const struct nvkm_enum *access;
...@@ -85,6 +87,7 @@ void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *); ...@@ -85,6 +87,7 @@ void gk104_fifo_runlist_insert(struct gk104_fifo *, struct gk104_fifo_chan *);
void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *); void gk104_fifo_runlist_remove(struct gk104_fifo *, struct gk104_fifo_chan *);
void gk104_fifo_runlist_update(struct gk104_fifo *, int runl); void gk104_fifo_runlist_update(struct gk104_fifo *, int runl);
extern const struct gk104_fifo_pbdma_func gk104_fifo_pbdma;
extern const struct nvkm_enum gk104_fifo_fault_access[]; extern const struct nvkm_enum gk104_fifo_fault_access[];
extern const struct nvkm_enum gk104_fifo_fault_engine[]; extern const struct nvkm_enum gk104_fifo_fault_engine[];
extern const struct nvkm_enum gk104_fifo_fault_reason[]; extern const struct nvkm_enum gk104_fifo_fault_reason[];
...@@ -100,7 +103,8 @@ extern const struct gk104_fifo_runlist_func gk110_fifo_runlist; ...@@ -100,7 +103,8 @@ extern const struct gk104_fifo_runlist_func gk110_fifo_runlist;
void gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *, void gk110_fifo_runlist_cgrp(struct nvkm_fifo_cgrp *,
struct nvkm_memory *, u32); struct nvkm_memory *, u32);
void gk208_fifo_init_pbdma_timeout(struct gk104_fifo *); extern const struct gk104_fifo_pbdma_func gk208_fifo_pbdma;
void gk208_fifo_pbdma_init_timeout(struct gk104_fifo *);
extern const struct nvkm_enum gm107_fifo_fault_engine[]; extern const struct nvkm_enum gm107_fifo_fault_engine[];
extern const struct gk104_fifo_runlist_func gm107_fifo_runlist; extern const struct gk104_fifo_runlist_func gm107_fifo_runlist;
......
...@@ -48,6 +48,7 @@ gk110_fifo_runlist = { ...@@ -48,6 +48,7 @@ gk110_fifo_runlist = {
static const struct gk104_fifo_func static const struct gk104_fifo_func
gk110_fifo = { gk110_fifo = {
.pbdma = &gk104_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gk104_fifo_fault_engine, .fault.engine = gk104_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <nvif/class.h> #include <nvif/class.h>
void void
gk208_fifo_init_pbdma_timeout(struct gk104_fifo *fifo) gk208_fifo_pbdma_init_timeout(struct gk104_fifo *fifo)
{ {
struct nvkm_device *device = fifo->base.engine.subdev.device; struct nvkm_device *device = fifo->base.engine.subdev.device;
int i; int i;
...@@ -36,9 +36,14 @@ gk208_fifo_init_pbdma_timeout(struct gk104_fifo *fifo) ...@@ -36,9 +36,14 @@ gk208_fifo_init_pbdma_timeout(struct gk104_fifo *fifo)
nvkm_wr32(device, 0x04012c + (i * 0x2000), 0x0000ffff); nvkm_wr32(device, 0x04012c + (i * 0x2000), 0x0000ffff);
} }
const struct gk104_fifo_pbdma_func
gk208_fifo_pbdma = {
.init_timeout = gk208_fifo_pbdma_init_timeout,
};
static const struct gk104_fifo_func static const struct gk104_fifo_func
gk208_fifo = { gk208_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gk104_fifo_fault_engine, .fault.engine = gk104_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
static const struct gk104_fifo_func static const struct gk104_fifo_func
gk20a_fifo = { gk20a_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gk104_fifo_fault_engine, .fault.engine = gk104_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -69,7 +69,7 @@ gm107_fifo_fault_engine[] = { ...@@ -69,7 +69,7 @@ gm107_fifo_fault_engine[] = {
static const struct gk104_fifo_func static const struct gk104_fifo_func
gm107_fifo = { gm107_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gm107_fifo_fault_engine, .fault.engine = gm107_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
static const struct gk104_fifo_func static const struct gk104_fifo_func
gm200_fifo = { gm200_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gm107_fifo_fault_engine, .fault.engine = gm107_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
static const struct gk104_fifo_func static const struct gk104_fifo_func
gm20b_fifo = { gm20b_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gm107_fifo_fault_engine, .fault.engine = gm107_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -52,7 +52,7 @@ gp100_fifo_fault_engine[] = { ...@@ -52,7 +52,7 @@ gp100_fifo_fault_engine[] = {
static const struct gk104_fifo_func static const struct gk104_fifo_func
gp100_fifo = { gp100_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gp100_fifo_fault_engine, .fault.engine = gp100_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
static const struct gk104_fifo_func static const struct gk104_fifo_func
gp10b_fifo = { gp10b_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gk104_fifo_fault_access, .fault.access = gk104_fifo_fault_access,
.fault.engine = gp100_fifo_fault_engine, .fault.engine = gp100_fifo_fault_engine,
.fault.reason = gk104_fifo_fault_reason, .fault.reason = gk104_fifo_fault_reason,
......
...@@ -288,7 +288,7 @@ gv100_fifo_fault_access[] = { ...@@ -288,7 +288,7 @@ gv100_fifo_fault_access[] = {
static const struct gk104_fifo_func static const struct gk104_fifo_func
gv100_fifo = { gv100_fifo = {
.init_pbdma_timeout = gk208_fifo_init_pbdma_timeout, .pbdma = &gk208_fifo_pbdma,
.fault.access = gv100_fifo_fault_access, .fault.access = gv100_fifo_fault_access,
.fault.engine = gv100_fifo_fault_engine, .fault.engine = gv100_fifo_fault_engine,
.fault.reason = gv100_fifo_fault_reason, .fault.reason = gv100_fifo_fault_reason,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment