aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:18 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:40:39 +1000
commit6157091177102638c7d94ffc159c0b157a1c9b56 (patch)
tree7fb03c21a5db1bc156d3634ede7f1d45fb00f176 /drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
parent590801c1a3b19883b0d0e4c60241cbed8a916d47 (diff)
drm/nouveau/sw: remove dependence on namedb/engctx lookup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
index 39031841d057..7f05985ebb37 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
@@ -31,6 +31,7 @@
#include <subdev/fb.h>
#include <subdev/mmu.h>
#include <subdev/timer.h>
+#include <engine/sw.h>
#include <nvif/class.h>
#include <nvif/ioctl.h>
@@ -474,32 +475,6 @@ gf100_fifo_recover(struct gf100_fifo *fifo, struct nvkm_engine *engine,
schedule_work(&fifo->fault);
}
-static int
-gf100_fifo_swmthd(struct gf100_fifo *fifo, u32 chid, u32 mthd, u32 data)
-{
- struct gf100_fifo_chan *chan = NULL;
- struct nvkm_handle *bind;
- unsigned long flags;
- int ret = -EINVAL;
-
- spin_lock_irqsave(&fifo->base.lock, flags);
- if (likely(chid >= fifo->base.min && chid <= fifo->base.max))
- chan = (void *)fifo->base.channel[chid];
- if (unlikely(!chan))
- goto out;
-
- bind = nvkm_namedb_get_class(nv_namedb(chan), NVIF_IOCTL_NEW_V0_SW_GF100);
- if (likely(bind)) {
- if (!mthd || !nv_call(bind->object, mthd, data))
- ret = 0;
- nvkm_namedb_put(bind);
- }
-
-out:
- spin_unlock_irqrestore(&fifo->base.lock, flags);
- return ret;
-}
-
static const struct nvkm_enum
gf100_fifo_sched_reason[] = {
{ 0x0a, "CTXSW_TIMEOUT" },
@@ -701,8 +676,10 @@ gf100_fifo_intr_pbdma(struct gf100_fifo *fifo, int unit)
char msg[128];
if (stat & 0x00800000) {
- if (!gf100_fifo_swmthd(fifo, chid, mthd, data))
- show &= ~0x00800000;
+ if (device->sw) {
+ if (nvkm_sw_mthd(device->sw, chid, subc, mthd, data))
+ show &= ~0x00800000;
+ }
}
if (show) {