diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:16 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:32 +1000 |
commit | bf81df9be28657eea4aca8c6ab4ed3e69f8a051c (patch) | |
tree | a4a7e6f3d4e46696584c930bb7d6b4b2fd941337 /drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | |
parent | a01ca78c8f118e5a24f1527ecf078ab56ddd4805 (diff) | |
download | talos-obmc-linux-bf81df9be28657eea4aca8c6ab4ed3e69f8a051c.tar.gz talos-obmc-linux-bf81df9be28657eea4aca8c6ab4ed3e69f8a051c.zip |
drm/nouveau/nvif: replace path-based object identification
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index e298aef71918..73b8ab4c222e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -54,9 +54,12 @@ int nvkm_fifo_channel_create_(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, - int bar, u32 addr, u32 size, u32 pushbuf, + int bar, u32 addr, u32 size, u64 pushbuf, u64 engmask, int len, void **ptr) { + struct nvkm_client *client = nvkm_client(parent); + struct nvkm_handle *handle; + struct nvkm_dmaobj *dmaobj; struct nvkm_fifo *fifo = (void *)engine; struct nvkm_fifo_chan *chan; struct nvkm_dmaeng *dmaeng; @@ -73,12 +76,13 @@ nvkm_fifo_channel_create_(struct nvkm_object *parent, return ret; /* validate dma object representing push buffer */ - chan->pushdma = (void *)nvkm_handle_ref(parent, pushbuf); - if (!chan->pushdma) + handle = nvkm_client_search(client, pushbuf); + if (!handle) return -ENOENT; + dmaobj = (void *)handle->object; - dmaeng = (void *)chan->pushdma->base.engine; - switch (chan->pushdma->base.oclass->handle) { + dmaeng = (void *)dmaobj->base.engine; + switch (dmaobj->base.oclass->handle) { case NV_DMA_FROM_MEMORY: case NV_DMA_IN_MEMORY: break; @@ -86,7 +90,7 @@ nvkm_fifo_channel_create_(struct nvkm_object *parent, return -EINVAL; } - ret = dmaeng->bind(chan->pushdma, parent, &chan->pushgpu); + ret = dmaeng->bind(dmaobj, parent, &chan->pushgpu); if (ret) return ret; @@ -126,7 +130,6 @@ nvkm_fifo_channel_destroy(struct nvkm_fifo_chan *chan) spin_unlock_irqrestore(&fifo->lock, flags); nvkm_gpuobj_ref(NULL, &chan->pushgpu); - nvkm_object_ref(NULL, (struct nvkm_object **)&chan->pushdma); nvkm_namedb_destroy(&chan->namedb); } |