summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2022-06-01 13:46:04 +0300
committerDave Airlie <airlied@redhat.com>2022-07-13 06:56:42 +0300
commit097d56cdcd77639bce7e205adaa22b6f5e7d93a6 (patch)
tree66c37b38aa602ffa705a9c3e04d60388f56b6eca /drivers
parent66ff4e4ed471fdfa9ae4c49a0abcf5d5043ca65e (diff)
downloadlinux-097d56cdcd77639bce7e205adaa22b6f5e7d93a6.tar.xz
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 <bskeggs@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_chan.c4
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c35
3 files changed, 3 insertions, 37 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
index 4d1a3bd558fd..15099913504d 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 ea7769135b0d..48dea5d0c580 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 4ddaa91ad409..2e7f32cebf2a 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,
};