Commit c63834e1 authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie

drm/nouveau: initialise DMA tracking parameters earlier

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 400f14ac
...@@ -158,6 +158,8 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, ...@@ -158,6 +158,8 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
return ret; return ret;
} }
nouveau_dma_pre_init(chan);
/* Locate channel's user control regs */ /* Locate channel's user control regs */
if (dev_priv->card_type < NV_40) if (dev_priv->card_type < NV_40)
user = NV03_USER(channel); user = NV03_USER(channel);
......
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
#include "nouveau_drv.h" #include "nouveau_drv.h"
#include "nouveau_dma.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 int
nouveau_dma_init(struct nouveau_channel *chan) nouveau_dma_init(struct nouveau_channel *chan)
{ {
...@@ -74,12 +83,6 @@ nouveau_dma_init(struct nouveau_channel *chan) ...@@ -74,12 +83,6 @@ nouveau_dma_init(struct nouveau_channel *chan)
return ret; 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 */ /* Insert NOPS for NOUVEAU_DMA_SKIPS */
ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS); ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS);
if (ret) if (ret)
......
...@@ -837,6 +837,7 @@ nouveau_debugfs_channel_fini(struct nouveau_channel *chan) ...@@ -837,6 +837,7 @@ nouveau_debugfs_channel_fini(struct nouveau_channel *chan)
#endif #endif
/* nouveau_dma.c */ /* nouveau_dma.c */
extern void nouveau_dma_pre_init(struct nouveau_channel *);
extern int nouveau_dma_init(struct nouveau_channel *); extern int nouveau_dma_init(struct nouveau_channel *);
extern int nouveau_dma_wait(struct nouveau_channel *, int size); extern int nouveau_dma_wait(struct nouveau_channel *, int size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment