nv50: obey do_flip in surface_copy()
authorBen Skeggs <skeggsb@gmail.com>
Fri, 11 Jul 2008 12:48:11 +0000 (22:48 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Fri, 11 Jul 2008 12:50:10 +0000 (22:50 +1000)
src/gallium/drivers/nv50/nv50_surface.c

index 8d3f1edcfe958e9e3fd83bb41b61c45ff9866633..a9daeee3694b1870e8b179dcc09bdf24a379af0d 100644 (file)
@@ -28,7 +28,7 @@
 #include "util/p_tile.h"
 
 static void
-nv50_surface_copy(struct pipe_context *pipe, unsigned flip,
+nv50_surface_copy(struct pipe_context *pipe, boolean flip,
                  struct pipe_surface *dest, unsigned destx, unsigned desty,
                  struct pipe_surface *src, unsigned srcx, unsigned srcy,
                  unsigned width, unsigned height)
@@ -36,8 +36,16 @@ nv50_surface_copy(struct pipe_context *pipe, unsigned flip,
        struct nv50_context *nv50 = (struct nv50_context *)pipe;
        struct nouveau_winsys *nvws = nv50->screen->nvws;
 
-       nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
-                          width, height);
+       if (flip) {
+               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