diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:22 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:37:44 +1000 |
commit | ed4bb4e997bd83443c9bf6766c2de60d3a2f8897 (patch) | |
tree | 631a8691e3b81f1227d63328e30d7b27887f0245 /drm/nouveau/nvkm/engine/fifo | |
parent | 724b52d8519cd6ed1f8123d08f4ff09fe7a85e4c (diff) | |
download | nouveau-ed4bb4e997bd83443c9bf6766c2de60d3a2f8897.tar.gz |
core: remove the remainder of the previous style
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drm/nouveau/nvkm/engine/fifo')
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/chan.c | 2 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/chang84.c | 105 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/changf100.h | 2 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/changk104.h | 2 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/channv04.h | 2 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/channv50.c | 34 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/channv50.h | 2 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/dmanv04.c | 14 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/dmanv10.c | 6 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/dmanv17.c | 8 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/dmanv40.c | 34 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/gf100.c | 50 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/gk104.c | 34 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/gk104.h | 36 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/gpfifogf100.c | 34 | ||||
-rw-r--r-- | drm/nouveau/nvkm/engine/fifo/gpfifogk104.c | 22 |
16 files changed, 175 insertions, 212 deletions
diff --git a/drm/nouveau/nvkm/engine/fifo/chan.c b/drm/nouveau/nvkm/engine/fifo/chan.c index 4ed06abdc..a56e56eed 100644 --- a/drm/nouveau/nvkm/engine/fifo/chan.c +++ b/drm/nouveau/nvkm/engine/fifo/chan.c @@ -332,7 +332,7 @@ nvkm_fifo_chan_dtor(struct nvkm_object *object) return data; } -const struct nvkm_object_func +static const struct nvkm_object_func nvkm_fifo_chan_func = { .dtor = nvkm_fifo_chan_dtor, .init = nvkm_fifo_chan_init, diff --git a/drm/nouveau/nvkm/engine/fifo/chang84.c b/drm/nouveau/nvkm/engine/fifo/chang84.c index a7e5dfae3..04305241c 100644 --- a/drm/nouveau/nvkm/engine/fifo/chang84.c +++ b/drm/nouveau/nvkm/engine/fifo/chang84.c @@ -48,16 +48,16 @@ static int g84_fifo_chan_engine(struct nvkm_engine *engine) { switch (engine->subdev.index) { - case NVDEV_ENGINE_GR : return 0; - case NVDEV_ENGINE_MPEG : - case NVDEV_ENGINE_MSPPP : return 1; - case NVDEV_ENGINE_CE0 : return 2; - case NVDEV_ENGINE_VP : - case NVDEV_ENGINE_MSPDEC: return 3; - case NVDEV_ENGINE_CIPHER: - case NVDEV_ENGINE_SEC : return 4; - case NVDEV_ENGINE_BSP : - case NVDEV_ENGINE_MSVLD : return 5; + case NVKM_ENGINE_GR : return 0; + case NVKM_ENGINE_MPEG : + case NVKM_ENGINE_MSPPP : return 1; + case NVKM_ENGINE_CE0 : return 2; + case NVKM_ENGINE_VP : + case NVKM_ENGINE_MSPDEC: return 3; + case NVKM_ENGINE_CIPHER: + case NVKM_ENGINE_SEC : return 4; + case NVKM_ENGINE_BSP : + case NVKM_ENGINE_MSVLD : return 5; default: WARN_ON(1); return 0; @@ -68,18 +68,18 @@ static int g84_fifo_chan_engine_addr(struct nvkm_engine *engine) { switch (engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : return -1; - case NVDEV_ENGINE_GR : return 0x0020; - case NVDEV_ENGINE_VP : - case NVDEV_ENGINE_MSPDEC: return 0x0040; - case NVDEV_ENGINE_MPEG : - case NVDEV_ENGINE_MSPPP : return 0x0060; - case NVDEV_ENGINE_BSP : - case NVDEV_ENGINE_MSVLD : return 0x0080; - case NVDEV_ENGINE_CIPHER: - case NVDEV_ENGINE_SEC : return 0x00a0; - case NVDEV_ENGINE_CE0 : return 0x00c0; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : return -1; + case NVKM_ENGINE_GR : return 0x0020; + case NVKM_ENGINE_VP : + case NVKM_ENGINE_MSPDEC: return 0x0040; + case NVKM_ENGINE_MPEG : + case NVKM_ENGINE_MSPPP : return 0x0060; + case NVKM_ENGINE_BSP : + case NVKM_ENGINE_MSVLD : return 0x0080; + case NVKM_ENGINE_CIPHER: + case NVKM_ENGINE_SEC : return 0x00a0; + case NVKM_ENGINE_CE0 : return 0x00c0; default: WARN_ON(1); return -1; @@ -167,11 +167,6 @@ g84_fifo_chan_engine_ctor(struct nvkm_fifo_chan *base, if (g84_fifo_chan_engine_addr(engine) < 0) return 0; - if (nv_iclass(object, NV_GPUOBJ_CLASS)) { - chan->engn[engn] = nv_gpuobj(object); - return 0; - } - return nvkm_object_bind(object, NULL, 0, &chan->engn[engn]); } @@ -184,20 +179,20 @@ g84_fifo_chan_object_ctor(struct nvkm_fifo_chan *base, u32 context; switch (object->engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : context = 0x00000000; break; - case NVDEV_ENGINE_GR : context = 0x00100000; break; - case NVDEV_ENGINE_MPEG : - case NVDEV_ENGINE_MSPPP : context = 0x00200000; break; - case NVDEV_ENGINE_ME : - case NVDEV_ENGINE_CE0 : context = 0x00300000; break; - case NVDEV_ENGINE_VP : - case NVDEV_ENGINE_MSPDEC: context = 0x00400000; break; - case NVDEV_ENGINE_CIPHER: - case NVDEV_ENGINE_SEC : - case NVDEV_ENGINE_VIC : context = 0x00500000; break; - case NVDEV_ENGINE_BSP : - case NVDEV_ENGINE_MSVLD : context = 0x00600000; break; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : context = 0x00000000; break; + case NVKM_ENGINE_GR : context = 0x00100000; break; + case NVKM_ENGINE_MPEG : + case NVKM_ENGINE_MSPPP : context = 0x00200000; break; + case NVKM_ENGINE_ME : + case NVKM_ENGINE_CE0 : context = 0x00300000; break; + case NVKM_ENGINE_VP : + case NVKM_ENGINE_MSPDEC: context = 0x00400000; break; + case NVKM_ENGINE_CIPHER: + case NVKM_ENGINE_SEC : + case NVKM_ENGINE_VIC : context = 0x00500000; break; + case NVKM_ENGINE_BSP : + case NVKM_ENGINE_MSVLD : context = 0x00600000; break; default: WARN_ON(1); return -EINVAL; @@ -243,20 +238,20 @@ g84_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push, ret = nvkm_fifo_chan_ctor(&g84_fifo_chan_func, &fifo->base, 0x10000, 0x1000, false, vm, push, - (1ULL << NVDEV_ENGINE_BSP) | - (1ULL << NVDEV_ENGINE_CE0) | - (1ULL << NVDEV_ENGINE_CIPHER) | - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_ME) | - (1ULL << NVDEV_ENGINE_MPEG) | - (1ULL << NVDEV_ENGINE_MSPDEC) | - (1ULL << NVDEV_ENGINE_MSPPP) | - (1ULL << NVDEV_ENGINE_MSVLD) | - (1ULL << NVDEV_ENGINE_SEC) | - (1ULL << NVDEV_ENGINE_SW) | - (1ULL << NVDEV_ENGINE_VIC) | - (1ULL << NVDEV_ENGINE_VP), + (1ULL << NVKM_ENGINE_BSP) | + (1ULL << NVKM_ENGINE_CE0) | + (1ULL << NVKM_ENGINE_CIPHER) | + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_ME) | + (1ULL << NVKM_ENGINE_MPEG) | + (1ULL << NVKM_ENGINE_MSPDEC) | + (1ULL << NVKM_ENGINE_MSPPP) | + (1ULL << NVKM_ENGINE_MSVLD) | + (1ULL << NVKM_ENGINE_SEC) | + (1ULL << NVKM_ENGINE_SW) | + (1ULL << NVKM_ENGINE_VIC) | + (1ULL << NVKM_ENGINE_VP), 0, 0xc00000, 0x2000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/changf100.h b/drm/nouveau/nvkm/engine/fifo/changf100.h index 413288597..7d697e2dc 100644 --- a/drm/nouveau/nvkm/engine/fifo/changf100.h +++ b/drm/nouveau/nvkm/engine/fifo/changf100.h @@ -17,7 +17,7 @@ struct gf100_fifo_chan { struct { struct nvkm_gpuobj *inst; struct nvkm_vma vma; - } engn[NVDEV_SUBDEV_NR]; + } engn[NVKM_SUBDEV_NR]; }; extern const struct nvkm_fifo_chan_oclass gf100_fifo_gpfifo_oclass; diff --git a/drm/nouveau/nvkm/engine/fifo/changk104.h b/drm/nouveau/nvkm/engine/fifo/changk104.h index 2b9d8bfc7..97bdddb76 100644 --- a/drm/nouveau/nvkm/engine/fifo/changk104.h +++ b/drm/nouveau/nvkm/engine/fifo/changk104.h @@ -18,7 +18,7 @@ struct gk104_fifo_chan { struct { struct nvkm_gpuobj *inst; struct nvkm_vma vma; - } engn[NVDEV_SUBDEV_NR]; + } engn[NVKM_SUBDEV_NR]; }; int gk104_fifo_gpfifo_new(struct nvkm_fifo *, const struct nvkm_oclass *, diff --git a/drm/nouveau/nvkm/engine/fifo/channv04.h b/drm/nouveau/nvkm/engine/fifo/channv04.h index ac62a6404..3361a1fd0 100644 --- a/drm/nouveau/nvkm/engine/fifo/channv04.h +++ b/drm/nouveau/nvkm/engine/fifo/channv04.h @@ -8,7 +8,7 @@ struct nv04_fifo_chan { struct nvkm_fifo_chan base; struct nv04_fifo *fifo; u32 ramfc; - struct nvkm_gpuobj *engn[NVDEV_SUBDEV_NR]; + struct nvkm_gpuobj *engn[NVKM_SUBDEV_NR]; }; extern const struct nvkm_fifo_chan_func nv04_fifo_dma_func; diff --git a/drm/nouveau/nvkm/engine/fifo/channv50.c b/drm/nouveau/nvkm/engine/fifo/channv50.c index 2a25019ce..25b60aff4 100644 --- a/drm/nouveau/nvkm/engine/fifo/channv50.c +++ b/drm/nouveau/nvkm/engine/fifo/channv50.c @@ -32,10 +32,10 @@ static int nv50_fifo_chan_engine_addr(struct nvkm_engine *engine) { switch (engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : return -1; - case NVDEV_ENGINE_GR : return 0x0000; - case NVDEV_ENGINE_MPEG : return 0x0060; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : return -1; + case NVKM_ENGINE_GR : return 0x0000; + case NVKM_ENGINE_MPEG : return 0x0060; default: WARN_ON(1); return -1; @@ -130,11 +130,6 @@ nv50_fifo_chan_engine_dtor(struct nvkm_fifo_chan *base, struct nvkm_engine *engine) { struct nv50_fifo_chan *chan = nv50_fifo_chan(base); - if (!chan->engn[engine->subdev.index] || - chan->engn[engine->subdev.index]->object.oclass) { - chan->engn[engine->subdev.index] = NULL; - return; - } nvkm_gpuobj_del(&chan->engn[engine->subdev.index]); } @@ -149,11 +144,6 @@ nv50_fifo_chan_engine_ctor(struct nvkm_fifo_chan *base, if (nv50_fifo_chan_engine_addr(engine) < 0) return 0; - if (nv_iclass(object, NV_GPUOBJ_CLASS)) { - chan->engn[engn] = nv_gpuobj(object); - return 0; - } - return nvkm_object_bind(object, NULL, 0, &chan->engn[engn]); } @@ -173,10 +163,10 @@ nv50_fifo_chan_object_ctor(struct nvkm_fifo_chan *base, u32 context; switch (object->engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : context = 0x00000000; break; - case NVDEV_ENGINE_GR : context = 0x00100000; break; - case NVDEV_ENGINE_MPEG : context = 0x00200000; break; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : context = 0x00000000; break; + case NVKM_ENGINE_GR : context = 0x00100000; break; + case NVKM_ENGINE_MPEG : context = 0x00200000; break; default: WARN_ON(1); return -EINVAL; @@ -248,10 +238,10 @@ nv50_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push, ret = nvkm_fifo_chan_ctor(&nv50_fifo_chan_func, &fifo->base, 0x10000, 0x1000, false, vm, push, - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_SW) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_MPEG), + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_SW) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_MPEG), 0, 0xc00000, 0x2000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/channv50.h b/drm/nouveau/nvkm/engine/fifo/channv50.h index 7ef6bc2e2..4b9da469b 100644 --- a/drm/nouveau/nvkm/engine/fifo/channv50.h +++ b/drm/nouveau/nvkm/engine/fifo/channv50.h @@ -15,7 +15,7 @@ struct nv50_fifo_chan { struct nvkm_ramht *ramht; struct nvkm_vm *vm; - struct nvkm_gpuobj *engn[NVDEV_SUBDEV_NR]; + struct nvkm_gpuobj *engn[NVKM_SUBDEV_NR]; }; int nv50_fifo_chan_ctor(struct nv50_fifo *, u64 vm, u64 push, diff --git a/drm/nouveau/nvkm/engine/fifo/dmanv04.c b/drm/nouveau/nvkm/engine/fifo/dmanv04.c index 52cbc4b47..bfcc6408a 100644 --- a/drm/nouveau/nvkm/engine/fifo/dmanv04.c +++ b/drm/nouveau/nvkm/engine/fifo/dmanv04.c @@ -50,10 +50,10 @@ nv04_fifo_dma_object_ctor(struct nvkm_fifo_chan *base, int hash; switch (object->engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : context |= 0x00000000; break; - case NVDEV_ENGINE_GR : context |= 0x00010000; break; - case NVDEV_ENGINE_MPEG : context |= 0x00020000; break; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : context |= 0x00000000; break; + case NVKM_ENGINE_GR : context |= 0x00010000; break; + case NVKM_ENGINE_MPEG : context |= 0x00020000; break; default: WARN_ON(1); return -EINVAL; @@ -185,9 +185,9 @@ nv04_fifo_dma_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass, ret = nvkm_fifo_chan_ctor(&nv04_fifo_dma_func, &fifo->base, 0x1000, 0x1000, false, 0, args->v0.pushbuf, - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_SW), + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_SW), 0, 0x800000, 0x10000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/dmanv10.c b/drm/nouveau/nvkm/engine/fifo/dmanv10.c index d8e4d5570..34f68e5bd 100644 --- a/drm/nouveau/nvkm/engine/fifo/dmanv10.c +++ b/drm/nouveau/nvkm/engine/fifo/dmanv10.c @@ -61,9 +61,9 @@ nv10_fifo_dma_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass, ret = nvkm_fifo_chan_ctor(&nv04_fifo_dma_func, &fifo->base, 0x1000, 0x1000, false, 0, args->v0.pushbuf, - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_SW), + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_SW), 0, 0x800000, 0x10000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/dmanv17.c b/drm/nouveau/nvkm/engine/fifo/dmanv17.c index 1424dd9b6..ed7cc9f2b 100644 --- a/drm/nouveau/nvkm/engine/fifo/dmanv17.c +++ b/drm/nouveau/nvkm/engine/fifo/dmanv17.c @@ -61,10 +61,10 @@ nv17_fifo_dma_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass, ret = nvkm_fifo_chan_ctor(&nv04_fifo_dma_func, &fifo->base, 0x1000, 0x1000, false, 0, args->v0.pushbuf, - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_MPEG) | /* NV31- */ - (1ULL << NVDEV_ENGINE_SW), + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_MPEG) | /* NV31- */ + (1ULL << NVKM_ENGINE_SW), 0, 0x800000, 0x10000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/dmanv40.c b/drm/nouveau/nvkm/engine/fifo/dmanv40.c index b46a3b3cd..043b6c325 100644 --- a/drm/nouveau/nvkm/engine/fifo/dmanv40.c +++ b/drm/nouveau/nvkm/engine/fifo/dmanv40.c @@ -35,14 +35,14 @@ static bool nv40_fifo_dma_engine(struct nvkm_engine *engine, u32 *reg, u32 *ctx) { switch (engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW: + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW: return false; - case NVDEV_ENGINE_GR: + case NVKM_ENGINE_GR: *reg = 0x0032e0; *ctx = 0x38; return true; - case NVDEV_ENGINE_MPEG: + case NVKM_ENGINE_MPEG: *reg = 0x00330c; *ctx = 0x54; return true; @@ -118,11 +118,6 @@ nv40_fifo_dma_engine_dtor(struct nvkm_fifo_chan *base, struct nvkm_engine *engine) { struct nv04_fifo_chan *chan = nv04_fifo_chan(base); - if (!chan->engn[engine->subdev.index] || - chan->engn[engine->subdev.index]->object.oclass) { - chan->engn[engine->subdev.index] = NULL; - return; - } nvkm_gpuobj_del(&chan->engn[engine->subdev.index]); } @@ -138,11 +133,6 @@ nv40_fifo_dma_engine_ctor(struct nvkm_fifo_chan *base, if (!nv40_fifo_dma_engine(engine, ®, &ctx)) return 0; - if (nv_iclass(object, NV_GPUOBJ_CLASS)) { - chan->engn[engn] = nv_gpuobj(object); - return 0; - } - return nvkm_object_bind(object, NULL, 0, &chan->engn[engn]); } @@ -157,10 +147,10 @@ nv40_fifo_dma_object_ctor(struct nvkm_fifo_chan *base, int hash; switch (object->engine->subdev.index) { - case NVDEV_ENGINE_DMAOBJ: - case NVDEV_ENGINE_SW : context |= 0x00000000; break; - case NVDEV_ENGINE_GR : context |= 0x00100000; break; - case NVDEV_ENGINE_MPEG : context |= 0x00200000; break; + case NVKM_ENGINE_DMAOBJ: + case NVKM_ENGINE_SW : context |= 0x00000000; break; + case NVKM_ENGINE_GR : context |= 0x00100000; break; + case NVKM_ENGINE_MPEG : context |= 0x00200000; break; default: WARN_ON(1); return -EINVAL; @@ -216,10 +206,10 @@ nv40_fifo_dma_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass, ret = nvkm_fifo_chan_ctor(&nv40_fifo_dma_func, &fifo->base, 0x1000, 0x1000, false, 0, args->v0.pushbuf, - (1ULL << NVDEV_ENGINE_DMAOBJ) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_MPEG) | - (1ULL << NVDEV_ENGINE_SW), + (1ULL << NVKM_ENGINE_DMAOBJ) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_MPEG) | + (1ULL << NVKM_ENGINE_SW), 0, 0xc00000, 0x1000, oclass, &chan->base); chan->fifo = fifo; if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/gf100.c b/drm/nouveau/nvkm/engine/fifo/gf100.c index bc094223f..172f24301 100644 --- a/drm/nouveau/nvkm/engine/fifo/gf100.c +++ b/drm/nouveau/nvkm/engine/fifo/gf100.c @@ -82,12 +82,12 @@ static inline int gf100_fifo_engidx(struct gf100_fifo *fifo, u32 engn) { switch (engn) { - case NVDEV_ENGINE_GR : engn = 0; break; - case NVDEV_ENGINE_MSVLD : engn = 1; break; - case NVDEV_ENGINE_MSPPP : engn = 2; break; - case NVDEV_ENGINE_MSPDEC: engn = 3; break; - case NVDEV_ENGINE_CE0 : engn = 4; break; - case NVDEV_ENGINE_CE1 : engn = 5; break; + case NVKM_ENGINE_GR : engn = 0; break; + case NVKM_ENGINE_MSVLD : engn = 1; break; + case NVKM_ENGINE_MSPPP : engn = 2; break; + case NVKM_ENGINE_MSPDEC: engn = 3; break; + case NVKM_ENGINE_CE0 : engn = 4; break; + case NVKM_ENGINE_CE1 : engn = 5; break; default: return -1; } @@ -101,12 +101,12 @@ gf100_fifo_engine(struct gf100_fifo *fifo, u32 engn) struct nvkm_device *device = fifo->base.engine.subdev.device; switch (engn) { - case 0: engn = NVDEV_ENGINE_GR; break; - case 1: engn = NVDEV_ENGINE_MSVLD; break; - case 2: engn = NVDEV_ENGINE_MSPPP; break; - case 3: engn = NVDEV_ENGINE_MSPDEC; break; - case 4: engn = NVDEV_ENGINE_CE0; break; - case 5: engn = NVDEV_ENGINE_CE1; break; + case 0: engn = NVKM_ENGINE_GR; break; + case 1: engn = NVKM_ENGINE_MSVLD; break; + case 2: engn = NVKM_ENGINE_MSPPP; break; + case 3: engn = NVKM_ENGINE_MSPDEC; break; + case 4: engn = NVKM_ENGINE_CE0; break; + case 5: engn = NVKM_ENGINE_CE1; break; default: return NULL; } @@ -229,17 +229,17 @@ gf100_fifo_intr_sched(struct gf100_fifo *fifo) static const struct nvkm_enum gf100_fifo_fault_engine[] = { - { 0x00, "PGRAPH", NULL, NVDEV_ENGINE_GR }, - { 0x03, "PEEPHOLE", NULL, NVDEV_ENGINE_IFB }, - { 0x04, "BAR1", NULL, NVDEV_SUBDEV_BAR }, - { 0x05, "BAR3", NULL, NVDEV_SUBDEV_INSTMEM }, - { 0x07, "PFIFO", NULL, NVDEV_ENGINE_FIFO }, - { 0x10, "PMSVLD", NULL, NVDEV_ENGINE_MSVLD }, - { 0x11, "PMSPPP", NULL, NVDEV_ENGINE_MSPPP }, + { 0x00, "PGRAPH", NULL, NVKM_ENGINE_GR }, + { 0x03, "PEEPHOLE", NULL, NVKM_ENGINE_IFB }, + { 0x04, "BAR1", NULL, NVKM_SUBDEV_BAR }, + { 0x05, "BAR3", NULL, NVKM_SUBDEV_INSTMEM }, + { 0x07, "PFIFO", NULL, NVKM_ENGINE_FIFO }, + { 0x10, "PMSVLD", NULL, NVKM_ENGINE_MSVLD }, + { 0x11, "PMSPPP", NULL, NVKM_ENGINE_MSPPP }, { 0x13, "PCOUNTER" }, - { 0x14, "PMSPDEC", NULL, NVDEV_ENGINE_MSPDEC }, - { 0x15, "PCE0", NULL, NVDEV_ENGINE_CE0 }, - { 0x16, "PCE1", NULL, NVDEV_ENGINE_CE1 }, + { 0x14, "PMSPDEC", NULL, NVKM_ENGINE_MSPDEC }, + { 0x15, "PCE0", NULL, NVKM_ENGINE_CE0 }, + { 0x16, "PCE1", NULL, NVKM_ENGINE_CE1 }, { 0x17, "PDAEMON" }, {} }; @@ -317,13 +317,13 @@ gf100_fifo_intr_fault(struct gf100_fifo *fifo, int unit) if (eu) { switch (eu->data2) { - case NVDEV_SUBDEV_BAR: + case NVKM_SUBDEV_BAR: nvkm_mask(device, 0x001704, 0x00000000, 0x00000000); break; - case NVDEV_SUBDEV_INSTMEM: + case NVKM_SUBDEV_INSTMEM: nvkm_mask(device, 0x001714, 0x00000000, 0x00000000); break; - case NVDEV_ENGINE_IFB: + case NVKM_ENGINE_IFB: nvkm_mask(device, 0x001718, 0x00000000, 0x00000000); break; default: diff --git a/drm/nouveau/nvkm/engine/fifo/gk104.c b/drm/nouveau/nvkm/engine/fifo/gk104.c index 465b52dee..fc0ff2d37 100644 --- a/drm/nouveau/nvkm/engine/fifo/gk104.c +++ b/drm/nouveau/nvkm/engine/fifo/gk104.c @@ -248,22 +248,22 @@ gk104_fifo_intr_dropped_fault(struct gk104_fifo *fifo) static const struct nvkm_enum gk104_fifo_fault_engine[] = { - { 0x00, "GR", NULL, NVDEV_ENGINE_GR }, - { 0x03, "IFB", NULL, NVDEV_ENGINE_IFB }, - { 0x04, "BAR1", NULL, NVDEV_SUBDEV_BAR }, - { 0x05, "BAR3", NULL, NVDEV_SUBDEV_INSTMEM }, - { 0x07, "PBDMA0", NULL, NVDEV_ENGINE_FIFO }, - { 0x08, "PBDMA1", NULL, NVDEV_ENGINE_FIFO }, - { 0x09, "PBDMA2", NULL, NVDEV_ENGINE_FIFO }, - { 0x10, "MSVLD", NULL, NVDEV_ENGINE_MSVLD }, - { 0x11, "MSPPP", NULL, NVDEV_ENGINE_MSPPP }, + { 0x00, "GR", NULL, NVKM_ENGINE_GR }, + { 0x03, "IFB", NULL, NVKM_ENGINE_IFB }, + { 0x04, "BAR1", NULL, NVKM_SUBDEV_BAR }, + { 0x05, "BAR3", NULL, NVKM_SUBDEV_INSTMEM }, + { 0x07, "PBDMA0", NULL, NVKM_ENGINE_FIFO }, + { 0x08, "PBDMA1", NULL, NVKM_ENGINE_FIFO }, + { 0x09, "PBDMA2", NULL, NVKM_ENGINE_FIFO }, + { 0x10, "MSVLD", NULL, NVKM_ENGINE_MSVLD }, + { 0x11, "MSPPP", NULL, NVKM_ENGINE_MSPPP }, { 0x13, "PERF" }, - { 0x14, "MSPDEC", NULL, NVDEV_ENGINE_MSPDEC }, - { 0x15, "CE0", NULL, NVDEV_ENGINE_CE0 }, - { 0x16, "CE1", NULL, NVDEV_ENGINE_CE1 }, + { 0x14, "MSPDEC", NULL, NVKM_ENGINE_MSPDEC }, + { 0x15, "CE0", NULL, NVKM_ENGINE_CE0 }, + { 0x16, "CE1", NULL, NVKM_ENGINE_CE1 }, { 0x17, "PMU" }, - { 0x19, "MSENC", NULL, NVDEV_ENGINE_MSENC }, - { 0x1b, "CE2", NULL, NVDEV_ENGINE_CE2 }, + { 0x19, "MSENC", NULL, NVKM_ENGINE_MSENC }, + { 0x1b, "CE2", NULL, NVKM_ENGINE_CE2 }, {} }; @@ -382,13 +382,13 @@ gk104_fifo_intr_fault(struct gk104_fifo *fifo, int unit) if (eu) { switch (eu->data2) { - case NVDEV_SUBDEV_BAR: + case NVKM_SUBDEV_BAR: nvkm_mask(device, 0x001704, 0x00000000, 0x00000000); break; - case NVDEV_SUBDEV_INSTMEM: + case NVKM_SUBDEV_INSTMEM: nvkm_mask(device, 0x001714, 0x00000000, 0x00000000); break; - case NVDEV_ENGINE_IFB: + case NVKM_ENGINE_IFB: nvkm_mask(device, 0x001718, 0x00000000, 0x00000000); break; default: diff --git a/drm/nouveau/nvkm/engine/fifo/gk104.h b/drm/nouveau/nvkm/engine/fifo/gk104.h index 7a5c544a5..5afd9b5ec 100644 --- a/drm/nouveau/nvkm/engine/fifo/gk104.h +++ b/drm/nouveau/nvkm/engine/fifo/gk104.h @@ -41,15 +41,15 @@ static inline u64 gk104_fifo_engine_subdev(int engine) { switch (engine) { - case 0: return (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_SW) | - (1ULL << NVDEV_ENGINE_CE2); - case 1: return (1ULL << NVDEV_ENGINE_MSPDEC); - case 2: return (1ULL << NVDEV_ENGINE_MSPPP); - case 3: return (1ULL << NVDEV_ENGINE_MSVLD); - case 4: return (1ULL << NVDEV_ENGINE_CE0); - case 5: return (1ULL << NVDEV_ENGINE_CE1); - case 6: return (1ULL << NVDEV_ENGINE_MSENC); + case 0: return (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_SW) | + (1ULL << NVKM_ENGINE_CE2); + case 1: return (1ULL << NVKM_ENGINE_MSPDEC); + case 2: return (1ULL << NVKM_ENGINE_MSPPP); + case 3: return (1ULL << NVKM_ENGINE_MSVLD); + case 4: return (1ULL << NVKM_ENGINE_CE0); + case 5: return (1ULL << NVKM_ENGINE_CE1); + case 6: return (1ULL << NVKM_ENGINE_MSENC); default: WARN_ON(1); return 0; @@ -60,15 +60,15 @@ static inline int gk104_fifo_subdev_engine(int subdev) { switch (subdev) { - case NVDEV_ENGINE_GR: - case NVDEV_ENGINE_SW: - case NVDEV_ENGINE_CE2 : return 0; - case NVDEV_ENGINE_MSPDEC: return 1; - case NVDEV_ENGINE_MSPPP : return 2; - case NVDEV_ENGINE_MSVLD : return 3; - case NVDEV_ENGINE_CE0 : return 4; - case NVDEV_ENGINE_CE1 : return 5; - case NVDEV_ENGINE_MSENC : return 6; + case NVKM_ENGINE_GR: + case NVKM_ENGINE_SW: + case NVKM_ENGINE_CE2 : return 0; + case NVKM_ENGINE_MSPDEC: return 1; + case NVKM_ENGINE_MSPPP : return 2; + case NVKM_ENGINE_MSVLD : return 3; + case NVKM_ENGINE_CE0 : return 4; + case NVKM_ENGINE_CE1 : return 5; + case NVKM_ENGINE_MSENC : return 6; default: WARN_ON(1); return 0; diff --git a/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c b/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c index 5d76c3013..e7cbc139c 100644 --- a/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c +++ b/drm/nouveau/nvkm/engine/fifo/gpfifogf100.c @@ -35,13 +35,13 @@ static u32 gf100_fifo_gpfifo_engine_addr(struct nvkm_engine *engine) { switch (engine->subdev.index) { - case NVDEV_ENGINE_SW : return 0; - case NVDEV_ENGINE_GR : return 0x0210; - case NVDEV_ENGINE_CE0 : return 0x0230; - case NVDEV_ENGINE_CE1 : return 0x0240; - case NVDEV_ENGINE_MSPDEC: return 0x0250; - case NVDEV_ENGINE_MSPPP : return 0x0260; - case NVDEV_ENGINE_MSVLD : return 0x0270; + case NVKM_ENGINE_SW : return 0; + case NVKM_ENGINE_GR : return 0x0210; + case NVKM_ENGINE_CE0 : return 0x0230; + case NVKM_ENGINE_CE1 : return 0x0240; + case NVKM_ENGINE_MSPDEC: return 0x0250; + case NVKM_ENGINE_MSPPP : return 0x0260; + case NVKM_ENGINE_MSVLD : return 0x0270; default: WARN_ON(1); return 0; @@ -121,12 +121,6 @@ gf100_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base, if (!gf100_fifo_gpfifo_engine_addr(engine)) return 0; - if (object->oclass) { - return nvkm_gpuobj_map(nv_gpuobj(object), chan->vm, - NV_MEM_ACCESS_RW, - &chan->engn[engn].vma); - } - ret = nvkm_object_bind(object, NULL, 0, &chan->engn[engn].inst); if (ret) return ret; @@ -225,13 +219,13 @@ gf100_fifo_gpfifo_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass, ret = nvkm_fifo_chan_ctor(&gf100_fifo_gpfifo_func, &fifo->base, 0x1000, 0x1000, true, args->v0.vm, 0, - (1ULL << NVDEV_ENGINE_CE0) | - (1ULL << NVDEV_ENGINE_CE1) | - (1ULL << NVDEV_ENGINE_GR) | - (1ULL << NVDEV_ENGINE_MSPDEC) | - (1ULL << NVDEV_ENGINE_MSPPP) | - (1ULL << NVDEV_ENGINE_MSVLD) | - (1ULL << NVDEV_ENGINE_SW), + (1ULL << NVKM_ENGINE_CE0) | + (1ULL << NVKM_ENGINE_CE1) | + (1ULL << NVKM_ENGINE_GR) | + (1ULL << NVKM_ENGINE_MSPDEC) | + (1ULL << NVKM_ENGINE_MSPPP) | + (1ULL << NVKM_ENGINE_MSVLD) | + (1ULL << NVKM_ENGINE_SW), 1, fifo->user.bar.offset, 0x1000, oclass, &chan->base); if (ret) diff --git a/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c b/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c index fe3998191..0b817540a 100644 --- a/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c +++ b/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c @@ -57,14 +57,14 @@ static u32 gk104_fifo_gpfifo_engine_addr(struct nvkm_engine *engine) { switch (engine->subdev.index) { - case NVDEV_ENGINE_SW : - case NVDEV_ENGINE_CE0 : - case NVDEV_ENGINE_CE1 : - case NVDEV_ENGINE_CE2 : return 0x0000; - case NVDEV_ENGINE_GR : return 0x0210; - case NVDEV_ENGINE_MSPDEC: return 0x0250; - case NVDEV_ENGINE_MSPPP : return 0x0260; - case NVDEV_ENGINE_MSVLD : return 0x0270; + case NVKM_ENGINE_SW : + case NVKM_ENGINE_CE0 : + case NVKM_ENGINE_CE1 : + case NVKM_ENGINE_CE2 : return 0x0000; + case NVKM_ENGINE_GR : return 0x0210; + case NVKM_ENGINE_MSPDEC: return 0x0250; + case NVKM_ENGINE_MSPPP : return 0x0260; + case NVKM_ENGINE_MSVLD : return 0x0270; default: WARN_ON(1); return 0; @@ -134,12 +134,6 @@ gk104_fifo_gpfifo_engine_ctor(struct nvkm_fifo_chan *base, if (!gk104_fifo_gpfifo_engine_addr(engine)) return 0; - if (object->oclass) { - return nvkm_gpuobj_map(nv_gpuobj(object), chan->vm, - NV_MEM_ACCESS_RW, - &chan->engn[engn].vma); - } - ret = nvkm_object_bind(object, NULL, 0, &chan->engn[engn].inst); if (ret) return ret; |