u_timed_winsys.c File Reference

Include dependency graph for u_timed_winsys.c:

Go to the source code of this file.

Data Structures

struct  timed_winsys

Functions

static struct timed_winsystimed_winsys (struct pipe_winsys *winsys)
static uint64_t time_start (void)
static void time_display (struct pipe_winsys *winsys)
static void time_finish (struct pipe_winsys *winsys, long long startval, unsigned idx, const char *name)
static struct pipe_buffertimed_buffer_create (struct pipe_winsys *winsys, unsigned alignment, unsigned usage, unsigned size)
static struct pipe_buffertimed_user_buffer_create (struct pipe_winsys *winsys, void *data, unsigned bytes)
static void * timed_buffer_map (struct pipe_winsys *winsys, struct pipe_buffer *buf, unsigned flags)
static void timed_buffer_unmap (struct pipe_winsys *winsys, struct pipe_buffer *buf)
static void timed_buffer_destroy (struct pipe_winsys *winsys, struct pipe_buffer *buf)
static void timed_flush_frontbuffer (struct pipe_winsys *winsys, struct pipe_surface *surf, void *context_private)
static struct pipe_surfacetimed_surface_alloc (struct pipe_winsys *winsys)
static int timed_surface_alloc_storage (struct pipe_winsys *winsys, struct pipe_surface *surf, unsigned width, unsigned height, enum pipe_format format, unsigned flags, unsigned tex_usage)
static void timed_surface_release (struct pipe_winsys *winsys, struct pipe_surface **s)
static const char * timed_get_name (struct pipe_winsys *winsys)
static void timed_fence_reference (struct pipe_winsys *winsys, struct pipe_fence_handle **ptr, struct pipe_fence_handle *fence)
static int timed_fence_signalled (struct pipe_winsys *winsys, struct pipe_fence_handle *fence, unsigned flag)
static int timed_fence_finish (struct pipe_winsys *winsys, struct pipe_fence_handle *fence, unsigned flag)
static void timed_winsys_destroy (struct pipe_winsys *winsys)
struct pipe_winsysu_timed_winsys_create (struct pipe_winsys *backend)


Function Documentation

static void time_display ( struct pipe_winsys winsys  )  [static]

Definition at line 62 of file u_timed_winsys.c.

References timed_winsys::calls, debug_printf(), Elements, timed_winsys::funcs, timed_winsys::name_key, timed_winsys(), and timed_winsys::total.

00063 {
00064    struct timed_winsys *tws = timed_winsys(winsys);
00065    unsigned i;
00066    double overall = 0;
00067 
00068    for (i = 0; i < Elements(tws->funcs); i++) {
00069       if (tws->funcs[i].name_key) {
00070          debug_printf("*** %-25s %5.3fms (%d calls, avg %.3fms)\n", 
00071                       tws->funcs[i].name_key,
00072                       tws->funcs[i].total,
00073                       tws->funcs[i].calls,
00074                       tws->funcs[i].total / tws->funcs[i].calls);
00075          overall += tws->funcs[i].total;
00076          tws->funcs[i].calls = 0;
00077          tws->funcs[i].total = 0;
00078       }
00079    }
00080 
00081    debug_printf("*** %-25s %5.3fms\n", 
00082                 "OVERALL WINSYS",
00083                 overall);
00084 }

static void time_finish ( struct pipe_winsys winsys,
long long  startval,
unsigned  idx,
const char *  name 
) [static]

Definition at line 86 of file u_timed_winsys.c.

References assert, timed_winsys::calls, debug_printf(), timed_winsys::funcs, timed_winsys::last_dump, timed_winsys::name_key, time_display(), timed_winsys(), timed_winsys::total, and util_time_micros().

00090 {
00091    struct timed_winsys *tws = timed_winsys(winsys);
00092    uint64_t endval = util_time_micros();
00093    double elapsed = (endval - startval)/1000.0;
00094 
00095    if (endval - startval > 1000LL) 
00096       debug_printf("*** %s %.3f\n", name, elapsed );
00097 
00098    assert( tws->funcs[idx].name_key == name ||
00099            tws->funcs[idx].name_key == NULL);
00100 
00101    tws->funcs[idx].name_key = name;
00102    tws->funcs[idx].total += elapsed;
00103    tws->funcs[idx].calls++;
00104 
00105    if (endval - tws->last_dump > 10LL * 1000LL * 1000LL) {
00106       time_display( winsys );
00107       tws->last_dump = endval;
00108    }
00109 }

