nouveau: add pipe_buffer/fence code to pipe drivers, move nv50 over
[mesa.git] / src / gallium / drivers / nv50 / nv50_surface.c
index b0936518b038ad85e9e91825fc8ea4c17bbe9344..121eddfc83414a2c496745b1bfd77ae5c6b767d8 100644 (file)
@@ -54,13 +54,9 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst)
        struct nv50_miptree *mt = nv50_miptree(ps->texture);
        struct nouveau_channel *chan = screen->nvws->channel;
        struct nouveau_grobj *eng2d = screen->eng2d;
-       struct nouveau_bo *bo;
+       struct nouveau_bo *bo = nouveau_bo(nv50_miptree(ps->texture)->buffer);
        int format, mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT;
        int flags = NOUVEAU_BO_VRAM | (dst ? NOUVEAU_BO_WR : NOUVEAU_BO_RD);
-       bo = screen->nvws->get_bo(nv50_miptree(ps->texture)->buffer);
-       if (!bo)
-               return 1;
 
        format = nv50_format(ps->format);
        if (format < 0)
@@ -144,7 +140,7 @@ nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst,
 }
 
 static void
-nv50_surface_copy(struct pipe_context *pipe, boolean flip,
+nv50_surface_copy(struct pipe_context *pipe,
                  struct pipe_surface *dest, unsigned destx, unsigned desty,
                  struct pipe_surface *src, unsigned srcx, unsigned srcy,
                  unsigned width, unsigned height)
@@ -154,16 +150,8 @@ nv50_surface_copy(struct pipe_context *pipe, boolean flip,
 
        assert(src->format == dest->format);
 
-       if (flip) {
-               desty += height;
-               while (height--) {
-                       nv50_surface_do_copy(screen, dest, destx, desty--, src,
-                                            srcx, srcy++, width, 1);
-               }
-       } else {
-               nv50_surface_do_copy(screen, dest, destx, desty, src, srcx,
+       nv50_surface_do_copy(screen, dest, destx, desty, src, srcx,
                                     srcy, width, height);
-       }
 }
 
 static void