nv40: respect do_flip in surface_copy()
authorBen Skeggs <skeggsb@gmail.com>
Tue, 25 Mar 2008 01:57:36 +0000 (12:57 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Tue, 25 Mar 2008 01:58:57 +0000 (12:58 +1100)
src/gallium/drivers/nv40/nv40_surface.c

index e8a601169642647358341071e42be88be52f13d4..c0d135eb36dfb5bd335b3eed8fcd0b7b70856d1a 100644 (file)
@@ -42,8 +42,20 @@ nv40_surface_copy(struct pipe_context *pipe, unsigned do_flip,
        struct nv40_context *nv40 = nv40_context(pipe);
        struct nouveau_winsys *nvws = nv40->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