summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/trace
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-08-11 00:15:07 +0100
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-08-12 11:34:40 +0100
commit8dbb3011a11ff3b6e8ebcf19e64ed4fbef17356b (patch)
treec2dbf441614acacce9168b9ec5681962b96d1be7 /src/gallium/drivers/trace
parenta318325b516b53fc321669453e4abe53c51f917a (diff)
trace: Replace buffer_map+memcpy+buffer_unmap by buffer_write
Diffstat (limited to 'src/gallium/drivers/trace')
-rw-r--r--src/gallium/drivers/trace/tr_winsys.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/src/gallium/drivers/trace/tr_winsys.c b/src/gallium/drivers/trace/tr_winsys.c
index 60a69626c0..0a43f1f7f4 100644
--- a/src/gallium/drivers/trace/tr_winsys.c
+++ b/src/gallium/drivers/trace/tr_winsys.c
@@ -240,30 +240,18 @@ trace_winsys_buffer_map(struct pipe_winsys *_winsys,
unsigned usage)
{
struct trace_winsys *tr_ws = trace_winsys(_winsys);
- struct trace_stream *stream = tr_ws->stream;
struct pipe_winsys *winsys = tr_ws->winsys;
- void *result;
-
- trace_dump_call_begin(stream, "pipe_winsys", "buffer_map");
-
- trace_dump_arg(stream, ptr, winsys);
- trace_dump_arg(stream, ptr, buffer);
- trace_dump_arg(stream, uint, usage);
-
- result = winsys->buffer_map(winsys, buffer, usage);
-
- trace_dump_ret(stream, ptr, result);
-
- trace_dump_call_end(stream);
+ void *map;
- if(result) {
+ map = winsys->buffer_map(winsys, buffer, usage);
+ if(map) {
if(usage & PIPE_BUFFER_USAGE_CPU_WRITE) {
assert(!hash_table_get(tr_ws->buffer_maps, buffer));
- hash_table_set(tr_ws->buffer_maps, buffer, result);
+ hash_table_set(tr_ws->buffer_maps, buffer, map);
}
}
- return result;
+ return map;
}
@@ -278,13 +266,11 @@ trace_winsys_buffer_unmap(struct pipe_winsys *_winsys,
map = hash_table_get(tr_ws->buffer_maps, buffer);
if(map) {
- trace_dump_call_begin(stream, "", "memcpy");
+ trace_dump_call_begin(stream, "pipe_winsys", "buffer_write");
- trace_dump_arg_begin(stream, "dst");
- trace_dump_ptr(stream, map);
- trace_dump_arg_end(stream);
+ trace_dump_arg(stream, ptr, buffer);
- trace_dump_arg_begin(stream, "src");
+ trace_dump_arg_begin(stream, "data");
trace_dump_bytes(stream, map, buffer->size);
trace_dump_arg_end(stream);
@@ -294,19 +280,10 @@ trace_winsys_buffer_unmap(struct pipe_winsys *_winsys,
trace_dump_call_end(stream);
- winsys->buffer_unmap(winsys, buffer);
-
hash_table_remove(tr_ws->buffer_maps, buffer);
}
- trace_dump_call_begin(stream, "pipe_winsys", "buffer_unmap");
-
- trace_dump_arg(stream, ptr, winsys);
- trace_dump_arg(stream, ptr, buffer);
-
winsys->buffer_unmap(winsys, buffer);
-
- trace_dump_call_end(stream);
}