nv30: Do flip
authorPatrice Mandin <pmandin@caramail.com>
Fri, 11 Apr 2008 19:37:41 +0000 (21:37 +0200)
committerPatrice Mandin <pmandin@caramail.com>
Fri, 11 Apr 2008 19:37:41 +0000 (21:37 +0200)
src/gallium/drivers/nv30/nv30_surface.c

index b20a3dd4c15ddd62cd8f2c6ab07f568fe4bdd9f3..b22211ac86e0151145d75de93310b727f482c760 100644 (file)
@@ -42,8 +42,20 @@ nv30_surface_copy(struct pipe_context *pipe, unsigned do_flip,
        struct nv30_context *nv30 = nv30_context(pipe);
        struct nouveau_winsys *nvws = nv30->nvws;
 
-       nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
-                          width, height);
+       if (do_flip) {
+               /*XXX: This dodgyness will do for now for correctness.  But,
+                *     need to investigate whether the 2D engine is able to
+                *     manage a flip (perhaps SIFM?), if not, use the 3D engine
+                */
+               desty += height;
+               while (height--) {
+                       nvws->surface_copy(nvws, dest, destx, desty--, src,
+                                          srcx, srcy++, width, 1);
+               }
+       } else {
+               nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
+                                  width, height);
+       }
 }
 
 static void