drm/nouveau/fifo: add an api for initiating channel recovery
authorBen Skeggs <bskeggs@redhat.com>
Thu, 26 Jan 2017 02:10:24 +0000 (12:10 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 07:38:12 +0000 (17:38 +1000)
This will be used by callers outside of fifo interrupt handlers.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h

index 3567c9920a37008d6649a9d35993272d5b55e71d..23f50f1ed7a25ae22515be766b507c5d0deb34e2 100644 (file)
 #include <nvif/event.h>
 #include <nvif/unpack.h>
 
+void
+nvkm_fifo_recover_chan(struct nvkm_fifo *fifo, int chid)
+{
+       unsigned long flags;
+       if (WARN_ON(!fifo->func->recover_chan))
+               return;
+       spin_lock_irqsave(&fifo->lock, flags);
+       fifo->func->recover_chan(fifo, chid);
+       spin_unlock_irqrestore(&fifo->lock, flags);
+}
+
 void
 nvkm_fifo_pause(struct nvkm_fifo *fifo, unsigned long *flags)
 {
index 1fc9d8bf12f2c18362b8fe80ad108439718b7afe..78136d947cbeffdc317f7743bee620958855823a 100644 (file)
@@ -8,6 +8,7 @@ int nvkm_fifo_ctor(const struct nvkm_fifo_func *, struct nvkm_device *,
 void nvkm_fifo_uevent(struct nvkm_fifo *);
 void nvkm_fifo_cevent(struct nvkm_fifo *);
 void nvkm_fifo_kevent(struct nvkm_fifo *, int chid);
+void nvkm_fifo_recover_chan(struct nvkm_fifo *, int chid);
 
 struct nvkm_fifo_chan_oclass;
 struct nvkm_fifo_func {
@@ -20,6 +21,7 @@ struct nvkm_fifo_func {
        void (*start)(struct nvkm_fifo *, unsigned long *);
        void (*uevent_init)(struct nvkm_fifo *);
        void (*uevent_fini)(struct nvkm_fifo *);
+       void (*recover_chan)(struct nvkm_fifo *, int chid);
        int (*class_get)(struct nvkm_fifo *, int index,
                         const struct nvkm_fifo_chan_oclass **);
        const struct nvkm_fifo_chan_oclass *chan[];