summaryrefslogtreecommitdiff
path: root/drm/nouveau/nouveau_dma.c
diff options
context:
space:
mode:
authorLauri Peltonen <lpeltonen@nvidia.com>2015-02-16 16:39:38 +0900
committerAlexandre Courbot <acourbot@nvidia.com>2016-01-15 14:32:54 +0900
commitab45c79f500237044a3ae14f4a292127c48ba5b2 (patch)
tree5c9b8c04eb7c1df75b414aca28fc3f98c884c2c4 /drm/nouveau/nouveau_dma.c
parent5b4f0a6847cfcbf6a4afd5460bc9b87233b48667 (diff)
downloadnouveau-ab45c79f500237044a3ae14f4a292127c48ba5b2.tar.gz
gem: Split nv50_dma_push
Split this function to provide a version allowing to directly specify a PB entry in its hardware format. Signed-off-by: Lauri Peltonen <lpeltonen@nvidia.com> [acourbot@nvidia.com: split from longer patch] Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Diffstat (limited to 'drm/nouveau/nouveau_dma.c')
-rw-r--r--drm/nouveau/nouveau_dma.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drm/nouveau/nouveau_dma.c b/drm/nouveau/nouveau_dma.c
index d168c6353..f0f5be7e5 100644
--- a/drm/nouveau/nouveau_dma.c
+++ b/drm/nouveau/nouveau_dma.c
@@ -79,23 +79,31 @@ READ_GET(struct nouveau_channel *chan, uint64_t *prev_get, int *timeout)
}
void
-nv50_dma_push(struct nouveau_channel *chan, struct nouveau_bo *bo,
- int delta, int length)
+nv50_dma_push_bo(struct nouveau_channel *chan, struct nouveau_bo *bo,
+ int delta, int length)
{
struct nouveau_cli *cli = (void *)chan->user.client;
- struct nouveau_bo *pb = chan->push.buffer;
struct nvkm_vma *vma;
- int ip = (chan->dma.ib_put * 2) + chan->dma.ib_base;
u64 offset;
vma = nouveau_bo_vma_find(bo, cli->vm);
BUG_ON(!vma);
offset = vma->offset + delta;
+ nv50_dma_push(chan, lower_32_bits(offset),
+ upper_32_bits(offset) | length << 8);
+}
+
+void
+nv50_dma_push(struct nouveau_channel *chan, uint32_t entry0, uint32_t entry1)
+{
+ struct nouveau_bo *pb = chan->push.buffer;
+ int ip = (chan->dma.ib_put * 2) + chan->dma.ib_base;
+
BUG_ON(chan->dma.ib_free < 1);
- nouveau_bo_wr32(pb, ip++, lower_32_bits(offset));
- nouveau_bo_wr32(pb, ip++, upper_32_bits(offset) | length << 8);
+ nouveau_bo_wr32(pb, ip++, entry0);
+ nouveau_bo_wr32(pb, ip++, entry1);
chan->dma.ib_put = (chan->dma.ib_put + 1) & chan->dma.ib_max;