diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-01-07 19:57:39 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-01-10 18:06:45 -0500 |
commit | 75c99da6cdd0ec9d70747f9ced3e85b2dd955cdf (patch) | |
tree | b101655b451d441ca84c9be92e020f761c1c977d /drivers/gpu/drm/nouveau/nouveau_dma.c | |
parent | dff36321497b1130085820c81a44779b065c8d7e (diff) |
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 @@ | |||
29 | #include "nouveau_drv.h" | 29 | #include "nouveau_drv.h" |
30 | #include "nouveau_dma.h" | 30 | #include "nouveau_dma.h" |
31 | 31 | ||
32 | void | ||
33 | nouveau_dma_pre_init(struct nouveau_channel *chan) | ||
34 | { | ||
35 | chan->dma.max = (chan->pushbuf_bo->bo.mem.size >> 2) - 2; | ||
36 | chan->dma.put = 0; | ||
37 | chan->dma.cur = chan->dma.put; | ||
38 | chan->dma.free = chan->dma.max - chan->dma.cur; | ||
39 | } | ||
40 | |||
32 | int | 41 | int |
33 | nouveau_dma_init(struct nouveau_channel *chan) | 42 | nouveau_dma_init(struct nouveau_channel *chan) |
34 | { | 43 | { |
@@ -74,12 +83,6 @@ nouveau_dma_init(struct nouveau_channel *chan) | |||
74 | return ret; | 83 | return ret; |
75 | } | 84 | } |
76 | 85 | ||
77 | /* Initialise DMA vars */ | ||
78 | chan->dma.max = (chan->pushbuf_bo->bo.mem.size >> 2) - 2; | ||
79 | chan->dma.put = 0; | ||
80 | chan->dma.cur = chan->dma.put; | ||
81 | chan->dma.free = chan->dma.max - chan->dma.cur; | ||
82 | |||
83 | /* Insert NOPS for NOUVEAU_DMA_SKIPS */ | 86 | /* Insert NOPS for NOUVEAU_DMA_SKIPS */ |
84 | ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS); | 87 | ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS); |
85 | if (ret) | 88 | if (ret) |