gallium: remove pipe_context member from pipe_transfer
authorKeith Whitwell <keithw@vmware.com>
Thu, 11 Mar 2010 16:10:25 +0000 (16:10 +0000)
committerKeith Whitwell <keithw@vmware.com>
Thu, 11 Mar 2010 16:18:50 +0000 (16:18 +0000)
There was very little use for this beyond permitting the
pipe_context::tex_transfer_destroy() function to omit the pipe_context
argument.

This change adds the pipe_context argument into tex_transfer_destroy()
so that it looks like other pipe_context functions, and removes the
pipe_context pointer from pipe_transfer.

45 files changed:
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/util/u_debug.c
src/gallium/auxiliary/util/u_debug.h
src/gallium/auxiliary/util/u_gen_mipmap.c
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_rect.c
src/gallium/auxiliary/util/u_tile.c
src/gallium/auxiliary/util/u_tile.h
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
src/gallium/drivers/i915/i915_texture.c
src/gallium/drivers/i965/brw_screen.h
src/gallium/drivers/i965/brw_screen_texture.c
src/gallium/drivers/identity/id_context.c
src/gallium/drivers/identity/id_objects.c
src/gallium/drivers/identity/id_objects.h
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/nv30/nv30_transfer.c
src/gallium/drivers/nv40/nv40_transfer.c
src/gallium/drivers/nv50/nv50_transfer.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_transfer.c
src/gallium/drivers/softpipe/sp_tex_tile_cache.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/gallium/drivers/svga/svga_screen_texture.c
src/gallium/drivers/trace/tr_context.c
src/gallium/drivers/trace/tr_rbug.c
src/gallium/drivers/trace/tr_texture.c
src/gallium/drivers/trace/tr_texture.h
src/gallium/include/pipe/p_context.h
src/gallium/include/pipe/p_state.h
src/gallium/state_trackers/vega/api_filters.c
src/gallium/state_trackers/vega/api_images.c
src/gallium/state_trackers/vega/image.c
src/gallium/state_trackers/vega/paint.c
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_cb_accum.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_cb_readpixels.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_gen_mipmap.c
src/mesa/state_tracker/st_texture.c

index 2cb76b25aee390f23aec77288e8294e951a4847b..1c07ab13654a5ff4fa5b6aef9ec4e553765d5161 100644 (file)
@@ -449,7 +449,7 @@ aaline_create_texture(struct aaline_stage *aaline)
 
       /* unmap */
       pipe->transfer_unmap(pipe, transfer);
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
    return TRUE;
 }
index 479777e80794e3477e2f6fa0bcf7a5d49e90c513..38c22bf4e941c9a5fcf8493cde92b831d9597f37 100644 (file)
@@ -411,7 +411,7 @@ pstip_update_texture(struct pstip_stage *pstip)
 
    /* unmap */
    pipe->transfer_unmap(pipe, transfer);
-   pipe->tex_transfer_destroy(transfer);
+   pipe->tex_transfer_destroy(pipe, transfer);
 }
 
 
index de775a2dbc249064992dd47b9a66e0cadc63b364..e997cfa8a38c44a7e462979c6db13045cc39e165 100644 (file)
@@ -459,7 +459,7 @@ void debug_dump_surface(struct pipe_context *pipe,
    
    pipe->transfer_unmap(pipe, transfer);
 error:
-   pipe->tex_transfer_destroy(transfer);
+   pipe->tex_transfer_destroy(pipe, transfer);
 }
 
 
@@ -530,14 +530,15 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
                                     PIPE_TRANSFER_READ, 0, 0, surface->width,
                                     surface->height);
 
-   debug_dump_transfer_bmp(filename, transfer);
+   debug_dump_transfer_bmp(pipe, filename, transfer);
 
-   pipe->tex_transfer_destroy(transfer);
+   pipe->tex_transfer_destroy(pipe, transfer);
 #endif
 }
 
 void
