summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-03-11 16:10:25 +0000
committerKeith Whitwell <[email protected]>2010-03-11 16:18:50 +0000
commitd35ecca5ee231c072687578642e0c22c6c0590b1 (patch)
tree18059c07c64142ebf5dd7b1b674e9426418f3f6b /src/gallium/auxiliary
parentb43c182f19c6291c88420fa12714f952c2b461fb (diff)
gallium: remove pipe_context member from pipe_transfer
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.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c2
-rw-r--r--src/gallium/auxiliary/util/u_debug.c11
-rw-r--r--src/gallium/auxiliary/util/u_debug.h3
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c12
-rw-r--r--src/gallium/auxiliary/util/u_inlines.h14
-rw-r--r--src/gallium/auxiliary/util/u_rect.c6
-rw-r--r--src/gallium/auxiliary/util/u_tile.c26
-rw-r--r--src/gallium/auxiliary/util/u_tile.h18
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c2
10 files changed, 53 insertions, 43 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 2cb76b25aee..1c07ab13654 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -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;
}
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index 479777e8079..38c22bf4e94 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -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);
}
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index de775a2dbc2..e997cfa8a38 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -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);
diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h
index a383837743f..98addeb372e 100644
--- a/src/gallium/auxiliary/util/u_debug.h
+++ b/src/gallium/auxiliary/util/u_debug.h
@@ -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,
diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c
index 46fbde3f4ab..5c51b53d7bd 100644
--- a/src/gallium/auxiliary/util/u_gen_mipmap.c
+++ b/src/gallium/auxiliary/util/u_gen_mipmap.c
@@ -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;
diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h
index ada31b8182e..e7255e3baa8 100644
--- a/src/gallium/auxiliary/util/u_inlines.h
+++ b/src/gallium/auxiliary/util/u_inlines.h
@@ -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
diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c
index 0b8405d01fd..e73797f1b7e 100644
--- a/src/gallium/auxiliary/util/u_rect.c
+++ b/src/gallium/auxiliary/util/u_rect.c
@@ -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);
}
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index 70a6d97385b..e445895efc5 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -45,11 +45,11 @@
* 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;
diff --git a/src/gallium/auxiliary/util/u_tile.h b/src/gallium/auxiliary/util/u_tile.h
index 1453af38b8a..8329087cfa6 100644
--- a/src/gallium/auxiliary/util/u_tile.h
+++ b/src/gallium/auxiliary/util/u_tile.h
@@ -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);
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
index dcc0014479f..beb4722901e 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
@@ -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]);
}
}