summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorMatthieu Castet <castet.matthieu@free.fr>2007-09-29 23:06:29 +0200
committerMatthieu Castet <castet.matthieu@free.fr>2007-09-29 23:07:29 +0200
commitf8f31f04574cd6986d7d9ef2215bbb23e0f44b73 (patch)
tree8a04a9111a4f097bb33b47b50f55285b6c964513 /shared-core
parent097db7a9b0cd0e53fb82dffa57c662f327c19670 (diff)
nouveau : stop the fifo of the channel we are deleting
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/nouveau_fifo.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index 437c84f2..f82d130b 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -403,7 +403,19 @@ void nouveau_fifo_free(struct nouveau_channel *chan)
/* disable the fifo caches */
NV_WRITE(NV03_PFIFO_CACHES, 0x00000000);
+ NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH, NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH)&(~0x1));
+ NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000000);
+ NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000000);
+ /* stop the fifo, otherwise it could be running and
+ * it will crash when removing gpu objects */
+ if (dev_priv->card_type < NV_50) {
+ NV_WRITE(NV03_FIFO_REGS_DMAPUT(chan->id), chan->pushbuf_base);
+ NV_WRITE(NV03_FIFO_REGS_DMAGET(chan->id), chan->pushbuf_base);
+ } else {
+ NV_WRITE(NV50_FIFO_REGS_DMAPUT(chan->id), chan->pushbuf_base);
+ NV_WRITE(NV50_FIFO_REGS_DMAGET(chan->id), chan->pushbuf_base);
+ }
// FIXME XXX needs more code
engine->fifo.destroy_context(chan);
@@ -412,6 +424,10 @@ void nouveau_fifo_free(struct nouveau_channel *chan)
engine->graph.destroy_context(chan);
/* reenable the fifo caches */
+ NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH,
+ NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) | 1);
+ NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000001);
+ NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000001);
NV_WRITE(NV03_PFIFO_CACHES, 0x00000001);
/* Deallocate push buffer */