summaryrefslogtreecommitdiff
path: root/shared-core/nouveau_dma.c
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@tungstengraphics.com>2008-02-26 15:42:41 +0000
committerAlan Hourihane <alanh@tungstengraphics.com>2008-02-26 15:42:41 +0000
commit1e66322633943bc27bf5e68609f564fa95e6e6a1 (patch)
tree1a536a41c6d9818484c0a972d565fb4914943729 /shared-core/nouveau_dma.c
parent73cb02b5430b3881cbce5fb4852ac573c11ff831 (diff)
parente87cec19687089f9f268ec0eb81b57e6fb8de6a9 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts: shared-core/i915_dma.c
Diffstat (limited to 'shared-core/nouveau_dma.c')
-rw-r--r--shared-core/nouveau_dma.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/shared-core/nouveau_dma.c b/shared-core/nouveau_dma.c
index dff786d4..e519dc4e 100644
--- a/shared-core/nouveau_dma.c
+++ b/shared-core/nouveau_dma.c
@@ -29,11 +29,6 @@
#include "nouveau_drv.h"
#include "nouveau_dma.h"
-/* FIXME : should go into a nouveau_drm.h define ?
- * (it's shared between DRI & DDX & DRM)
- */
-#define SKIPS 8
-
int
nouveau_dma_channel_init(struct drm_device *dev)
{
@@ -76,10 +71,10 @@ nouveau_dma_channel_init(struct drm_device *dev)
dchan->cur = dchan->put;
dchan->free = dchan->max - dchan->cur;
- /* Insert NOPS for SKIPS */
- dchan->free -= SKIPS;
- dchan->push_free = SKIPS;
- for (i=0; i<SKIPS; i++)
+ /* Insert NOPS for NOUVEAU_DMA_SKIPS */
+ dchan->free -= NOUVEAU_DMA_SKIPS;
+ dchan->push_free = NOUVEAU_DMA_SKIPS;
+ for (i=0; i < NOUVEAU_DMA_SKIPS; i++)
OUT_RING(0);
/* NV_MEMORY_TO_MEMORY_FORMAT requires a notifier */
@@ -131,8 +126,6 @@ nouveau_dma_channel_takedown(struct drm_device *dev)
}
}
-#define RING_SKIPS 8
-
#define READ_GET() ((NV_READ(dchan->chan->get) - \
dchan->chan->pushbuf_base) >> 2)
#define WRITE_PUT(val) do { \
@@ -156,19 +149,19 @@ nouveau_dma_wait(struct drm_device *dev, int size)
if (dchan->free < size) {
dchan->push_free = 1;
OUT_RING(0x20000000|dchan->chan->pushbuf_base);
- if (get <= RING_SKIPS) {
+ if (get <= NOUVEAU_DMA_SKIPS) {
/*corner case - will be idle*/
- if (dchan->put <= RING_SKIPS)
- WRITE_PUT(RING_SKIPS + 1);
+ if (dchan->put <= NOUVEAU_DMA_SKIPS)
+ WRITE_PUT(NOUVEAU_DMA_SKIPS + 1);
do {
get = READ_GET();
- } while (get <= RING_SKIPS);
+ } while (get <= NOUVEAU_DMA_SKIPS);
}
- WRITE_PUT(RING_SKIPS);
- dchan->cur = dchan->put = RING_SKIPS;
- dchan->free = get - (RING_SKIPS + 1);
+ WRITE_PUT(NOUVEAU_DMA_SKIPS);
+ dchan->cur = dchan->put = NOUVEAU_DMA_SKIPS;
+ dchan->free = get - (NOUVEAU_DMA_SKIPS + 1);
}
} else {
dchan->free = get - dchan->cur - 1;