drm/nouveau/fifo/gk104-: return channel instance in ctor args
authorBen Skeggs <bskeggs@redhat.com>
Tue, 11 Dec 2018 04:50:02 +0000 (14:50 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 11 Dec 2018 05:37:47 +0000 (15:37 +1000)
Will be used to match fault buffer entries with a channel.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvif/cla06f.h
drivers/gpu/drm/nouveau/nouveau_chan.c
drivers/gpu/drm/nouveau/nouveau_chan.h
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogk104.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/gpfifogv100.c

index fbfcffc5feb2b4440572a317ed2ae41aff4bd2fe..e588cc720299b2d10fab779c570fe367e1853024 100644 (file)
@@ -10,6 +10,7 @@ struct kepler_channel_gpfifo_a_v0 {
        __u64 ioffset;
        __u64 runlist;
        __u64 vmm;
+       __u64 inst;
 };
 
 #define NVA06F_V0_NTFY_NON_STALL_INTERRUPT                                 0x00
index 92d3115f96b5090889281c62edf219bbdb64dd66..a154978d74ef50846ee2be7c7db47a6e31a68eac 100644 (file)
@@ -273,13 +273,15 @@ nouveau_channel_ind(struct nouveau_drm *drm, struct nvif_device *device,
                ret = nvif_object_init(&device->object, 0, *oclass++,
                                       &args, size, &chan->user);
                if (ret == 0) {
-                       if (chan->user.oclass >= KEPLER_CHANNEL_GPFIFO_A)
+                       if (chan->user.oclass >= KEPLER_CHANNEL_GPFIFO_A) {
                                chan->chid = args.kepler.chid;
-                       else
-                       if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO)
+                               chan->inst = args.kepler.inst;
+                       } else
+                       if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO) {
                                chan->chid = args.fermi.chid;
-                       else
+                       } else {
                                chan->chid = args.nv50.chid;
+                       }
                        return ret;
                }
        } while (*oclass);
index 64454c2ebd908ce82a1b6886ee376dd37d71d489..93d065d4a2a19ea7305a4c1fd03c89b37473d7b0 100644 (file)
@@ -10,6 +10,7 @@ struct nouveau_channel {
        struct nouveau_drm *drm;
 
        int chid;
+       u64 inst;
 
        struct nvif_object vram;
        struct nvif_object gart;
index 9875574589d752f0495fa8d47ad6d7cc05a71318..523f8a09c52abb2da45b9d7186a84882bc9b1709 100644 (file)
@@ -240,7 +240,7 @@ gk104_fifo_gpfifo_func = {
 
 static int
 gk104_fifo_gpfifo_new_(struct gk104_fifo *fifo, u64 *runlists, u16 *chid,
-                      u64 vmm, u64 ioffset, u64 ilength,
+                      u64 vmm, u64 ioffset, u64 ilength, u64 *inst,
                       const struct nvkm_oclass *oclass,
                       struct nvkm_object **pobject)
 {
@@ -279,6 +279,7 @@ gk104_fifo_gpfifo_new_(struct gk104_fifo *fifo, u64 *runlists, u16 *chid,
                return ret;
 
        *chid = chan->base.chid;
+       *inst = chan->base.inst->addr;
 
        /* Hack to support GPUs where even individual channels should be
         * part of a channel group.
@@ -346,6 +347,7 @@ gk104_fifo_gpfifo_new(struct gk104_fifo *fifo, const struct nvkm_oclass *oclass,
                                               args->v0.vmm,
                                               args->v0.ioffset,
                                               args->v0.ilength,
+                                             &args->v0.inst,
                                              oclass, pobject);
        }
 
index 9598853ced56244285591c732bcd0cd4e44e0c4a..97c3af3de9000dbd07ccd2ccfe6d548d899d9db6 100644 (file)
@@ -114,7 +114,7 @@ gv100_fifo_gpfifo_func = {
 
 static int
 gv100_fifo_gpfifo_new_(struct gk104_fifo *fifo, u64 *runlists, u16 *chid,
-                      u64 vmm, u64 ioffset, u64 ilength,
+                      u64 vmm, u64 ioffset, u64 ilength, u64 *inst,
                       const struct nvkm_oclass *oclass,
                       struct nvkm_object **pobject)
 {
@@ -150,6 +150,7 @@ gv100_fifo_gpfifo_new_(struct gk104_fifo *fifo, u64 *runlists, u16 *chid,
                return ret;
 
        *chid = chan->base.chid;
+       *inst = chan->base.inst->addr;
 
        /* Hack to support GPUs where even individual channels should be
         * part of a channel group.
@@ -218,6 +219,7 @@ gv100_fifo_gpfifo_new(struct gk104_fifo *fifo, const struct nvkm_oclass *oclass,
                                               args->v0.vmm,
                                               args->v0.ioffset,
                                               args->v0.ilength,
+                                             &args->v0.inst,
                                              oclass, pobject);
        }