diff options
| author | Ben Skeggs <bskeggs@redhat.com> | 2021-02-04 14:28:06 +1000 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2021-02-11 10:14:32 +1000 |
| commit | efe2a9eccd720d93d3ea6271bc5e2245344daadb (patch) | |
| tree | 41a651549ae6e90f6ba04526b0d142d6b670e961 /drivers/gpu/drm/nouveau/nvkm/subdev | |
| parent | 65a279c1a9709edc00a5859737d0abd50c029ca0 (diff) | |
| download | linux-efe2a9eccd720d93d3ea6271bc5e2245344daadb.tar.bz2 | |
drm/nouveau/device: pass instance id when looking up a subdev/engine
This switches to using the subdev list for lookup, and otherwise should
be a no-op aside from switching the function signatures.
Callers will be transitioned to split type+inst individually.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
| -rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c index d350d92852d2..34a354599ee2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgk104.c @@ -260,7 +260,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq) ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ram_block(fuc); - if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP)) + if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) ram_wr32(fuc, 0x62c000, 0x0f0f0000); /* MR1: turn termination on early, for some reason.. */ @@ -661,7 +661,7 @@ gk104_ram_calc_gddr5(struct gk104_ram *ram, u32 freq) ram_unblock(fuc); - if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP)) + if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) ram_wr32(fuc, 0x62c000, 0x0f0f0f00); if (next->bios.rammap_11_08_01) @@ -711,7 +711,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq) ram_mask(fuc, 0x10f808, 0x40000000, 0x40000000); ram_block(fuc); - if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP)) + if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) ram_wr32(fuc, 0x62c000, 0x0f0f0000); if (vc == 1 && ram_have(fuc, gpio2E)) { @@ -943,7 +943,7 @@ gk104_ram_calc_sddr3(struct gk104_ram *ram, u32 freq) ram_unblock(fuc); - if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP)) + if (nvkm_device_engine(ram->base.fb->subdev.device, NVKM_ENGINE_DISP, 0)) ram_wr32(fuc, 0x62c000, 0x0f0f0f00); if (next->bios.rammap_11_08_01) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c index 09f669ac6630..43bf0324a82e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/base.c @@ -90,7 +90,7 @@ nvkm_mc_intr(struct nvkm_device *device, bool *handled) stat = nvkm_top_intr(device, intr, &subdevs); while (subdevs) { enum nvkm_devidx subidx = __ffs64(subdevs); - subdev = nvkm_device_subdev(device, subidx); + subdev = nvkm_device_subdev(device, subidx, 0); if (subdev) nvkm_subdev_intr(subdev); subdevs &= ~BIT_ULL(subidx); @@ -98,7 +98,7 @@ nvkm_mc_intr(struct nvkm_device *device, bool *handled) for (map = mc->func->intr; map->stat; map++) { if (intr & map->stat) { - subdev = nvkm_device_subdev(device, map->unit); + subdev = nvkm_device_subdev(device, map->unit, 0); if (subdev) nvkm_subdev_intr(subdev); stat &= ~map->stat; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c index 4e03971d2e3d..f6f7db2a3db7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gk104.c @@ -36,7 +36,7 @@ gk104_clkgate_enable(struct nvkm_therm *base) /* Program ENG_MANT, ENG_FILTER */ for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) { - if (!nvkm_device_subdev(dev, order[i].engine)) + if (!nvkm_device_subdev(dev, order[i].engine, 0)) continue; nvkm_mask(dev, 0x20200 + order[i].offset, 0xff00, 0x4500); @@ -48,7 +48,7 @@ gk104_clkgate_enable(struct nvkm_therm *base) /* Enable clockgating (ENG_CLK = RUN->AUTO) */ for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) { - if (!nvkm_device_subdev(dev, order[i].engine)) + if (!nvkm_device_subdev(dev, order[i].engine, 0)) continue; nvkm_mask(dev, 0x20200 + order[i].offset, 0x00ff, 0x0045); @@ -65,7 +65,7 @@ gk104_clkgate_fini(struct nvkm_therm *base, bool suspend) /* ENG_CLK = AUTO->RUN, ENG_PWR = RUN->AUTO */ for (i = 0; order[i].engine != NVKM_SUBDEV_NR; i++) { - if (!nvkm_device_subdev(dev, order[i].engine)) + if (!nvkm_device_subdev(dev, order[i].engine, 0)) continue; nvkm_mask(dev, 0x20200 + order[i].offset, 0xff, 0x54); |