aboutsummaryrefslogtreecommitdiff
path: root/shared-core/nouveau_fifo.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2007-11-14 05:36:20 +1100
committerBen Skeggs <skeggsb@gmail.com>2007-11-14 05:36:20 +1100
commit2d7eb4434f50ab190b530a7ef23e4a361092a33d (patch)
tree650efda8c3318991469888cc7078cd3c197ac8f3 /shared-core/nouveau_fifo.c
parent7e4bb6099a492b90374565aa574ba65f19ae2ab2 (diff)
nouveau: Also wait until CACHE1 gets emptied.
Diffstat (limited to 'shared-core/nouveau_fifo.c')
-rw-r--r--shared-core/nouveau_fifo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index 3c993f3e..d00f1938 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -419,7 +419,9 @@ void nouveau_fifo_free(struct nouveau_channel *chan)
/* Give the channel a chance to idle, wait 2s (hopefully) */
t_start = engine->timer.read(dev);
- while (NV_READ(chan->get) != NV_READ(chan->put)) {
+ while (NV_READ(chan->get) != NV_READ(chan->put) ||
+ NV_READ(NV03_PFIFO_CACHE1_GET) !=
+ NV_READ(NV03_PFIFO_CACHE1_PUT)) {
if (engine->timer.read(dev) - t_start > 2000000000ULL) {
DRM_ERROR("Failed to idle channel %d before destroy."
"Prepare for strangeness..\n", chan->id);
@@ -427,6 +429,10 @@ void nouveau_fifo_free(struct nouveau_channel *chan)
}
}
+ /*XXX: Maybe should wait for PGRAPH to finish with the stuff it fetched
+ * from CACHE1 too?
+ */
+
/* 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));