diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2022-06-01 20:48:13 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2022-11-09 10:45:12 +1000 |
commit | 9aa3faced0a3dea04294afe781e07e1ef1118e30 (patch) | |
tree | fe1188c5c9b01887f21d757c02bfaaf18e634c96 | |
parent | 1a34468855bdd0a8caef2fd6e8e23ecc25407bb2 (diff) | |
download | linux-9aa3faced0a3dea04294afe781e07e1ef1118e30.tar.bz2 |
drm/nouveau/gr/gf100-: switch to newer style interrupt handler
Ampere.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk104.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c | 4 |
4 files changed, 26 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index b9961d254749..6e31ba69ed4a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -1600,10 +1600,10 @@ gf100_gr_ctxctl_isr(struct gf100_gr *gr) } } -static void -gf100_gr_intr(struct nvkm_gr *base) +static irqreturn_t +gf100_gr_intr(struct nvkm_inth *inth) { - struct gf100_gr *gr = gf100_gr(base); + struct gf100_gr *gr = container_of(inth, typeof(*gr), base.engine.subdev.inth); struct nvkm_subdev *subdev = &gr->base.engine.subdev; struct nvkm_device *device = subdev->device; struct nvkm_chan *chan; @@ -1690,6 +1690,7 @@ gf100_gr_intr(struct nvkm_gr *base) nvkm_wr32(device, 0x400500, 0x00010001); nvkm_chan_put(&chan, flags); + return IRQ_HANDLED; } static void @@ -1985,8 +1986,15 @@ gf100_gr_oneinit(struct nvkm_gr *base) struct gf100_gr *gr = gf100_gr(base); struct nvkm_subdev *subdev = &gr->base.engine.subdev; struct nvkm_device *device = subdev->device; + struct nvkm_intr *intr = &device->mc->intr; + enum nvkm_intr_type intr_type = NVKM_INTR_SUBDEV; int ret, i, j; + ret = nvkm_inth_add(intr, intr_type, NVKM_INTR_PRIO_NORMAL, &gr->base.engine.subdev, + gf100_gr_intr, &gr->base.engine.subdev.inth); + if (ret) + return ret; + nvkm_pmu_pgob(device->pmu, false); gr->rop_nr = gr->func->rops(gr); @@ -2047,7 +2055,7 @@ gf100_gr_init_(struct nvkm_gr *base) struct nvkm_subdev *subdev = &base->engine.subdev; struct nvkm_device *device = subdev->device; bool reset = device->chipset == 0x137 || device->chipset == 0x138; - u32 ret; + int ret; /* On certain GP107/GP108 boards, we trigger a weird issue where * GR will stop responding to PRI accesses after we've asked the @@ -2083,7 +2091,12 @@ gf100_gr_init_(struct nvkm_gr *base) if (ret) return ret; - return gr->func->init(gr); + ret = gr->func->init(gr); + if (ret) + return ret; + + nvkm_inth_allow(&subdev->inth); + return 0; } static int @@ -2091,6 +2104,9 @@ gf100_gr_fini(struct nvkm_gr *base, bool suspend) { struct gf100_gr *gr = gf100_gr(base); struct nvkm_subdev *subdev = &gr->base.engine.subdev; + + nvkm_inth_block(&subdev->inth); + nvkm_falcon_put(&gr->gpccs.falcon, subdev); nvkm_falcon_put(&gr->fecs.falcon, subdev); return 0; @@ -2457,7 +2473,6 @@ gf100_gr_ = { .init = gf100_gr_init_, .fini = gf100_gr_fini, .reset = gf100_gr_reset, - .intr = gf100_gr_intr, .units = gf100_gr_units, .chan_new = gf100_gr_chan_new, .object_get = gf100_gr_object_get, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c index 5118e413d053..ab1eaa37123a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gf100.c @@ -41,7 +41,7 @@ gf100_mc_intrs[] = { { NVKM_ENGINE_DISP , 0, 0, 0x04000000, true }, { NVKM_ENGINE_MSPDEC , 0, 0, 0x00020000, true }, { NVKM_ENGINE_MSVLD , 0, 0, 0x00008000, true }, - { NVKM_ENGINE_GR , 0, 0, 0x00001000, true }, + { NVKM_ENGINE_GR , 0, 0, 0x00001000 }, { NVKM_ENGINE_FIFO , 0, 0, 0x00000100 }, { NVKM_ENGINE_CE , 1, 0, 0x00000040, true }, { NVKM_ENGINE_CE , 0, 0, 0x00000020, true }, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk104.c index 9d482f358138..66829586a124 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gk104.c @@ -43,7 +43,8 @@ gk104_mc_intrs[] = { { NVKM_SUBDEV_I2C , 0, 0, 0x00200000, true }, { NVKM_SUBDEV_TIMER , 0, 0, 0x00100000, true }, { NVKM_SUBDEV_THERM , 0, 0, 0x00040000, true }, - { NVKM_SUBDEV_TOP , 0, 0, 0xffffffff, true }, + { NVKM_SUBDEV_TOP , 0, 0, 0x00001000 }, + { NVKM_SUBDEV_TOP , 0, 0, 0xffffefff, true }, {}, }; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c index 3a99a450b6b0..eb2ab03f4360 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/gp100.c @@ -37,8 +37,8 @@ gp100_mc_intrs[] = { { NVKM_SUBDEV_I2C , 0, 0, 0x00200000, true }, { NVKM_SUBDEV_TIMER , 0, 0, 0x00100000, true }, { NVKM_SUBDEV_THERM , 0, 0, 0x00040000, true }, - { NVKM_SUBDEV_TOP , 0, 0, 0x00008000 }, - { NVKM_SUBDEV_TOP , 0, 0, 0xffff7fff, true }, + { NVKM_SUBDEV_TOP , 0, 0, 0x00009000 }, + { NVKM_SUBDEV_TOP , 0, 0, 0xffff6fff, true }, {}, }; |