diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-02-11 09:37:26 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-02-25 08:08:29 +0300 |
commit | 9a391ad8a2cdd7e5be9b6aabb56f4a46683ba377 (patch) | |
tree | 2dafd2b541dff055e88406cfb48679530b12192e /drivers/gpu/drm/nouveau/nouveau_gem.c | |
parent | ff9e5279b14dc024599cc705ee199dadb94e90a3 (diff) | |
download | linux-9a391ad8a2cdd7e5be9b6aabb56f4a46683ba377.tar.xz |
drm/nv50: switch to indirect push buffer controls
PFIFO on G80 and up has a new mode where the main ring buffer is simply a
ring of pointers to indirect buffers containing the actual command/data
packets. In order to be able to implement index buffers in the 3D driver
we need to be able to submit data-only push buffers right after the cmd
packet header, which is only possible using the new command submission
method.
This commit doesn't make it possible to implement index buffers yet, some
userspace interface changes will be required, but it does allow for
testing/debugging of the hardware-side support in the meantime.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 70cc30803e3b..986b67099f6c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -707,7 +707,7 @@ nouveau_gem_ioctl_pushbuf_call(struct drm_device *dev, void *data, uint32_t retaddy; if (chan->dma.free < 4 + NOUVEAU_DMA_SKIPS) { - ret = nouveau_dma_wait(chan, 4 + NOUVEAU_DMA_SKIPS); + ret = nouveau_dma_wait(chan, 0, 4 + NOUVEAU_DMA_SKIPS); if (ret) { NV_ERROR(dev, "jmp_space: %d\n", ret); goto out; @@ -754,6 +754,15 @@ nouveau_gem_ioctl_pushbuf_call(struct drm_device *dev, void *data, } } + if (chan->dma.ib_max) { + ret = nouveau_dma_wait(chan, 2, 6); + if (ret) { + NV_INFO(dev, "nv50cal_space: %d\n", ret); + goto out; + } + + nv50_dma_push(chan, pbbo, req->offset, req->nr_dwords); + } else if (PUSHBUF_CAL) { ret = RING_SPACE(chan, 2); if (ret) { @@ -792,6 +801,10 @@ out: kfree(bo); out_next: + if (chan->dma.ib_max) { + req->suffix0 = 0x00000000; + req->suffix1 = 0x00000000; + } else if (PUSHBUF_CAL) { req->suffix0 = 0x00020000; req->suffix1 = 0x00000000; |