From: Ben Skeggs Date: Wed, 1 Jun 2022 10:46:04 +0000 (+1000) Subject: drm/nouveau/fifo: remove rd32/wr32 accessors from channels X-Git-Tag: v6.6.17~6802^2~9^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=097d56cdcd77639bce7e205adaa22b6f5e7d93a6;p=platform%2Fkernel%2Flinux-rpi.git drm/nouveau/fifo: remove rd32/wr32 accessors from channels No need for these, we always map USERD to the client. Signed-off-by: Ben Skeggs Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h index 4d1a3bd..1509991 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h @@ -26,7 +26,6 @@ struct nvkm_fifo_chan { struct nvkm_gpuobj *inst; struct nvkm_gpuobj *push; struct nvkm_vmm *vmm; - void __iomem *user; u64 addr; u32 size; diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.c b/drivers/gpu/drm/nouveau/nouveau_chan.c index ea77691..48dea5d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_chan.c +++ b/drivers/gpu/drm/nouveau/nouveau_chan.c @@ -385,7 +385,9 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) struct nv_dma_v0 args = {}; int ret, i; - nvif_object_map(&chan->user, NULL, 0); + ret = nvif_object_map(&chan->user, NULL, 0); + if (ret) + return ret; if (chan->user.oclass >= FERMI_CHANNEL_GPFIFO && chan->user.oclass < AMPERE_CHANNEL_GPFIFO_B) { diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c index 4ddaa91..2e7f32c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c @@ -272,36 +272,6 @@ nvkm_fifo_chan_map(struct nvkm_object *object, void *argv, u32 argc, } static int -nvkm_fifo_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data) -{ - struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); - if (unlikely(!chan->user)) { - chan->user = ioremap(chan->addr, chan->size); - if (!chan->user) - return -ENOMEM; - } - if (unlikely(addr + 4 > chan->size)) - return -EINVAL; - *data = ioread32_native(chan->user + addr); - return 0; -} - -static int -nvkm_fifo_chan_wr32(struct nvkm_object *object, u64 addr, u32 data) -{ - struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); - if (unlikely(!chan->user)) { - chan->user = ioremap(chan->addr, chan->size); - if (!chan->user) - return -ENOMEM; - } - if (unlikely(addr + 4 > chan->size)) - return -EINVAL; - iowrite32_native(data, chan->user + addr); - return 0; -} - -static int nvkm_fifo_chan_fini(struct nvkm_object *object, bool suspend) { struct nvkm_fifo_chan *chan = nvkm_fifo_chan(object); @@ -332,9 +302,6 @@ nvkm_fifo_chan_dtor(struct nvkm_object *object) } spin_unlock_irqrestore(&fifo->lock, flags); - if (chan->user) - iounmap(chan->user); - if (chan->vmm) { nvkm_vmm_part(chan->vmm, chan->inst->memory); nvkm_vmm_unref(&chan->vmm); @@ -352,8 +319,6 @@ nvkm_fifo_chan_func = { .fini = nvkm_fifo_chan_fini, .ntfy = nvkm_fifo_chan_ntfy, .map = nvkm_fifo_chan_map, - .rd32 = nvkm_fifo_chan_rd32, - .wr32 = nvkm_fifo_chan_wr32, .sclass = nvkm_fifo_chan_child_get, };