nv50: borrow some flushing code from the ddx
authorMaarten Maathuis <madman2003@gmail.com>
Sun, 16 Aug 2009 02:06:44 +0000 (04:06 +0200)
committerMaarten Maathuis <madman2003@gmail.com>
Mon, 17 Aug 2009 16:48:14 +0000 (18:48 +0200)
- This fixes neverball corruption.
- I'm unsure about what we're actually flushing here.

src/gallium/drivers/nv50/nv50_context.c

index a2222d88b93bef88454098c5797db08e360e3114..48f36d6a8b5e2e499a832ab2d307b0ad24b23676 100644 (file)
@@ -31,9 +31,17 @@ static void
 nv50_flush(struct pipe_context *pipe, unsigned flags,
           struct pipe_fence_handle **fence)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
-       
-       FIRE_RING(nv50->screen->base.channel);
+       struct nv50_context *nv50 = nv50_context(pipe);
+       struct nouveau_channel *chan = nv50->screen->base.channel;
+       struct nouveau_grobj *eng2d = nv50->screen->eng2d;
+
+       /* We need this in the ddx for reliable composite, not sure what we're
+        * actually flushing. We generate all our own flushes with flags = 0. */
+       WAIT_RING(chan, 3);
+       BEGIN_RING(chan, eng2d, 0x0110, 1);
+       OUT_RING  (chan, 0);
+
+       FIRE_RING(chan);
 }
 
 static void