-debug_dump_transfer_bmp(const char *filename,
+debug_dump_transfer_bmp(struct pipe_context *pipe,
+                        const char *filename,
                         struct pipe_transfer *transfer)
 {
 #ifndef PIPE_SUBSYSTEM_WINDOWS_MINIPORT
@@ -550,7 +551,7 @@ debug_dump_transfer_bmp(const char *filename,
    if(!rgba)
       goto error1;
 
-   pipe_get_tile_rgba(transfer, 0, 0,
+   pipe_get_tile_rgba(pipe, transfer, 0, 0,
                       transfer->width, transfer->height,
                       rgba);
 
index a383837743f22292696259ead1eb8fe85c7cca78..98addeb372e282d347f0e8fc4f64a7cc8ad716aa 100644 (file)
@@ -331,7 +331,8 @@ void debug_dump_texture(struct pipe_context *pipe,
 void debug_dump_surface_bmp(struct pipe_context *pipe,
                             const char *filename,
                             struct pipe_surface *surface);
-void debug_dump_transfer_bmp(const char *filename,
+void debug_dump_transfer_bmp(struct pipe_context *pipe,
+                             const char *filename,
                              struct pipe_transfer *transfer);
 void debug_dump_float_rgba_bmp(const char *filename,
                                unsigned width, unsigned height,
index 46fbde3f4ab2712e6e0d455dd59b98914f9698c6..5c51b53d7bd7091e4cd629714480dfea64a336cf 100644 (file)
@@ -1146,8 +1146,8 @@ make_1d_mipmap(struct gen_mipmap_state *ctx,
       pipe->transfer_unmap(pipe, srcTrans);
       pipe->transfer_unmap(pipe, dstTrans);
 
-      pipe->tex_transfer_destroy(srcTrans);
-      pipe->tex_transfer_destroy(dstTrans);
+      pipe->tex_transfer_destroy(pipe, srcTrans);
+      pipe->tex_transfer_destroy(pipe, dstTrans);
    }
 }
 
@@ -1190,8 +1190,8 @@ make_2d_mipmap(struct gen_mipmap_state *ctx,
       pipe->transfer_unmap(pipe, srcTrans);
       pipe->transfer_unmap(pipe, dstTrans);
 
-      pipe->tex_transfer_destroy(srcTrans);
-      pipe->tex_transfer_destroy(dstTrans);
+      pipe->tex_transfer_destroy(pipe, srcTrans);
+      pipe->tex_transfer_destroy(pipe, dstTrans);
    }
 }
 
@@ -1235,8 +1235,8 @@ make_3d_mipmap(struct gen_mipmap_state *ctx,
       pipe->transfer_unmap(pipe, srcTrans);
       pipe->transfer_unmap(pipe, dstTrans);
 
-      pipe->tex_transfer_destroy(srcTrans);
-      pipe->tex_transfer_destroy(dstTrans);
+      pipe->tex_transfer_destroy(pipe, srcTrans);
+      pipe->tex_transfer_destroy(pipe, dstTrans);
    }
 #else
    (void) reduce_3d;
index ada31b8182ebd6601d68f6333e64a638f7e9f530..e7255e3baa8bfcdf5f31f4a0adb9110bd6fa4c31 100644 (file)
@@ -264,24 +264,24 @@ pipe_buffer_read(struct pipe_screen *screen,
 }
 
 static INLINE void *
-pipe_transfer_map( struct pipe_transfer *transf )
+pipe_transfer_map( struct pipe_context *context,
+                   struct pipe_transfer *transf )
 {
-   struct pipe_context *context = transf->pipe;
    return context->transfer_map(context, transf);
 }
 
 static INLINE void
-pipe_transfer_unmap( struct pipe_transfer *transf )
+pipe_transfer_unmap( struct pipe_context *context,
+                     struct pipe_transfer *transf )
 {
-   struct pipe_context *context = transf->pipe;
    context->transfer_unmap(context, transf);
 }
 
 static INLINE void
-pipe_transfer_destroy( struct pipe_transfer *transf )
+pipe_transfer_destroy( struct pipe_context *context,
+                       struct pipe_transfer *transfer )
 {
-   struct pipe_context *context = transf->pipe;
-   context->tex_transfer_destroy(transf);
+   context->tex_transfer_destroy(context, transfer);
 }
 
 static INLINE unsigned
index 0b8405d01fdcb9e1a047ab28b4b36e6d7e9678dd..e73797f1b7e62d64a7837619a777472d9c0d0f71 100644 (file)
@@ -223,8 +223,8 @@ util_surface_copy(struct pipe_context *pipe,
    pipe->transfer_unmap(pipe, src_trans);
    pipe->transfer_unmap(pipe, dst_trans);
 
-   pipe->tex_transfer_destroy(src_trans);
-   pipe->tex_transfer_destroy(dst_trans);
+   pipe->tex_transfer_destroy(pipe, src_trans);
+   pipe->tex_transfer_destroy(pipe, dst_trans);
 }
 
 
@@ -301,5 +301,5 @@ util_surface_fill(struct pipe_context *pipe,
    }
 
    pipe->transfer_unmap(pipe, dst_trans);
-   pipe->tex_transfer_destroy(dst_trans);
+   pipe->tex_transfer_destroy(pipe, dst_trans);
 }
index 70a6d97385b3ee84d2ab8bc3c7bf7997a90c1360..e445895efc593fec711dcd4ecc4a5a4475ff1f3b 100644 (file)
  * Move raw block of pixels from transfer object to user memory.
  */
 void
-pipe_get_tile_raw(struct pipe_transfer *pt,
+pipe_get_tile_raw(struct pipe_context *pipe,
+                  struct pipe_transfer *pt,
                   uint x, uint y, uint w, uint h,
                   void *dst, int dst_stride)
 {
-   struct pipe_context *pipe = pt->pipe;
    const void *src;
 
    if (dst_stride == 0)
@@ -73,11 +73,11 @@ pipe_get_tile_raw(struct pipe_transfer *pt,
  * Move raw block of pixels from user memory to transfer object.
  */
 void
-pipe_put_tile_raw(struct pipe_transfer *pt,
+pipe_put_tile_raw(struct pipe_context *pipe,
+                  struct pipe_transfer *pt,
                   uint x, uint y, uint w, uint h,
                   const void *src, int src_stride)
 {
-   struct pipe_context *pipe = pt->pipe;
    void *dst;
    enum pipe_format format = pt->texture->format;
 
@@ -1246,7 +1246,8 @@ pipe_tile_raw_to_rgba(enum pipe_format format,
 
 
 void
-pipe_get_tile_rgba(struct pipe_transfer *pt,
+pipe_get_tile_rgba(struct pipe_context *pipe,
+                   struct pipe_transfer *pt,
                    uint x, uint y, uint w, uint h,
                    float *p)
 {
@@ -1265,7 +1266,7 @@ pipe_get_tile_rgba(struct pipe_transfer *pt,
    if(format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV)
       assert((x & 1) == 0);
 
-   pipe_get_tile_raw(pt, x, y, w, h, packed, 0);
+   pipe_get_tile_raw(pipe, pt, x, y, w, h, packed, 0);
 
    pipe_tile_raw_to_rgba(format, packed, w, h, p, dst_stride);
 
@@ -1274,7 +1275,8 @@ pipe_get_tile_rgba(struct pipe_transfer *pt,
 
 
 void
-pipe_put_tile_rgba(struct pipe_transfer *pt,
+pipe_put_tile_rgba(struct pipe_context *pipe,
+                   struct pipe_transfer *pt,
                    uint x, uint y, uint w, uint h,
                    const float *p)
 {
@@ -1363,7 +1365,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt,
                            0, 0, w, h);
    }
 
-   pipe_put_tile_raw(pt, x, y, w, h, packed, 0);
+   pipe_put_tile_raw(pipe, pt, x, y, w, h, packed, 0);
 
    FREE(packed);
 }
@@ -1373,11 +1375,11 @@ pipe_put_tile_rgba(struct pipe_transfer *pt,
  * Get a block of Z values, converted to 32-bit range.
  */
 void
-pipe_get_tile_z(struct pipe_transfer *pt,
+pipe_get_tile_z(struct pipe_context *pipe,
+                struct pipe_transfer *pt,
                 uint x, uint y, uint w, uint h,
                 uint *z)
 {
-   struct pipe_context *pipe = pt->pipe;
    const uint dstStride = w;
    ubyte *map;
    uint *pDest = z;
@@ -1458,11 +1460,11 @@ pipe_get_tile_z(struct pipe_transfer *pt,
 
 
 void
-pipe_put_tile_z(struct pipe_transfer *pt,
+pipe_put_tile_z(struct pipe_context *pipe,
+                struct pipe_transfer *pt,
                 uint x, uint y, uint w, uint h,
                 const uint *zSrc)
 {
-   struct pipe_context *pipe = pt->pipe;
    const uint srcStride = w;
    const uint *ptrc = zSrc;
    ubyte *map;
index 1453af38b8a2aefc977927c1d3d92fe97d06d6c2..8329087cfa6f0da649be66e4f2d60fc9a97dcbd8 100644 (file)
@@ -56,34 +56,40 @@ extern "C" {
 #endif
 
 void
-pipe_get_tile_raw(struct pipe_transfer *pt,
+pipe_get_tile_raw(struct pipe_context *pipe,
+                  struct pipe_transfer *pt,
                   uint x, uint y, uint w, uint h,
                   void *p, int dst_stride);
 
 void
-pipe_put_tile_raw(struct pipe_transfer *pt,
+pipe_put_tile_raw(struct pipe_context *pipe,
+                  struct pipe_transfer *pt,
                   uint x, uint y, uint w, uint h,
                   const void *p, int src_stride);
 
 
 void
-pipe_get_tile_rgba(struct pipe_transfer *pt,
+pipe_get_tile_rgba(struct pipe_context *pipe,
+                   struct pipe_transfer *pt,
                    uint x, uint y, uint w, uint h,
                    float *p);
 
 void
-pipe_put_tile_rgba(struct pipe_transfer *pt,
+pipe_put_tile_rgba(struct pipe_context *pipe,
+                   struct pipe_transfer *pt,
                    uint x, uint y, uint w, uint h,
                    const float *p);
 
 
 void
-pipe_get_tile_z(struct pipe_transfer *pt,
+pipe_get_tile_z(struct pipe_context *pipe,
+                struct pipe_transfer *pt,
                 uint x, uint y, uint w, uint h,
                 uint *z);
 
 void
-pipe_put_tile_z(struct pipe_transfer *pt,
+pipe_put_tile_z(struct pipe_context *pipe,
+                struct pipe_transfer *pt,
                 uint x, uint y, uint w, uint h,
                 const uint *z);
 
index dcc0014479f289a008873016f54aaa2717f202a1..beb4722901e504a32e0179314ecebdbea75c8df4 100644 (file)
@@ -700,7 +700,7 @@ xfer_buffers_unmap(struct vl_mpeg12_mc_renderer *r)
 
    for (i = 0; i < 3; ++i) {
       r->pipe->transfer_unmap(r->pipe, r->tex_transfer[i]);
-      r->pipe->tex_transfer_destroy(r->tex_transfer[i]);
+      r->pipe->tex_transfer_destroy(r->pipe, r->tex_transfer[i]);
    }
 }
 
index 3435f7797fbe2c797d07aea4fac6414271182fcc..b252fb5330cc402faed2fa7981c2d1c0659475ff 100644 (file)
@@ -825,7 +825,6 @@ i915_get_tex_transfer(struct pipe_context *pipe,
    trans = CALLOC_STRUCT(i915_transfer);
    if (trans) {
       pipe_texture_reference(&trans->base.texture, texture);
-      trans->base.pipe = pipe;
       trans->base.x = x;
       trans->base.y = y;
       trans->base.width = w;
@@ -869,7 +868,8 @@ i915_transfer_unmap(struct pipe_context *pipe,
 }
 
 static void
-i915_tex_transfer_destroy(struct pipe_transfer *trans)
+i915_tex_transfer_destroy(struct pipe_context *pipe,
+                          struct pipe_transfer *trans)
 {
    pipe_texture_reference(&trans->texture, NULL);
    FREE(trans);
index 23e052d0b91f494ef1b75c27ae7c61f3fb508e1d..e3a7c64d489c14cfd91f1a4e9822387f44d48500 100644 (file)
@@ -202,4 +202,5 @@ boolean brw_is_buffer_referenced_by_bo( struct brw_screen *brw_screen,
                                         struct brw_winsys_buffer *bo );
 
 
+
 #endif /* BRW_SCREEN_H */
index 52bf9b3c1c693dbfab702d639a46de037bf57fdd..cadcb7cee2a33142cb84a2c8cc9f3be5abc2a4ca 100644 (file)
@@ -504,7 +504,6 @@ brw_get_tex_transfer(struct pipe_context *pipe,
    trans = CALLOC_STRUCT(brw_transfer);
    if (trans) {
       pipe_texture_reference(&trans->base.texture, texture);
-      trans->base.pipe = pipe;
       trans->base.x = x;
       trans->base.y = y;
       trans->base.width = w;
@@ -554,7 +553,8 @@ brw_transfer_unmap(struct pipe_context *pipe,
 }
 
 static void
-brw_tex_transfer_destroy(struct pipe_transfer *trans)
+brw_tex_transfer_destroy(struct pipe_context *pipe,
+                         struct pipe_transfer *trans)
 {
    pipe_texture_reference(&trans->texture, NULL);
    FREE(trans);
index 5e371c47c81cb3ca237c29b59db2e1a84bc8a331..26770d6b1e9ff1bf598e520cc2564ca1573402e1 100644 (file)
@@ -748,9 +748,11 @@ identity_context_get_tex_transfer(struct pipe_context *_context,
 }
 
 static void
-identity_context_tex_transfer_destroy(struct pipe_transfer *_transfer)
+identity_context_tex_transfer_destroy(struct pipe_context *_pipe,
+                                      struct pipe_transfer *_transfer)
 {
-   identity_transfer_destroy(identity_transfer(_transfer));
+   identity_transfer_destroy(identity_context(_pipe),
+                             identity_transfer(_transfer));
 }
 
 static void *
index 91831404b8b0d554349f4bfa7e7ca6423c8dc858..d37fb0042e54a2c6d46dfb1d2a6fb704ddb4236a 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "id_screen.h"
 #include "id_objects.h"
+#include "id_context.h"
 
 struct pipe_buffer *
 identity_buffer_create(struct identity_screen *id_screen,
@@ -160,22 +161,25 @@ identity_transfer_create(struct identity_context *id_context,
    memcpy(&id_transfer->base, transfer, sizeof(struct pipe_transfer));
 
    id_transfer->base.texture = NULL;
-   pipe_texture_reference(&id_transfer->base.texture, &id_texture->base);
    id_transfer->transfer = transfer;
+
+   pipe_texture_reference(&id_transfer->base.texture, &id_texture->base);
    assert(id_transfer->base.texture == &id_texture->base);
 
    return &id_transfer->base;
 
 error:
-   transfer->pipe->tex_transfer_destroy(transfer);
+   id_context->pipe->tex_transfer_destroy(id_context->pipe, transfer);
    return NULL;
 }
 
 void
-identity_transfer_destroy(struct identity_transfer *id_transfer)
+identity_transfer_destroy(struct identity_context *id_context,
+                          struct identity_transfer *id_transfer)
 {
    pipe_texture_reference(&id_transfer->base.texture, NULL);
-   id_transfer->transfer->pipe->tex_transfer_destroy(id_transfer->transfer);
+   id_context->pipe->tex_transfer_destroy(id_context->pipe,
+                                          id_transfer->transfer);
    FREE(id_transfer);
 }
 
index 3c4e6d3f8c458cd8d7fde721a2bb4060854ee119..7333ecfb7fb7370217577282889d19a6b7e238e7 100644 (file)
@@ -65,6 +65,7 @@ struct identity_transfer
 {
    struct pipe_transfer base;
 
+   struct pipe_context *pipe;
    struct pipe_transfer *transfer;
 };
 
@@ -183,7 +184,8 @@ identity_transfer_create(struct identity_context *id_context,
                          struct pipe_transfer *transfer);
 
 void
-identity_transfer_destroy(struct identity_transfer *id_transfer);
+identity_transfer_destroy(struct identity_context *id_context,
+                          struct identity_transfer *id_transfer);
 
 struct pipe_video_surface *
 identity_video_surface_create(struct identity_screen *id_screen,
index bfe53d4106cf269e35f950aa96d7f8e6568ba9f3..505cb21503a34d6874e58f629ca3917463094e38 100644 (file)
@@ -477,7 +477,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
         pipe->transfer_unmap(pipe, scene->cbuf_transfer[i]);
 
       if (scene->cbuf_transfer[i])
-        pipe->tex_transfer_destroy(scene->cbuf_transfer[i]);
+        pipe->tex_transfer_destroy(pipe, scene->cbuf_transfer[i]);
 
       scene->cbuf_transfer[i] = NULL;
       scene->cbuf_map[i] = NULL;
@@ -487,7 +487,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
       pipe->transfer_unmap(pipe, scene->zsbuf_transfer);
 
    if (scene->zsbuf_transfer)
-      pipe->tex_transfer_destroy(scene->zsbuf_transfer);
+      pipe->tex_transfer_destroy(pipe, scene->zsbuf_transfer);
 
    scene->zsbuf_transfer = NULL;
    scene->zsbuf_map = NULL;
index 65f7994e0e062a361da18129d55d2682c4294103..f2c6dbd088ab60488a37a1e0fa76cf4a92b64ec5 100644 (file)
@@ -294,7 +294,8 @@ llvmpipe_get_tex_transfer(struct pipe_context *pipe,
 
 
 static void 
-llvmpipe_tex_transfer_destroy(struct pipe_transfer *transfer)
+llvmpipe_tex_transfer_destroy(struct pipe_context *pipe,
+                              struct pipe_transfer *transfer)
 {
    /* Effectively do the texture_update work here - if texture images
     * needed post-processing to put them into hardware layout, this is
index 1318c60ae44e9fe069cda6d70b592b190ddf3025..cfc109bb74062b48bf1e98a4584860f183eb7d2e 100644 (file)
@@ -118,12 +118,13 @@ nv30_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt,
 }
 
 static void
-nv30_transfer_del(struct pipe_transfer *ptx)
+nv30_transfer_del(struct pipe_context *pcontext,
+                  struct pipe_transfer *ptx)
 {
        struct nv30_transfer *tx = (struct nv30_transfer *)ptx;
 
        if (!tx->direct && (ptx->usage & PIPE_TRANSFER_WRITE)) {
-               struct pipe_screen *pscreen = ptx->texture->screen;
+               struct pipe_screen *pscreen = pcontext->screen;
                struct nv30_screen *nvscreen = nv30_screen(pscreen);
                struct pipe_surface *dst;
 
index 2ca9b9438894134fab061b6f94afcca80132e532..c552a681138096bb3e8278d99652f8948b2c1d2c 100644 (file)
@@ -118,12 +118,12 @@ nv40_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt,
 }
 
 static void
-nv40_transfer_del(struct pipe_transfer *ptx)
+nv40_transfer_del(struct pipe_context *pcontext, struct pipe_transfer *ptx)
 {
        struct nv40_transfer *tx = (struct nv40_transfer *)ptx;
 
        if (!tx->direct && (ptx->usage & PIPE_TRANSFER_WRITE)) {
-               struct pipe_screen *pscreen = ptx->texture->screen;
+               struct pipe_screen *pscreen = pcontext->screen;
                struct nv40_screen *nvscreen = nv40_screen(pscreen);
                struct pipe_surface *dst;
 
index b7f2ac1b1cc3195a1389fb7b6f295376f021dc2f..9eb223eca65583415652eb8e478cd40fcdc72758 100644 (file)
@@ -187,7 +187,7 @@ nv50_transfer_new(struct pipe_context *pcontext, struct pipe_texture *pt,
 }
 
 static void
-nv50_transfer_del(struct pipe_transfer *ptx)
+nv50_transfer_del(struct pipe_context *pcontext, struct pipe_transfer *ptx)
 {
        struct nv50_transfer *tx = (struct nv50_transfer *)ptx;
        struct nv50_miptree *mt = nv50_miptree(ptx->texture);
@@ -197,7 +197,7 @@ nv50_transfer_del(struct pipe_transfer *ptx)
        unsigned ny = util_format_get_nblocksy(pt->format, tx->base.height);
 
        if (ptx->usage & PIPE_TRANSFER_WRITE) {
-               struct pipe_screen *pscreen = pt->screen;
+               struct pipe_screen *pscreen = pcontext->screen;
 
                nv50_transfer_rect_m2mf(pscreen, tx->bo, 0,
                                        tx->base.stride, tx->bo->tile_mode,
index 69c0ab496c8af5827ca02669dbd22b3a3dfaf801..64d1909a382770ce951c859643bf98f8ce895626 100644 (file)
@@ -251,8 +251,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen,
     return retval == usage;
 }
 
-
-
 static void r300_destroy_screen(struct pipe_screen* pscreen)
 {
     struct r300_screen* r300screen = r300_screen(pscreen);
index 7dd707ff8eff55e2fd1e138b2b48750a58bd6b68..495e3dee7671ea02b3949f1fb8c86dec42624ec8 100644 (file)
@@ -205,7 +205,8 @@ r300_get_tex_transfer(struct pipe_context *ctx,
     return &trans->transfer;
 }
 
-static void r300_tex_transfer_destroy(struct pipe_transfer *trans)
+static void r300_tex_transfer_destroy(struct pipe_context *ctx,
+                                      struct pipe_transfer *trans)
 {
     struct r300_transfer *r300transfer = r300_transfer(trans);
 
index a9f5b51a41b2e99c677f0c711665443113c45f08..e3a5e37ce442c3973c9d0cf78e49c1d7a6758f09 100644 (file)
@@ -69,10 +69,10 @@ sp_destroy_tex_tile_cache(struct softpipe_tex_tile_cache *tc)
       /*assert(tc->entries[pos].x < 0);*/
    }
    if (tc->transfer) {
-      tc->pipe->tex_transfer_destroy(tc->transfer);
+      tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer);
    }
    if (tc->tex_trans) {
-      tc->pipe->tex_transfer_destroy(tc->tex_trans);
+      tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
    }
 
    FREE( tc );
@@ -135,7 +135,7 @@ sp_tex_tile_cache_set_texture(struct softpipe_tex_tile_cache *tc,
             tc->tex_trans_map = NULL;
          }
 
-         tc->pipe->tex_transfer_destroy(tc->tex_trans);
+         tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
          tc->tex_trans = NULL;
       }
 
@@ -230,7 +230,7 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
                tc->tex_trans_map = NULL;
             }
 
-            tc->pipe->tex_transfer_destroy(tc->tex_trans);
+            tc->pipe->tex_transfer_destroy(tc->pipe, tc->tex_trans);
             tc->tex_trans = NULL;
          }
 
@@ -251,7 +251,8 @@ sp_find_cached_tile_tex(struct softpipe_tex_tile_cache *tc,
       }
 
       /* get tile from the transfer (view into texture) */
-      pipe_get_tile_rgba(tc->tex_trans,
+      pipe_get_tile_rgba(tc->pipe,
+                         tc->tex_trans,
                          addr.bits.x * TILE_SIZE, 
                          addr.bits.y * TILE_SIZE,
                          TILE_SIZE, TILE_SIZE,
index adae48c474ec081b530f406dd2b03e6768576d63..da8529c154e9cc7852a9337812d352df8b36a781 100644 (file)
@@ -277,7 +277,6 @@ softpipe_get_tex_transfer(struct pipe_context *pipe,
       struct pipe_transfer *pt = &spt->base;
       int nblocksy = util_format_get_nblocksy(texture->format, u_minify(texture->height0, level));
       pipe_texture_reference(&pt->texture, texture);
-      pt->pipe = pipe;
       pt->x = x;
       pt->y = y;
       pt->width = w;
@@ -311,7 +310,8 @@ softpipe_get_tex_transfer(struct pipe_context *pipe,
  * softpipe_get_tex_transfer().
  */
 static void 
-softpipe_tex_transfer_destroy(struct pipe_transfer *transfer)
+softpipe_tex_transfer_destroy(struct pipe_context *pipe,
+                              struct pipe_transfer *transfer)
 {
    /* Effectively do the texture_update work here - if texture images
     * needed post-processing to put them into hardware layout, this is
index d779816790aebc6982f4d7fc2ca91461b9a0b3eb..1c3c2667d732499796f1a7ae6a278999f5044116 100644 (file)
@@ -121,7 +121,7 @@ sp_destroy_tile_cache(struct softpipe_tile_cache *tc)
       /*assert(tc->entries[pos].x < 0);*/
    }
    if (tc->transfer) {
-      tc->pipe->tex_transfer_destroy(tc->transfer);
+      tc->pipe->tex_transfer_destroy(tc->pipe, tc->transfer);
    }
 
    FREE( tc );
@@ -146,7 +146,7 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
          tc->transfer_map = NULL;
       }
 
-      pipe->tex_transfer_destroy(tc->transfer);
+      pipe->tex_transfer_destroy(pipe, tc->transfer);
       tc->transfer = NULL;
    }
 
@@ -291,7 +291,8 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc)
          union tile_address addr = tile_address(x, y);
 
          if (is_clear_flag_set(tc->clear_flags, addr)) {
-            pipe_put_tile_raw(pt,
+            pipe_put_tile_raw(tc->pipe,
+                              pt,
                               x, y, TILE_SIZE, TILE_SIZE,
                               tc->tile.data.color32, 0/*STRIDE*/);
 
@@ -325,14 +326,14 @@ sp_flush_tile_cache(struct softpipe_tile_cache *tc)
          struct softpipe_cached_tile *tile = tc->entries + pos;
          if (!tile->addr.bits.invalid) {
             if (tc->depth_stencil) {
-               pipe_put_tile_raw(pt,
+               pipe_put_tile_raw(tc->pipe, pt,
                                  tile->addr.bits.x * TILE_SIZE, 
                                  tile->addr.bits.y * TILE_SIZE, 
                                  TILE_SIZE, TILE_SIZE,
                                  tile->data.depth32, 0/*STRIDE*/);
             }
             else {
-               pipe_put_tile_rgba(pt,
+               pipe_put_tile_rgba(tc->pipe, pt,
                                   tile->addr.bits.x * TILE_SIZE, 
                                   tile->addr.bits.y * TILE_SIZE, 
                                   TILE_SIZE, TILE_SIZE,
@@ -375,14 +376,14 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
       if (tile->addr.bits.invalid == 0) {
          /* put dirty tile back in framebuffer */
          if (tc->depth_stencil) {
-            pipe_put_tile_raw(pt,
+            pipe_put_tile_raw(tc->pipe, pt,
                               tile->addr.bits.x * TILE_SIZE,
                               tile->addr.bits.y * TILE_SIZE,
                               TILE_SIZE, TILE_SIZE,
                               tile->data.depth32, 0/*STRIDE*/);
          }
          else {
-            pipe_put_tile_rgba(pt,
+            pipe_put_tile_rgba(tc->pipe, pt,
                                tile->addr.bits.x * TILE_SIZE,
                                tile->addr.bits.y * TILE_SIZE,
                                TILE_SIZE, TILE_SIZE,
@@ -405,14 +406,14 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc,
       else {
          /* get new tile data from transfer */
          if (tc->depth_stencil) {
-            pipe_get_tile_raw(pt,
+            pipe_get_tile_raw(tc->pipe, pt,
                               tile->addr.bits.x * TILE_SIZE, 
                               tile->addr.bits.y * TILE_SIZE, 
                               TILE_SIZE, TILE_SIZE,
                               tile->data.depth32, 0/*STRIDE*/);
          }
          else {
-            pipe_get_tile_rgba(pt,
+            pipe_get_tile_rgba(tc->pipe, pt,
                                tile->addr.bits.x * TILE_SIZE, 
                                tile->addr.bits.y * TILE_SIZE,
                                TILE_SIZE, TILE_SIZE,
index 065b8748a32297b6aa3c47fd125f0ff356460701..107e4a39620cdcf5e3087a994cd1b299fe4b0798 100644 (file)
@@ -899,10 +899,11 @@ svga_transfer_unmap(struct pipe_context *pipe,
 
 
 static void
-svga_tex_transfer_destroy(struct pipe_transfer *transfer)
+svga_tex_transfer_destroy(struct pipe_context *pipe,
+                          struct pipe_transfer *transfer)
 {
    struct svga_texture *tex = svga_texture(transfer->texture);
-   struct svga_screen *ss = svga_screen(transfer->texture->screen);
+   struct svga_screen *ss = svga_screen(pipe->screen);
    struct svga_winsys_screen *sws = ss->sws;
    struct svga_transfer *st = svga_transfer(transfer);
 
index 4a0e9ac17dda09d75e2734faa27de17052b28cec..b7e6bbac68ec2411ad2c04f266ca0ec10c8dd11f 100644 (file)
@@ -1336,11 +1336,12 @@ trace_context_get_tex_transfer(struct pipe_context *_context,
 
 
 static void
-trace_context_tex_transfer_destroy(struct pipe_transfer *_transfer)
+trace_context_tex_transfer_destroy(struct pipe_context *_context,
+                                   struct pipe_transfer *_transfer)
 {
-   struct trace_context *tr_ctx = trace_context(_transfer->pipe);
+   struct trace_context *tr_context = trace_context(_context);
    struct trace_transfer *tr_trans = trace_transfer(_transfer);
-   struct pipe_context *context = tr_ctx->pipe;
+   struct pipe_context *context = tr_context->pipe;
    struct pipe_transfer *transfer = tr_trans->transfer;
 
    trace_dump_call_begin("pipe_context", "tex_transfer_destroy");
@@ -1350,7 +1351,7 @@ trace_context_tex_transfer_destroy(struct pipe_transfer *_transfer)
 
    trace_dump_call_end();
 
-   trace_transfer_destroy(tr_trans);
+   trace_transfer_destroy(tr_context, tr_trans);
 }
 
 
index b36865400de768bdbcdf1ab790ea9d9d01910eda..f4f17566fd34b6e5447fbc8463ec5f8509142830 100644 (file)
@@ -257,7 +257,7 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header,
                                 NULL);
 
    context->transfer_unmap(context, t);
-   context->tex_transfer_destroy(t);
+   context->tex_transfer_destroy(context, t);
 
    pipe_mutex_unlock(tr_scr->list_mutex);
 
index b70ccb9ce85f840f0307f462fbd6dafb2559f90e..d818e21bb8214e65dc815678f46f410decba2ef0 100644 (file)
@@ -143,10 +143,10 @@ trace_transfer_create(struct trace_context *tr_ctx,
 
    memcpy(&tr_trans->base, transfer, sizeof(struct pipe_transfer));
 
-   tr_trans->base.pipe = &tr_ctx->base;
    tr_trans->base.texture = NULL;
-   pipe_texture_reference(&tr_trans->base.texture, &tr_tex->base);
    tr_trans->transfer = transfer;
+
+   pipe_texture_reference(&tr_trans->base.texture, &tr_tex->base);
    assert(tr_trans->base.texture == &tr_tex->base);
 
    trace_screen_add_to_list(tr_scr, transfers, tr_trans);
@@ -154,21 +154,23 @@ trace_transfer_create(struct trace_context *tr_ctx,
    return &tr_trans->base;
 
 error:
-   tr_ctx->pipe->tex_transfer_destroy(transfer);
+   tr_ctx->pipe->tex_transfer_destroy(tr_ctx->pipe, transfer);
    return NULL;
 }
 
 
 void
-trace_transfer_destroy(struct trace_transfer *tr_trans)
+trace_transfer_destroy(struct trace_context *tr_context,
+                       struct trace_transfer *tr_trans)
 {
-   struct trace_screen *tr_scr = trace_screen(tr_trans->base.texture->screen);
-   struct pipe_context *context = tr_trans->transfer->pipe;
+   struct trace_screen *tr_scr = trace_screen(tr_context->base.screen);
+   struct pipe_context *context = tr_context->pipe;
+   struct pipe_transfer *transfer = tr_trans->transfer;
 
    trace_screen_remove_from_list(tr_scr, transfers, tr_trans);
 
    pipe_texture_reference(&tr_trans->base.texture, NULL);
-   context->tex_transfer_destroy(tr_trans->transfer);
+   context->tex_transfer_destroy(context, transfer);
    FREE(tr_trans);
 }
 
index ab284eeef30730ddca4b297d703af2147d0e5c7a..4dc95308a79eda1c69b3fe688d7ac67399f81941 100644 (file)
@@ -61,6 +61,7 @@ struct trace_transfer
    struct pipe_transfer base;
 
    struct pipe_transfer *transfer;
+   struct pipe_context *pipe;
 
    struct tr_list list;
 
@@ -118,7 +119,8 @@ trace_transfer_create(struct trace_context *tr_ctx,
                      struct pipe_transfer *transfer);
 
 void
-trace_transfer_destroy(struct trace_transfer *tr_trans);
+trace_transfer_destroy(struct trace_context *tr_ctx,
+                       struct trace_transfer *tr_trans);
 
 
 #endif /* TR_TEXTURE_H_ */
index 494b53e912829384f1e177cfdb1a57f942ecc89c..a7f12fb81e16513c092264857efcdb5874bb9af5 100644 (file)
@@ -323,7 +323,8 @@ struct pipe_context {
                                              unsigned x, unsigned y,
                                              unsigned w, unsigned h);
 
-   void (*tex_transfer_destroy)(struct pipe_transfer *);
+   void (*tex_transfer_destroy)(struct pipe_context *,
+                                struct pipe_transfer *);
    
    void *(*transfer_map)( struct pipe_context *,
                           struct pipe_transfer *transfer );
index 2af933207d168257d4d12aabd4f1fcc07d4b18cf..3a97d888ce63fbc1b441aeb9175d689a3016d86b 100644 (file)
@@ -304,8 +304,6 @@ struct pipe_surface
  */
 struct pipe_transfer
 {
-   struct pipe_context *pipe;
-
    unsigned x;                   /**< x offset from start of texture image */
    unsigned y;                   /**< y offset from start of texture image */
    unsigned width;               /**< logical width in pixels */
index 6e79dd370f581ab0093d9eee9d3cd83478b28cb7..18e2cc1f2501fa96050d1f43b5df29867b41f0ae 100644 (file)
@@ -85,7 +85,7 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx,
       void *map = pipe->transfer_map(pipe, transfer);
       memcpy(map, color_data, sizeof(VGint)*color_data_len);
       pipe->transfer_unmap(pipe, transfer);
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
 
    return tex;
index 432ba681394ef9dbd68af3cf55d387cc605295e6..fec473d9d23c3e9ce844eb846a2ef6d5b7bb4969 100644 (file)
@@ -450,14 +450,14 @@ void vgReadPixels(void * data, VGint dataStride,
 #if 0
          debug_printf("%d-%d  == %d\n", sy, height, y);
 #endif
-         pipe_get_tile_rgba(transfer, sx, y, width, 1, df);
+         pipe_get_tile_rgba(pipe, transfer, sx, y, width, 1, df);
          y += yStep;
          _vega_pack_rgba_span_float(ctx, width, temp, dataFormat,
                                     dst + yoffset + xoffset);
          dst += dataStride;
       }
 
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
 }
 
index 604a86aeb857f71630c5bd669da90a1a395db930..a71579cd2642807d095a879107b6886c30434a92 100644 (file)
@@ -418,11 +418,11 @@ void image_sub_data(struct vg_image *image,
       src += (dataStride * yoffset);
       for (i = 0; i < height; i++) {
          _vega_unpack_float_span_rgba(ctx, width, xoffset, src, dataFormat, temp);
-         pipe_put_tile_rgba(transfer, x+image->x, y+image->y, width, 1, df);
+         pipe_put_tile_rgba(pipe, transfer, x+image->x, y+image->y, width, 1, df);
          y += yStep;
          src += dataStride;
       }
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
 }
 
@@ -454,13 +454,13 @@ void image_get_sub_data(struct vg_image * image,
 #if 0
          debug_printf("%d-%d  == %d\n", sy, height, y);
 #endif
-         pipe_get_tile_rgba(transfer, sx+image->x, y, width, 1, df);
+         pipe_get_tile_rgba(pipe, transfer, sx+image->x, y, width, 1, df);
          y += yStep;
          _vega_pack_rgba_span_float(ctx, width, temp, dataFormat, dst);
          dst += dataStride;
       }
 
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
 }
 
index 47a7710d3e29bd113299a067b28a8f2c60b96987..dc56b8c5f3b8094b418a8f27a360981954f61d77 100644 (file)
@@ -167,7 +167,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
       void *map = pipe->transfer_map(pipe, transfer);
       memcpy(map, p->gradient.color_data, sizeof(VGint)*1024);
       pipe->transfer_unmap(pipe, transfer);
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
    }
 
    return tex;
index b066f5c94b7a800811a78182375a08d884b2ceff..b446b2079cf172a5bf91fae8eaa53a558711b466 100644 (file)
@@ -172,7 +172,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt)
    }
 
    pipe->transfer_unmap(pipe, transfer);
-   pipe->tex_transfer_destroy(transfer);
+   pipe->tex_transfer_destroy(pipe, transfer);
 }
 
 
index 69a96e5d10c3f0a61fdcc7a33c195c30cca8598a..01aba3e3dd43863cd342170c809c417e3d8048b7 100644 (file)
@@ -144,7 +144,7 @@ accum_accum(struct st_context *st, GLfloat value,
 
    buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -165,7 +165,7 @@ accum_accum(struct st_context *st, GLfloat value,
    }
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->tex_transfer_destroy(pipe, color_trans);
 }
 
 
@@ -192,7 +192,7 @@ accum_load(struct st_context *st, GLfloat value,
 
    buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-   pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -213,7 +213,7 @@ accum_load(struct st_context *st, GLfloat value,
    }
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->tex_transfer_destroy(pipe, color_trans);
 }
 
 
@@ -248,7 +248,7 @@ accum_return(GLcontext *ctx, GLfloat value,
                                                width, height);
 
    if (usage & PIPE_TRANSFER_READ)
-      pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf);
+      pipe_get_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    switch (acc_strb->format) {
    case PIPE_FORMAT_R16G16B16A16_SNORM:
@@ -277,10 +277,10 @@ accum_return(GLcontext *ctx, GLfloat value,
       _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()");
    }
 
-   pipe_put_tile_rgba(color_trans, 0, 0, width, height, buf);
+   pipe_put_tile_rgba(pipe, color_trans, 0, 0, width, height, buf);
 
    free(buf);
-   pipe->tex_transfer_destroy(color_trans);
+   pipe->tex_transfer_destroy(pipe, color_trans);
 }
 
 
index 723c5f180b719cc17adfe0154c042b4f899c26af..dfd8925edf4d66d2c6487d23d7aadeed4487b280 100644 (file)
@@ -295,7 +295,7 @@ make_bitmap_texture(GLcontext *ctx, GLsizei width, GLsizei height,
 
    /* Release transfer */
    pipe->transfer_unmap(pipe, transfer);
-   pipe->tex_transfer_destroy(transfer);
+   pipe->tex_transfer_destroy(pipe, transfer);
 
    return pt;
 }
@@ -530,7 +530,7 @@ reset_cache(struct st_context *st)
    cache->ymax = -1000000;
 
    if (cache->trans) {
-      pipe->tex_transfer_destroy(cache->trans);
+      pipe->tex_transfer_destroy(pipe, cache->trans);
       cache->trans = NULL;
    }
 
@@ -616,7 +616,7 @@ st_flush_bitmap_cache(struct st_context *st)
             pipe->transfer_unmap(pipe, cache->trans);
             cache->buffer = NULL;
 
-            pipe->tex_transfer_destroy(cache->trans);
+            pipe->tex_transfer_destroy(pipe, cache->trans);
             cache->trans = NULL;
          }
 
@@ -836,7 +836,7 @@ st_destroy_bitmap(struct st_context *st)
    if (cache) {
       if (cache->trans) {
          pipe->transfer_unmap(pipe, cache->trans);
-         pipe->tex_transfer_destroy(cache->trans);
+         pipe->tex_transfer_destroy(pipe, cache->trans);
       }
       pipe_texture_reference(&st->bitmap.cache->texture, NULL);
       free(st->bitmap.cache);
index 3fa6d12f1c33edfef168e51c1ce94559469f13c3..c44d0fc3e86e87a291713b04d613a2227c776ca0 100644 (file)
@@ -411,7 +411,7 @@ make_texture(struct st_context *st,
 
       /* unmap */
       pipe->transfer_unmap(pipe, transfer);
-      pipe->tex_transfer_destroy(transfer);
+      pipe->tex_transfer_destroy(pipe, transfer);
 
       assert(success);
 
@@ -791,7 +791,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
 
    /* unmap the stencil buffer */
    pipe->transfer_unmap(pipe, pt);
-   pipe->tex_transfer_destroy(pt);
+   pipe->tex_transfer_destroy(pipe, pt);
 }
 
 
@@ -944,7 +944,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
 
    /* unmap the stencil buffer */
    pipe->transfer_unmap(pipe, ptDraw);
-   pipe->tex_transfer_destroy(ptDraw);
+   pipe->tex_transfer_destroy(pipe, ptDraw);
 }
 
 
@@ -1113,21 +1113,21 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
          /* alternate path using get/put_tile() */
          GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
 
-         pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf);
-         pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf);
+         pipe_get_tile_rgba(pipe, ptRead, 0, 0, width, height, buf);
+         pipe_put_tile_rgba(pipe, ptTex, 0, 0, width, height, buf);
 
          free(buf);
       }
       else {
          /* GL_DEPTH */
          GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
-         pipe_get_tile_z(ptRead, 0, 0, width, height, buf);
-         pipe_put_tile_z(ptTex, 0, 0, width, height, buf);
+         pipe_get_tile_z(pipe, ptRead, 0, 0, width, height, buf);
+         pipe_put_tile_z(pipe, ptTex, 0, 0, width, height, buf);
          free(buf);
       }
 
-      pipe->tex_transfer_destroy(ptRead);
-      pipe->tex_transfer_destroy(ptTex);
+      pipe->tex_transfer_destroy(pipe, ptRead);
+      pipe->tex_transfer_destroy(pipe, ptTex);
    }
 
    /* draw textured quad */
index 98ccda821c68e07b841c9d38c2f113e41df9058a..080a5f9bfb832ee457bc64b2e706d4927abe548e 100644 (file)
@@ -162,7 +162,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
 
    /* unmap the stencil buffer */
    pipe->transfer_unmap(pipe, pt);
-   pipe->tex_transfer_destroy(pt);
+   pipe->tex_transfer_destroy(pipe, pt);
 }
 
 
@@ -254,7 +254,7 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb,
 
       map = pipe->transfer_map(pipe, trans);
       if (!map) {
-         pipe->tex_transfer_destroy(trans);
+         pipe->tex_transfer_destroy(pipe, trans);
          return GL_FALSE;
       }
 
@@ -317,7 +317,7 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb,
       }
 
       pipe->transfer_unmap(pipe, trans);
-      pipe->tex_transfer_destroy(trans);
+      pipe->tex_transfer_destroy(pipe, trans);
    }
 
    return GL_TRUE;
@@ -441,7 +441,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
                GLuint ztemp[MAX_WIDTH];
                GLfloat zfloat[MAX_WIDTH];
                const double scale = 1.0 / ((1 << 24) - 1);
-               pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0);
+               pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
                y += yStep;
                for (j = 0; j < width; j++) {
                   zfloat[j] = (float) (scale * (ztemp[j] & 0xffffff));
@@ -456,7 +456,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             assert(format == GL_DEPTH_STENCIL_EXT);
             for (i = 0; i < height; i++) {
                GLuint *zshort = (GLuint *)dst;
-               pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0);
+               pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
                y += yStep;
                /* Reverse into 24/8 */
                for (j = 0; j < width; j++) {
@@ -473,7 +473,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
                GLuint ztemp[MAX_WIDTH];
                GLfloat zfloat[MAX_WIDTH];
                const double scale = 1.0 / ((1 << 24) - 1);
-               pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0);
+               pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
                y += yStep;
                for (j = 0; j < width; j++) {
                   zfloat[j] = (float) (scale * ((ztemp[j] >> 8) & 0xffffff));
@@ -487,7 +487,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             /* XXX: unreachable code -- should be before st_read_stencil_pixels */
             assert(format == GL_DEPTH_STENCIL_EXT);
             for (i = 0; i < height; i++) {
-               pipe_get_tile_raw(trans, 0, y, width, 1, dst, 0);
+               pipe_get_tile_raw(pipe, trans, 0, y, width, 1, dst, 0);
                y += yStep;
                dst += dstStride;
             }
@@ -498,7 +498,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             GLushort ztemp[MAX_WIDTH];
             GLfloat zfloat[MAX_WIDTH];
             const double scale = 1.0 / 0xffff;
-            pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0);
+            pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
             y += yStep;
             for (j = 0; j < width; j++) {
                zfloat[j] = (float) (scale * ztemp[j]);
@@ -513,7 +513,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
             GLuint ztemp[MAX_WIDTH];
             GLfloat zfloat[MAX_WIDTH];
             const double scale = 1.0 / 0xffffffff;
-            pipe_get_tile_raw(trans, 0, y, width, 1, ztemp, 0);
+            pipe_get_tile_raw(pipe, trans, 0, y, width, 1, ztemp, 0);
             y += yStep;
             for (j = 0; j < width; j++) {
                zfloat[j] = (float) (scale * ztemp[j]);
@@ -527,7 +527,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
          /* RGBA format */
          /* Do a row at a time to flip image data vertically */
          for (i = 0; i < height; i++) {
-            pipe_get_tile_rgba(trans, 0, y, width, 1, df);
+            pipe_get_tile_rgba(pipe, trans, 0, y, width, 1, df);
             y += yStep;
             df += dfStride;
             if (!dfStride) {
@@ -539,7 +539,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height,
       }
    }
 
-   pipe->tex_transfer_destroy(trans);
+   pipe->tex_transfer_destroy(pipe, trans);
 
    _mesa_unmap_pbo_dest(ctx, &clippedPacking);
 }
index 1b20b615d0fcfe721907829e9016de39b632dca9..626e6ad660d167250fc3911a5eab65ecac20736b 100644 (file)
@@ -435,7 +435,7 @@ compress_with_blit(GLcontext * ctx,
                   unpack);          /* source data packing */
 
    pipe->transfer_unmap(pipe, tex_xfer);
-   pipe->tex_transfer_destroy(tex_xfer);
+   pipe->tex_transfer_destroy(pipe, tex_xfer);
 
    /* copy / compress image */
    util_blit_pixels_tex(ctx->st->blit,
@@ -873,7 +873,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level,
             debug_printf("%s: fallback format translation\n", __FUNCTION__);
 
          /* get float[4] rgba row from surface */
-         pipe_get_tile_rgba(tex_xfer, 0, row, width, 1, rgba);
+         pipe_get_tile_rgba(pipe, tex_xfer, 0, row, width, 1, rgba);
 
          _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format,
                                     type, dest, &ctx->Pack, transferOps);
@@ -1310,11 +1310,11 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
       /* To avoid a large temp memory allocation, do copy row by row */
       for (row = 0; row < height; row++, srcY += yStep) {
          uint data[MAX_WIDTH];
-         pipe_get_tile_z(src_trans, 0, srcY, width, 1, data);
+         pipe_get_tile_z(pipe, src_trans, 0, srcY, width, 1, data);
          if (scaleOrBias) {
             _mesa_scale_and_bias_depth_uint(ctx, width, data);
          }
-         pipe_put_tile_z(stImage->transfer, 0, row, width, 1, data);
+         pipe_put_tile_z(pipe, stImage->transfer, 0, row, width, 1, data);
       }
    }
    else {
@@ -1336,7 +1336,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
          /* XXX this usually involves a lot of int/float conversion.
           * try to avoid that someday.
           */
-         pipe_get_tile_rgba(src_trans, 0, 0, width, height, tempSrc);
+         pipe_get_tile_rgba(pipe, src_trans, 0, 0, width, height, tempSrc);
 
          /* Store into texture memory.
           * Note that this does some special things such as pixel transfer
@@ -1364,7 +1364,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
    }
 
    st_texture_image_unmap(ctx->st, stImage);
-   pipe->tex_transfer_destroy(src_trans);
+   pipe->tex_transfer_destroy(pipe, src_trans);
 }
 
 
index a73b8ed8fe38d4bf3f5b23eba5d16323e12a82cb..b2521433c87a57a417c5d7358d96c8763c602a80 100644 (file)
@@ -163,8 +163,8 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target,
       pipe->transfer_unmap(pipe, srcTrans);
       pipe->transfer_unmap(pipe, dstTrans);
 
-      pipe->tex_transfer_destroy(srcTrans);
-      pipe->tex_transfer_destroy(dstTrans);
+      pipe->tex_transfer_destroy(pipe, srcTrans);
+      pipe->tex_transfer_destroy(pipe, dstTrans);
    }
 }
 
index f1eef768ebcfdfc6d88e4e7892f30abda1581a88..10a38befb41548484d2dc2db02244c4dcd0e5777 100644 (file)
@@ -217,7 +217,7 @@ st_texture_image_unmap(struct st_context *st,
 
    pipe->transfer_unmap(pipe, stImage->transfer);
 
-   pipe->tex_transfer_destroy(stImage->transfer);
+   pipe->tex_transfer_destroy(pipe, stImage->transfer);
 }
 
 
@@ -284,7 +284,7 @@ st_texture_image_data(struct st_context *st,
                      u_minify(dst->width0, level),
                       u_minify(dst->height0, level));      /* width, height */
 
-      pipe->tex_transfer_destroy(dst_transfer);
+      pipe->tex_transfer_destroy(pipe, dst_transfer);
 
       srcUB += src_image_stride;
    }