Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
[mesa.git] / src / gallium / drivers / nv50 / nv50_context.c
index a511f655c19e1c4c0e27fc846c5bc5a93446f182..6e8f4f9750dbaf5a88efa620c5355629d59131ab 100644 (file)
@@ -31,15 +31,23 @@ 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->nvws->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
 nv50_destroy(struct pipe_context *pipe)
 {
-       struct nv50_context *nv50 = (struct nv50_context *)pipe;
+       struct nv50_context *nv50 = nv50_context(pipe);
 
        draw_destroy(nv50->draw);
        FREE(nv50);
@@ -112,5 +120,3 @@ nv50_create(struct pipe_screen *pscreen, unsigned pctx_id)
 
        return &nv50->pipe;
 }
-
-