summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/trace
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/drivers/trace
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/drivers/trace')
-rw-r--r--src/gallium/drivers/trace/tr_context.c9
-rw-r--r--src/gallium/drivers/trace/tr_rbug.c2
-rw-r--r--src/gallium/drivers/trace/tr_texture.c16
-rw-r--r--src/gallium/drivers/trace/tr_texture.h4
4 files changed, 18 insertions, 13 deletions
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index 4a0e9ac17dd..b7e6bbac68e 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -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);
}
diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c
index b36865400de..f4f17566fd3 100644
--- a/src/gallium/drivers/trace/tr_rbug.c
+++ b/src/gallium/drivers/trace/tr_rbug.c
@@ -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);
diff --git a/src/gallium/drivers/trace/tr_texture.c b/src/gallium/drivers/trace/tr_texture.c
index b70ccb9ce85..d818e21bb82 100644
--- a/src/gallium/drivers/trace/tr_texture.c
+++ b/src/gallium/drivers/trace/tr_texture.c
@@ -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);
}
diff --git a/src/gallium/drivers/trace/tr_texture.h b/src/gallium/drivers/trace/tr_texture.h
index ab284eeef30..4dc95308a79 100644
--- a/src/gallium/drivers/trace/tr_texture.h
+++ b/src/gallium/drivers/trace/tr_texture.h
@@ -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_ */