diff options
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/Makefile | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_interp.c | 1 | ||||
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 6 | ||||
-rw-r--r-- | src/gallium/auxiliary/os/os_thread.h | 94 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 18 | ||||
-rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 2 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_timed_winsys.c | 32 |
7 files changed, 83 insertions, 73 deletions
diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 02c65a9b2d..507ca6e6aa 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -166,6 +166,9 @@ CPP_SOURCES += \ endif +LIBRARY_DEFINES += -D__STDC_CONSTANT_MACROS + + include ../Makefile.template diff --git a/src/gallium/auxiliary/gallivm/lp_bld_interp.c b/src/gallium/auxiliary/gallivm/lp_bld_interp.c index a6acaead88..2fc894017d 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_interp.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_interp.c @@ -376,6 +376,7 @@ lp_build_interp_soa_init(struct lp_build_interp_soa_context *bld, case TGSI_TOKEN_TYPE_INSTRUCTION: case TGSI_TOKEN_TYPE_IMMEDIATE: + case TGSI_TOKEN_TYPE_PROPERTY: break; default: diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index a52c6c5028..4cf28a9f93 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1403,8 +1403,7 @@ emit_instruction( break; case TGSI_OPCODE_CONT: - /* deprecated? */ - assert(0); + /* FIXME */ return 0; break; @@ -1499,6 +1498,9 @@ lp_build_tgsi_soa(LLVMBuilderRef builder, } break; + case TGSI_TOKEN_TYPE_PROPERTY: + break; + default: assert( 0 ); } diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index 8ae90308c5..a04df4106f 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -116,25 +116,6 @@ typedef pthread_cond_t pipe_condvar; pthread_cond_broadcast(&(cond)) -/* pipe_barrier - */ -typedef pthread_barrier_t pipe_barrier; - -static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count) -{ - pthread_barrier_init(barrier, NULL, count); -} - -static INLINE void pipe_barrier_destroy(pipe_barrier *barrier) -{ - pthread_barrier_destroy(barrier); -} - -static INLINE void pipe_barrier_wait(pipe_barrier *barrier) -{ - pthread_barrier_wait(barrier); -} - #elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) @@ -208,26 +189,6 @@ typedef unsigned pipe_condvar; (void) cond -/* pipe_barrier (XXX FIX THIS) - */ -typedef unsigned pipe_barrier; - -static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count) -{ - /* XXX we could implement barriers with a mutex and condition var */ -} - -static INLINE void pipe_barrier_destroy(pipe_barrier *barrier) -{ -} - -static INLINE void pipe_barrier_wait(pipe_barrier *barrier) -{ - assert(0); -} - - - #else /** Dummy definitions */ @@ -254,7 +215,6 @@ static INLINE int pipe_thread_destroy( pipe_thread thread ) typedef unsigned pipe_mutex; typedef unsigned pipe_condvar; -typedef unsigned pipe_barrier; #define pipe_static_mutex(mutex) \ static pipe_mutex mutex = 0 @@ -290,6 +250,57 @@ typedef unsigned pipe_barrier; (void) condvar +#endif /* PIPE_OS_? */ + + +/* + * pipe_barrier + */ + +#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) + +typedef pthread_barrier_t pipe_barrier; + +static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count) +{ + pthread_barrier_init(barrier, NULL, count); +} + +static INLINE void pipe_barrier_destroy(pipe_barrier *barrier) +{ + pthread_barrier_destroy(barrier); +} + +static INLINE void pipe_barrier_wait(pipe_barrier *barrier) +{ + pthread_barrier_wait(barrier); +} + + +#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER) + +/* XXX FIX THIS */ +typedef unsigned pipe_barrier; + +static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count) +{ + /* XXX we could implement barriers with a mutex and condition var */ +} + +static INLINE void pipe_barrier_destroy(pipe_barrier *barrier) +{ +} + +static INLINE void pipe_barrier_wait(pipe_barrier *barrier) +{ + assert(0); +} + + +#else + +typedef unsigned pipe_barrier; + static INLINE void pipe_barrier_init(pipe_barrier *barrier, unsigned count) { /* XXX we could implement barriers with a mutex and condition var */ @@ -307,8 +318,7 @@ static INLINE void pipe_barrier_wait(pipe_barrier *barrier) } - -#endif /* PIPE_OS_? */ +#endif /* diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index c1498318df..53bc019a20 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -65,7 +65,7 @@ struct pb_cache_buffer struct pb_cache_manager *mgr; /** Caching time interval */ - struct util_time start, end; + int64_t start, end; struct list_head head; }; @@ -126,16 +126,16 @@ _pb_cache_buffer_list_check_free(struct pb_cache_manager *mgr) { struct list_head *curr, *next; struct pb_cache_buffer *buf; - struct util_time now; + int64_t now; - util_time_get(&now); + now = os_time_get(); curr = mgr->delayed.next; next = curr->next; while(curr != &mgr->delayed) { buf = LIST_ENTRY(struct pb_cache_buffer, curr, head); - if(!util_time_timeout(&buf->start, &buf->end, &now)) + if(!os_time_timeout(buf->start, buf->end, now)) break; _pb_cache_buffer_destroy(buf); @@ -157,8 +157,8 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf) _pb_cache_buffer_list_check_free(mgr); - util_time_get(&buf->start); - util_time_add(&buf->start, mgr->usecs, &buf->end); + buf->start = os_time_get(); + buf->end = buf->start + mgr->usecs; LIST_ADDTAIL(&buf->head, &mgr->delayed); ++mgr->numDelayed; pipe_mutex_unlock(mgr->mutex); @@ -253,7 +253,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, struct pb_cache_buffer *buf; struct pb_cache_buffer *curr_buf; struct list_head *curr, *next; - struct util_time now; + int64_t now; pipe_mutex_lock(mgr->mutex); @@ -262,12 +262,12 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, next = curr->next; /* search in the expired buffers, freeing them in the process */ - util_time_get(&now); + now = os_time_get(); while(curr != &mgr->delayed) { curr_buf = LIST_ENTRY(struct pb_cache_buffer, curr, head); if(!buf && pb_cache_is_buffer_compat(curr_buf, size, desc)) buf = curr_buf; - else if(util_time_timeout(&curr_buf->start, &curr_buf->end, &now)) + else if(os_time_timeout(curr_buf->start, curr_buf->end, now)) _pb_cache_buffer_destroy(curr_buf); else /* This buffer (and all hereafter) are still hot in cache */ diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 93f8960641..c2593cf165 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -349,7 +349,7 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr) while(curr != &mgr->list) { buf = LIST_ENTRY(struct pb_debug_buffer, curr, head); - debug_printf("buffer = %p\n", buf); + debug_printf("buffer = %p\n", (void *) buf); debug_printf(" .size = 0x%x\n", buf->base.base.size); debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE); diff --git a/src/gallium/auxiliary/util/u_timed_winsys.c b/src/gallium/auxiliary/util/u_timed_winsys.c index 59bdcd2c45..d88298bc14 100644 --- a/src/gallium/auxiliary/util/u_timed_winsys.c +++ b/src/gallium/auxiliary/util/u_timed_winsys.c @@ -33,7 +33,7 @@ #include "util/u_simple_screen.h" #include "u_timed_winsys.h" #include "util/u_memory.h" -#include "util/u_time.h" +#include "os/os_time.h" struct timed_winsys { @@ -54,12 +54,6 @@ static struct timed_winsys *timed_winsys( struct pipe_winsys *winsys ) } -static uint64_t time_start( void ) -{ - return util_time_micros(); -} - - static void time_display( struct pipe_winsys *winsys ) { struct timed_winsys *tws = timed_winsys(winsys); @@ -90,7 +84,7 @@ static void time_finish( struct pipe_winsys *winsys, const char *name ) { struct timed_winsys *tws = timed_winsys(winsys); - uint64_t endval = util_time_micros(); + int64_t endval = os_time_get(); double elapsed = (endval - startval)/1000.0; if (endval - startval > 1000LL) @@ -120,7 +114,7 @@ timed_buffer_create(struct pipe_winsys *winsys, unsigned size ) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); struct pipe_buffer *buf = backend->buffer_create( backend, alignment, usage, size ); @@ -139,7 +133,7 @@ timed_user_buffer_create(struct pipe_winsys *winsys, unsigned bytes) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); struct pipe_buffer *buf = backend->user_buffer_create( backend, data, bytes ); @@ -155,7 +149,7 @@ timed_buffer_map(struct pipe_winsys *winsys, unsigned flags) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); void *map = backend->buffer_map( backend, buf, flags ); @@ -170,7 +164,7 @@ timed_buffer_unmap(struct pipe_winsys *winsys, struct pipe_buffer *buf) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); backend->buffer_unmap( backend, buf ); @@ -183,7 +177,7 @@ timed_buffer_destroy(struct pipe_buffer *buf) { struct pipe_winsys *winsys = buf->screen->winsys; struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); backend->buffer_destroy( buf ); @@ -197,7 +191,7 @@ timed_flush_frontbuffer( struct pipe_winsys *winsys, void *context_private) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); backend->flush_frontbuffer( backend, surf, context_private ); @@ -216,7 +210,7 @@ timed_surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); struct pipe_buffer *ret = backend->surface_buffer_create( backend, width, height, format, usage, tex_usage, stride ); @@ -231,7 +225,7 @@ static const char * timed_get_name( struct pipe_winsys *winsys ) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); const char *ret = backend->get_name( backend ); @@ -246,7 +240,7 @@ timed_fence_reference(struct pipe_winsys *winsys, struct pipe_fence_handle *fence) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); backend->fence_reference( backend, ptr, fence ); @@ -260,7 +254,7 @@ timed_fence_signalled( struct pipe_winsys *winsys, unsigned flag ) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); int ret = backend->fence_signalled( backend, fence, flag ); @@ -275,7 +269,7 @@ timed_fence_finish( struct pipe_winsys *winsys, unsigned flag ) { struct pipe_winsys *backend = timed_winsys(winsys)->backend; - uint64_t start = time_start(); + int64_t start = os_time_get(); int ret = backend->fence_finish( backend, fence, flag ); |