tr_winsys.h File Reference

Include dependency graph for tr_winsys.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  trace_winsys

Defines

#define TRACE_BUFFER_USAGE_USER   (1 << 31)
 It often happens that new data is written directly to the user buffers without mapping/unmapping.

Functions

static struct trace_winsystrace_winsys (struct pipe_winsys *winsys)
struct pipe_winsystrace_winsys_create (struct pipe_winsys *winsys)
void trace_winsys_user_buffer_update (struct pipe_winsys *winsys, struct pipe_buffer *buffer)


Define Documentation

#define TRACE_BUFFER_USAGE_USER   (1 << 31)

It often happens that new data is written directly to the user buffers without mapping/unmapping.

This flag marks user buffers, so that their contents can be dumpped before being used by the pipe context.

Definition at line 42 of file tr_winsys.h.


Function Documentation

static struct trace_winsys* trace_winsys ( struct pipe_winsys winsys  )  [static, read]

Definition at line 59 of file tr_winsys.h.

References assert.

00060 {
00061    assert(winsys);
00062    return (struct trace_winsys *)winsys;
00063 }

struct pipe_winsys* trace_winsys_create ( struct pipe_winsys winsys  )  [read]

Definition at line 454 of file tr_winsys.c.

References trace_winsys::base, pipe_winsys::buffer_create, pipe_winsys::buffer_destroy, pipe_winsys::buffer_map, trace_winsys::buffer_maps, pipe_winsys::buffer_unmap, CALLOC_STRUCT, pipe_winsys::destroy, pipe_winsys::fence_finish, pipe_winsys::fence_reference, pipe_winsys::fence_signalled, pipe_winsys::flush_frontbuffer, FREE, pipe_winsys::get_name, hash_table_create(), pipe_winsys::surface_alloc, pipe_winsys::surface_alloc_storage, pipe_winsys::surface_release, trace_buffer_compare(), trace_buffer_hash(), trace_dump_call_begin(), trace_dump_call_end(), trace_dump_ret, trace_winsys_buffer_create(), trace_winsys_buffer_destroy(), trace_winsys_buffer_map(), trace_winsys_buffer_unmap(), trace_winsys_destroy(), trace_winsys_fence_finish(), trace_winsys_fence_reference(), trace_winsys_fence_signalled(), trace_winsys_flush_frontbuffer(), trace_winsys_get_name(), trace_winsys_surface_alloc(), trace_winsys_surface_alloc_storage(), trace_winsys_surface_release(), trace_winsys_user_buffer_create(), pipe_winsys::user_buffer_create, and trace_winsys::winsys.

00455 {
00456    struct trace_winsys *tr_ws;
00457    
00458    if(!winsys)
00459       goto error1;
00460    
00461    tr_ws = CALLOC_STRUCT(trace_winsys);
00462    if(!tr_ws)
00463       goto error1;
00464 
00465    tr_ws->base.destroy = trace_winsys_destroy;
00466    tr_ws->base.get_name = trace_winsys_get_name;
00467    tr_ws->base.flush_frontbuffer = trace_winsys_flush_frontbuffer;
00468    tr_ws->base.surface_alloc = trace_winsys_surface_alloc;
00469    tr_ws->base.surface_alloc_storage = trace_winsys_surface_alloc_storage;
00470    tr_ws->base.surface_release = trace_winsys_surface_release;
00471    tr_ws->base.buffer_create = trace_winsys_buffer_create;
00472    tr_ws->base.user_buffer_create = trace_winsys_user_buffer_create;
00473    tr_ws->base.buffer_map = trace_winsys_buffer_map;
00474    tr_ws->base.buffer_unmap = trace_winsys_buffer_unmap;
00475    tr_ws->base.buffer_destroy = trace_winsys_buffer_destroy;
00476    tr_ws->base.fence_reference = trace_winsys_fence_reference;
00477    tr_ws->base.fence_signalled = trace_winsys_fence_signalled;
00478    tr_ws->base.fence_finish = trace_winsys_fence_finish;
00479    
00480    tr_ws->winsys = winsys;
00481 
00482    tr_ws->buffer_maps = hash_table_create(trace_buffer_hash, 
00483                                           trace_buffer_compare);
00484    if(!tr_ws->buffer_maps)
00485       goto error2;
00486    
00487    trace_dump_call_begin("", "pipe_winsys_create");
00488    trace_dump_ret(ptr, winsys);
00489    trace_dump_call_end();
00490 
00491    return &tr_ws->base;
00492    
00493 error2:
00494    FREE(tr_ws);
00495 error1:
00496    return winsys;
00497 }

void trace_winsys_user_buffer_update ( struct pipe_winsys winsys,
struct pipe_buffer buffer 
)

Definition at line 256 of file tr_winsys.c.

References pipe_winsys::buffer_map, pipe_winsys::buffer_unmap, PIPE_BUFFER_USAGE_CPU_READ, pipe_buffer::size, TRACE_BUFFER_USAGE_USER, trace_dump_arg, trace_dump_arg_begin(), trace_dump_arg_end(), trace_dump_bytes(), trace_dump_call_begin(), trace_dump_call_end(), trace_dump_uint(), trace_winsys(), pipe_buffer::usage, and trace_winsys::winsys.

00258 {
00259    struct trace_winsys *tr_ws = trace_winsys(_winsys);
00260    struct pipe_winsys *winsys = tr_ws->winsys;
00261    const void *map;
00262    
00263    if(buffer && buffer->usage & TRACE_BUFFER_USAGE_USER) {
00264       map = winsys->buffer_map(winsys, buffer, PIPE_BUFFER_USAGE_CPU_READ);
00265       if(map) {
00266          trace_dump_call_begin("pipe_winsys", "buffer_write");
00267          
00268          trace_dump_arg(ptr, winsys);
00269          
00270          trace_dump_arg(ptr, buffer);
00271          
00272          trace_dump_arg_begin("data");
00273          trace_dump_bytes(map, buffer->size);
00274          trace_dump_arg_end();
00275       
00276          trace_dump_arg_begin("size");
00277          trace_dump_uint(buffer->size);
00278          trace_dump_arg_end();
00279       
00280          trace_dump_call_end();
00281          
00282          winsys->buffer_unmap(winsys, buffer);
00283       }
00284    }
00285 }


Generated on Tue Sep 29 06:25:43 2009 for Gallium3D by  doxygen 1.5.4