]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.c
drm/nouveau/sw: remove dependence on namedb/engctx lookup
[mirror_ubuntu-jammy-kernel.git] / drivers / gpu / drm / nouveau / nvkm / engine / fifo / gf100.c
index 39031841d057c6f20253b6b71555a6a8f5a302cd..7f05985ebb377cc881a22cb2eb938c8d367e850b 100644 (file)
@@ -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) {