static uint64_t time_start ( void   )  [static]

Definition at line 56 of file u_timed_winsys.c.

References util_time_micros().

00057 {
00058    return util_time_micros();
00059 }

static struct pipe_buffer* timed_buffer_create ( struct pipe_winsys winsys,
unsigned  alignment,
unsigned  usage,
unsigned  size 
) [static, read]

Definition at line 116 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::buffer_create, time_finish(), time_start(), and timed_winsys().

00120 {
00121    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00122    uint64_t start = time_start();
00123 
00124    struct pipe_buffer *buf = backend->buffer_create( backend, alignment, usage, size );
00125 
00126    time_finish(winsys, start, 0, __FUNCTION__);
00127    
00128    return buf;
00129 }

static void timed_buffer_destroy ( struct pipe_winsys winsys,
struct pipe_buffer buf 
) [static]

Definition at line 180 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::buffer_destroy, time_finish(), time_start(), and timed_winsys().

00182 {
00183    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00184    uint64_t start = time_start();
00185 
00186    backend->buffer_destroy( backend, buf );
00187 
00188    time_finish(winsys, start, 4, __FUNCTION__);
00189 }

static void* timed_buffer_map ( struct pipe_winsys winsys,
struct pipe_buffer buf,
unsigned  flags 
) [static]

Definition at line 151 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::buffer_map, time_finish(), time_start(), and timed_winsys().

00154 {
00155    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00156    uint64_t start = time_start();
00157 
00158    void *map = backend->buffer_map( backend, buf, flags );
00159 
00160    time_finish(winsys, start, 2, __FUNCTION__);
00161    
00162    return map;
00163 }

static void timed_buffer_unmap ( struct pipe_winsys winsys,
struct pipe_buffer buf 
) [static]

Definition at line 167 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::buffer_unmap, time_finish(), time_start(), and timed_winsys().

00169 {
00170    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00171    uint64_t start = time_start();
00172 
00173    backend->buffer_unmap( backend, buf );
00174 
00175    time_finish(winsys, start, 3, __FUNCTION__);
00176 }

static int timed_fence_finish ( struct pipe_winsys winsys,
struct pipe_fence_handle *  fence,
unsigned  flag 
) [static]

Definition at line 299 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::fence_finish, time_finish(), time_start(), and timed_winsys().

00302 {
00303    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00304    uint64_t start = time_start();
00305 
00306    int ret = backend->fence_finish( backend, fence, flag );
00307 
00308    time_finish(winsys, start, 12, __FUNCTION__);
00309    
00310    return ret;
00311 }

static void timed_fence_reference ( struct pipe_winsys winsys,
struct pipe_fence_handle **  ptr,
struct pipe_fence_handle *  fence 
) [static]

Definition at line 270 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::fence_reference, time_finish(), time_start(), and timed_winsys().

00273 {
00274    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00275    uint64_t start = time_start();
00276 
00277    backend->fence_reference( backend, ptr, fence );
00278 
00279    time_finish(winsys, start, 10, __FUNCTION__);
00280 }

static int timed_fence_signalled ( struct pipe_winsys winsys,
struct pipe_fence_handle *  fence,
unsigned  flag 
) [static]

Definition at line 284 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::fence_signalled, time_finish(), time_start(), and timed_winsys().

00287 {
00288    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00289    uint64_t start = time_start();
00290 
00291    int ret = backend->fence_signalled( backend, fence, flag );
00292 
00293    time_finish(winsys, start, 11, __FUNCTION__);
00294    
00295    return ret;
00296 }

static void timed_flush_frontbuffer ( struct pipe_winsys winsys,
struct pipe_surface surf,
void *  context_private 
) [static]

Definition at line 193 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::flush_frontbuffer, time_finish(), time_start(), and timed_winsys().

