Commit 608a29c2 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/ce: make use of nvkm_subdev.inst

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 50551b15
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
static void static void
gf100_ce_init(struct nvkm_falcon *ce) gf100_ce_init(struct nvkm_falcon *ce)
{ {
struct nvkm_device *device = ce->engine.subdev.device; nvkm_wr32(ce->engine.subdev.device, ce->addr + 0x084, ce->engine.subdev.inst);
const int index = ce->engine.subdev.index - NVKM_ENGINE_CE0;
nvkm_wr32(device, ce->addr + 0x084, index);
} }
static const struct nvkm_falcon_func static const struct nvkm_falcon_func
......
...@@ -58,9 +58,9 @@ gk104_ce_intr_launcherr(struct nvkm_engine *ce, const u32 base) ...@@ -58,9 +58,9 @@ gk104_ce_intr_launcherr(struct nvkm_engine *ce, const u32 base)
void void
gk104_ce_intr(struct nvkm_engine *ce) gk104_ce_intr(struct nvkm_engine *ce)
{ {
const u32 base = (ce->subdev.index - NVKM_ENGINE_CE0) * 0x1000;
struct nvkm_subdev *subdev = &ce->subdev; struct nvkm_subdev *subdev = &ce->subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
const u32 base = subdev->inst * 0x1000;
u32 mask = nvkm_rd32(device, 0x104904 + base); u32 mask = nvkm_rd32(device, 0x104904 + base);
u32 intr = nvkm_rd32(device, 0x104908 + base) & mask; u32 intr = nvkm_rd32(device, 0x104908 + base) & mask;
if (intr & 0x00000001) { if (intr & 0x00000001) {
......
...@@ -59,9 +59,9 @@ gp100_ce_intr_launcherr(struct nvkm_engine *ce, const u32 base) ...@@ -59,9 +59,9 @@ gp100_ce_intr_launcherr(struct nvkm_engine *ce, const u32 base)
void void
gp100_ce_intr(struct nvkm_engine *ce) gp100_ce_intr(struct nvkm_engine *ce)
{ {
const u32 base = (ce->subdev.index - NVKM_ENGINE_CE0) * 0x80;
struct nvkm_subdev *subdev = &ce->subdev; struct nvkm_subdev *subdev = &ce->subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
const u32 base = subdev->inst * 0x80;
u32 mask = nvkm_rd32(device, 0x10440c + base); u32 mask = nvkm_rd32(device, 0x10440c + base);
u32 intr = nvkm_rd32(device, 0x104410 + base) & mask; u32 intr = nvkm_rd32(device, 0x104410 + base) & mask;
if (intr & 0x00000001) { //XXX: guess if (intr & 0x00000001) { //XXX: guess
......
...@@ -44,7 +44,7 @@ gt215_ce_intr(struct nvkm_falcon *ce, struct nvkm_fifo_chan *chan) ...@@ -44,7 +44,7 @@ gt215_ce_intr(struct nvkm_falcon *ce, struct nvkm_fifo_chan *chan)
{ {
struct nvkm_subdev *subdev = &ce->engine.subdev; struct nvkm_subdev *subdev = &ce->engine.subdev;
struct nvkm_device *device = subdev->device; struct nvkm_device *device = subdev->device;
const u32 base = (subdev->index - NVKM_ENGINE_CE0) * 0x1000; const u32 base = subdev->inst * 0x1000;
u32 ssta = nvkm_rd32(device, 0x104040 + base) & 0x0000ffff; u32 ssta = nvkm_rd32(device, 0x104040 + base) & 0x0000ffff;
u32 addr = nvkm_rd32(device, 0x104040 + base) >> 16; u32 addr = nvkm_rd32(device, 0x104040 + base) >> 16;
u32 mthd = (addr & 0x07ff) << 2; u32 mthd = (addr & 0x07ff) << 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment