diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-01-08 10:57:39 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-01-11 09:06:45 +1000 |
commit | 75c99da6cdd0ec9d70747f9ced3e85b2dd955cdf (patch) | |
tree | b101655b451d441ca84c9be92e020f761c1c977d /drivers/gpu/drm/nouveau/nouveau_dma.c | |
parent | dff36321497b1130085820c81a44779b065c8d7e (diff) | |
download | lwn-75c99da6cdd0ec9d70747f9ced3e85b2dd955cdf.tar.gz lwn-75c99da6cdd0ec9d70747f9ced3e85b2dd955cdf.zip |
drm/nouveau: initialise DMA tracking parameters earlier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_dma.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_dma.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.c b/drivers/gpu/drm/nouveau/nouveau_dma.c index 3f7f78e03d42..7afbe8b40d51 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dma.c +++ b/drivers/gpu/drm/nouveau/nouveau_dma.c @@ -29,6 +29,15 @@ #include "nouveau_drv.h" #include "nouveau_dma.h" +void +nouveau_dma_pre_init(struct nouveau_channel *chan) +{ + chan->dma.max = (chan->pushbuf_bo->bo.mem.size >> 2) - 2; + chan->dma.put = 0; + chan->dma.cur = chan->dma.put; + chan->dma.free = chan->dma.max - chan->dma.cur; +} + int nouveau_dma_init(struct nouveau_channel *chan) { @@ -74,12 +83,6 @@ nouveau_dma_init(struct nouveau_channel *chan) return ret; } - /* Initialise DMA vars */ - chan->dma.max = (chan->pushbuf_bo->bo.mem.size >> 2) - 2; - chan->dma.put = 0; - chan->dma.cur = chan->dma.put; - chan->dma.free = chan->dma.max - chan->dma.cur; - /* Insert NOPS for NOUVEAU_DMA_SKIPS */ ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS); if (ret) |