00196 {
00197    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00198    uint64_t start = time_start();
00199 
00200    backend->flush_frontbuffer( backend, surf, context_private );
00201 
00202    time_finish(winsys, start, 5, __FUNCTION__);
00203 }

static const char* timed_get_name ( struct pipe_winsys winsys  )  [static]

Definition at line 257 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::get_name, time_finish(), time_start(), and timed_winsys().

00258 {
00259    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00260    uint64_t start = time_start();
00261 
00262    const char *ret = backend->get_name( backend );
00263 
00264    time_finish(winsys, start, 9, __FUNCTION__);
00265    
00266    return ret;
00267 }

static struct pipe_surface* timed_surface_alloc ( struct pipe_winsys winsys  )  [static, read]

Definition at line 209 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::surface_alloc, time_finish(), time_start(), and timed_winsys().

00210 {
00211    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00212    uint64_t start = time_start();
00213 
00214    struct pipe_surface *surf = backend->surface_alloc( backend );
00215 
00216    time_finish(winsys, start, 6, __FUNCTION__);
00217    
00218    return surf;
00219 }

static int timed_surface_alloc_storage ( struct pipe_winsys winsys,
struct pipe_surface surf,
unsigned  width,
unsigned  height,
enum pipe_format  format,
unsigned  flags,
unsigned  tex_usage 
) [static]

Definition at line 224 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::surface_alloc_storage, time_finish(), time_start(), and timed_winsys().

00230 {
00231    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00232    uint64_t start = time_start();
00233 
00234    int ret = backend->surface_alloc_storage( backend, surf, width, height, 
00235                                              format, flags, tex_usage );
00236 
00237    time_finish(winsys, start, 7, __FUNCTION__);
00238    
00239    return ret;
00240 }

static void timed_surface_release ( struct pipe_winsys winsys,
struct pipe_surface **  s 
) [static]

Definition at line 244 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::surface_release, time_finish(), time_start(), and timed_winsys().

00245 {
00246    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00247    uint64_t start = time_start();
00248 
00249    backend->surface_release( backend, s );
00250 
00251    time_finish(winsys, start, 8, __FUNCTION__);
00252 }

static struct pipe_buffer* timed_user_buffer_create ( struct pipe_winsys winsys,
void *  data,
unsigned  bytes 
) [static, read]

Definition at line 135 of file u_timed_winsys.c.

References timed_winsys::backend, time_finish(), time_start(), timed_winsys(), and pipe_winsys::user_buffer_create.

00138 {
00139    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00140    uint64_t start = time_start();
00141 
00142    struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes );
00143 
00144    time_finish(winsys, start, 1, __FUNCTION__);
00145    
00146    return buf;
00147 }

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

Definition at line 50 of file u_timed_winsys.c.

00051 {
00052    return (struct timed_winsys *)winsys;
00053 }

static void timed_winsys_destroy ( struct pipe_winsys winsys  )  [static]

Definition at line 314 of file u_timed_winsys.c.

References timed_winsys::backend, pipe_winsys::destroy, FREE, and timed_winsys().

00315 {
00316    struct pipe_winsys *backend = timed_winsys(winsys)->backend;
00317    backend->destroy( backend );
00318    FREE(winsys);
00319 }

struct pipe_winsys* u_timed_winsys_create ( struct pipe_winsys backend  )  [read]

Definition at line 323 of file u_timed_winsys.c.

References timed_winsys::backend, timed_winsys::base, pipe_winsys::buffer_create, pipe_winsys::buffer_destroy, pipe_winsys::buffer_map, 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, pipe_winsys::get_name, pipe_winsys::surface_alloc, pipe_winsys::surface_alloc_storage, pipe_winsys::surface_release, timed_buffer_create(), timed_buffer_destroy(), timed_buffer_map(), timed_buffer_unmap(), timed_fence_finish(), timed_fence_reference(), timed_fence_signalled(), timed_flush_frontbuffer(), timed_get_name(), timed_surface_alloc(), timed_surface_alloc_storage(), timed_surface_release(), timed_user_buffer_create(), timed_winsys_destroy(), and pipe_winsys::user_buffer_create.


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