diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 04:54:16 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 02:40:33 (GMT) |
commit | 159045cdc460794df27e2cc624a9641be5c54b23 (patch) | |
tree | 8ba746b0bc4915e9dcee5c2253c443b03680b491 /drivers/gpu/drm/nouveau/nvkm/engine | |
parent | 22827fa42b0baa9287ea56691f26dc45fecea049 (diff) | |
download | linux-159045cdc460794df27e2cc624a9641be5c54b23.tar.xz |
drm/nouveau/nvif: replace pushbuf with vm in fermi/kepler gpfifo class args
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 34 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv10.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv17.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c | 6 |
9 files changed, 43 insertions, 31 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index 73b8ab4..f937d70 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -76,23 +76,25 @@ nvkm_fifo_channel_create_(struct nvkm_object *parent, return ret; /* validate dma object representing push buffer */ - handle = nvkm_client_search(client, pushbuf); - if (!handle) - return -ENOENT; - dmaobj = (void *)handle->object; - - dmaeng = (void *)dmaobj->base.engine; - switch (dmaobj->base.oclass->handle) { - case NV_DMA_FROM_MEMORY: - case NV_DMA_IN_MEMORY: - break; - default: - return -EINVAL; - } + if (pushbuf) { + handle = nvkm_client_search(client, pushbuf); + if (!handle) + return -ENOENT; + dmaobj = (void *)handle->object; + + dmaeng = (void *)dmaobj->base.engine; + switch (dmaobj->base.oclass->handle) { + case NV_DMA_FROM_MEMORY: + case NV_DMA_IN_MEMORY: + break; + default: + return -EINVAL; + } - ret = dmaeng->bind(dmaobj, parent, &chan->pushgpu); - if (ret) - return ret; + ret = dmaeng->bind(dmaobj, parent, &chan->pushgpu); + if (ret) + return ret; + } /* find a free fifo channel */ spin_lock_irqsave(&fifo->lock, flags); diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c index 575329d..64523d7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/g84.c @@ -173,7 +173,7 @@ g84_fifo_chan_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_object **pobject) { union { - struct nv03_channel_dma_v0 v0; + struct nv50_channel_dma_v0 v0; } *args = data; struct nvkm_bar *bar = nvkm_bar(parent); struct nv50_fifo_base *base = (void *)parent; @@ -185,6 +185,8 @@ g84_fifo_chan_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine, nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " "offset %016llx\n", args->v0.version, args->v0.pushbuf, args->v0.offset); + if (args->v0.vm) + return -ENOENT; } else return ret; @@ -262,6 +264,8 @@ g84_fifo_chan_ctor_ind(struct nvkm_object *parent, struct nvkm_object *engine, "ioffset %016llx ilength %08x\n", args->v0.version, args->v0.pushbuf, args->v0.ioffset, args->v0.ilength); + if (args->v0.vm) + return -ENOENT; } else return ret; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c index cdb25b5..1fa3822 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c @@ -199,7 +199,7 @@ gf100_fifo_chan_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_object **pobject) { union { - struct nv50_channel_gpfifo_v0 v0; + struct fermi_channel_gpfifo_v0 v0; } *args = data; struct nvkm_bar *bar = nvkm_bar(parent); struct gf100_fifo *fifo = (void *)engine; @@ -211,16 +211,17 @@ gf100_fifo_chan_ctor(struct nvkm_object *parent, struct nvkm_object *engine, nvif_ioctl(parent, "create channel gpfifo size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { - nvif_ioctl(parent, "create channel gpfifo vers %d pushbuf %llx " + nvif_ioctl(parent, "create channel gpfifo vers %d " "ioffset %016llx ilength %08x\n", - args->v0.version, args->v0.pushbuf, args->v0.ioffset, + args->v0.version, args->v0.ioffset, args->v0.ilength); + if (args->v0.vm) + return -ENOENT; } else return ret; ret = nvkm_fifo_channel_create(parent, engine, oclass, 1, - fifo->user.bar.offset, 0x1000, - args->v0.pushbuf, + fifo->user.bar.offset, 0x1000, 0, (1ULL << NVDEV_ENGINE_SW) | (1ULL << NVDEV_ENGINE_GR) | (1ULL << NVDEV_ENGINE_CE0) | diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c index bdd0b00..48b526c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c @@ -252,10 +252,12 @@ gk104_fifo_chan_ctor(struct nvkm_object *parent, struct nvkm_object *engine, nvif_ioctl(parent, "create channel gpfifo size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { - nvif_ioctl(parent, "create channel gpfifo vers %d pushbuf %llx " + nvif_ioctl(parent, "create channel gpfifo vers %d " "ioffset %016llx ilength %08x engine %08x\n", - args->v0.version, args->v0.pushbuf, args->v0.ioffset, + args->v0.version, args->v0.ioffset, args->v0.ilength, args->v0.engine); + if (args->v0.vm) + return -ENOENT; } else return ret; @@ -282,8 +284,7 @@ gk104_fifo_chan_ctor(struct nvkm_object *parent, struct nvkm_object *engine, i = __ffs(engines); ret = nvkm_fifo_channel_create(parent, engine, oclass, 1, - fifo->user.bar.offset, 0x200, - args->v0.pushbuf, + fifo->user.bar.offset, 0x200, 0, fifo_engine[i].mask, &chan); *pobject = nv_object(chan); if (ret) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c index 6458fa0..51b8fce 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.c @@ -121,7 +121,7 @@ nv04_fifo_chan_ctor(struct nvkm_object *parent, nvif_ioctl(parent, "create channel dma size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " - "offset %016llx\n", args->v0.version, + "offset %08x\n", args->v0.version, args->v0.pushbuf, args->v0.offset); } else return ret; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv10.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv10.c index c4b5a30..046acc2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv10.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv10.c @@ -65,7 +65,7 @@ nv10_fifo_chan_ctor(struct nvkm_object *parent, nvif_ioctl(parent, "create channel dma size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " - "offset %016llx\n", args->v0.version, + "offset %08x\n", args->v0.version, args->v0.pushbuf, args->v0.offset); } else return ret; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv17.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv17.c index ece2715..7be6fea 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv17.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv17.c @@ -70,7 +70,7 @@ nv17_fifo_chan_ctor(struct nvkm_object *parent, nvif_ioctl(parent, "create channel dma size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " - "offset %016llx\n", args->v0.version, + "offset %08x\n", args->v0.version, args->v0.pushbuf, args->v0.offset); } else return ret; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c index a42218a..cad4b4b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv40.c @@ -193,7 +193,7 @@ nv40_fifo_chan_ctor(struct nvkm_object *parent, struct nvkm_object *engine, nvif_ioctl(parent, "create channel dma size %d\n", size); if (nvif_unpack(args->v0, 0, 0, false)) { nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " - "offset %016llx\n", args->v0.version, + "offset %08x\n", args->v0.version, args->v0.pushbuf, args->v0.offset); } else return ret; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c index 1a7ca8e..402639c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.c @@ -203,7 +203,7 @@ nv50_fifo_chan_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_object **pobject) { union { - struct nv03_channel_dma_v0 v0; + struct nv50_channel_dma_v0 v0; } *args = data; struct nvkm_bar *bar = nvkm_bar(parent); struct nv50_fifo_base *base = (void *)parent; @@ -215,6 +215,8 @@ nv50_fifo_chan_ctor_dma(struct nvkm_object *parent, struct nvkm_object *engine, nvif_ioctl(parent, "create channel dma vers %d pushbuf %llx " "offset %016llx\n", args->v0.version, args->v0.pushbuf, args->v0.offset); + if (args->v0.vm) + return -ENOENT; } else return ret; @@ -280,6 +282,8 @@ nv50_fifo_chan_ctor_ind(struct nvkm_object *parent, struct nvkm_object *engine, "ioffset %016llx ilength %08x\n", args->v0.version, args->v0.pushbuf, args->v0.ioffset, args->v0.ilength); + if (args->v0.vm) + return -ENOENT; } else return ret; |