gallium/util: replace pipe_condvar_init() with cnd_init()
authorTimothy Arceri <tarceri@itsqueeze.com>
Sat, 4 Mar 2017 23:41:29 +0000 (10:41 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 6 Mar 2017 21:23:26 +0000 (08:23 +1100)
pipe_condvar_init() was made unnecessary with fd33a6bcd7f12.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/os/os_thread.h
src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
src/gallium/auxiliary/util/u_queue.c
src/gallium/auxiliary/util/u_ringbuffer.c
src/gallium/drivers/llvmpipe/lp_fence.c
src/gallium/drivers/rbug/rbug_context.c
src/gallium/state_trackers/nine/nine_queue.c
src/gallium/state_trackers/nine/nine_state.c

index 0caf955b89f24a8d6ae6a448d7e4476885e0c0ce..e1dc210a6e3013ce25047f2bb5fc226f7ef5782d 100644 (file)
@@ -148,9 +148,6 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_init(cond)        \
-   cnd_init(&(cond))
-
 #define pipe_condvar_destroy(cond) \
    cnd_destroy(&(cond))
 
@@ -204,7 +201,7 @@ static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
    barrier->waiters = 0;
    barrier->sequence = 0;
    pipe_mutex_init(barrier->mutex);
-   pipe_condvar_init(barrier->condvar);
+   cnd_init(&barrier->condvar);
 }
 
 static inline void pipe_barrier_destroy(pipe_barrier *barrier)
@@ -256,7 +253,7 @@ static inline void
 pipe_semaphore_init(pipe_semaphore *sema, int init_val)
 {
    pipe_mutex_init(sema->mutex);
-   pipe_condvar_init(sema->cond);
+   cnd_init(&sema->cond);
    sema->counter = init_val;
 }
 
index fdbcf9e5c4413fe1acfb6c055c9ea975aaac6ccb..541a6d9079a9420ceb92268135a033acb4d5e11c 100644 (file)
@@ -350,7 +350,7 @@ pb_slab_create(struct pb_slab_manager *mgr)
       buf->slab = slab;
       buf->start = i* mgr->bufSize;
       buf->mapCount = 0;
-      pipe_condvar_init(buf->event);
+      cnd_init(&buf->event);
       LIST_ADDTAIL(&buf->head, &slab->freeBuffers);
       slab->numFree++;
       buf++;
index 8dd4cb3ccbb9d1979d3004ec607642e88bb98163..dff5b154cac488832ab439bb4b2803cc2d7e51b7 100644 (file)
@@ -114,7 +114,7 @@ util_queue_fence_init(struct util_queue_fence *fence)
 {
    memset(fence, 0, sizeof(*fence));
    pipe_mutex_init(fence->mutex);
-   pipe_condvar_init(fence->cond);
+   cnd_init(&fence->cond);
    fence->signalled = true;
 }
 
@@ -213,8 +213,8 @@ util_queue_init(struct util_queue *queue,
    pipe_mutex_init(queue->lock);
 
    queue->num_queued = 0;
-   pipe_condvar_init(queue->has_queued_cond);
-   pipe_condvar_init(queue->has_space_cond);
+   cnd_init(&queue->has_queued_cond);
+   cnd_init(&queue->has_space_cond);
 
    queue->threads = (pipe_thread*)CALLOC(num_threads, sizeof(pipe_thread));
    if (!queue->threads)
index 19830a904e684c9651e51079ac06e89e53258b26..e3be3ef1fba33196a6f7e59331b50111c9664d02 100644 (file)
@@ -35,7 +35,7 @@ struct util_ringbuffer *util_ringbuffer_create( unsigned dwords )
 
    ring->mask = dwords - 1;
 
-   pipe_condvar_init(ring->change);
+   cnd_init(&ring->change);
    pipe_mutex_init(ring->mutex);
    return ring;
 
index a21a3c744844c37a2a5106d160f455f474cdd9ae..1529981bbe5ac7c90a85091459c2820b1566c895 100644 (file)
@@ -53,7 +53,7 @@ lp_fence_create(unsigned rank)
    pipe_reference_init(&fence->reference, 1);
 
    pipe_mutex_init(fence->mutex);
-   pipe_condvar_init(fence->signalled);
+   cnd_init(&fence->signalled);
 
    fence->id = fence_id++;
    fence->rank = rank;
index 1dd0f6d42d2604f699c49cf2f9d4cee235d13c1e..9634f88d5f431271250bce6b38cee121313ba36e 100644 (file)
@@ -1204,7 +1204,7 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
       return NULL;
 
    pipe_mutex_init(rb_pipe->draw_mutex);
-   pipe_condvar_init(rb_pipe->draw_cond);
+   cnd_init(&rb_pipe->draw_cond);
    pipe_mutex_init(rb_pipe->call_mutex);
    pipe_mutex_init(rb_pipe->list_mutex);
    make_empty_list(&rb_pipe->shaders);
index 9f0bf8bad7794eea6abfd0f3a152a1659f99f03d..004d5816b848578b5419cb02920e8281ce792448 100644 (file)
@@ -240,10 +240,10 @@ nine_queue_create(void)
             goto failed;
     }
 
-    pipe_condvar_init(ctx->event_pop);
+    cnd_init(&ctx->event_pop);
     pipe_mutex_init(ctx->mutex_pop);
 
-    pipe_condvar_init(ctx->event_push);
+    cnd_init(&ctx->event_push);
     pipe_mutex_init(ctx->mutex_push);
 
     /* Block until first cmdbuf has been flushed. */
index bdb0ba13ea061be1339ca2dc2098a5d25334a604..e1a2ff0cf979d8d6888140b04a9cf6b575ff21c6 100644 (file)
@@ -151,7 +151,7 @@ nine_csmt_create( struct NineDevice9 *This )
         FREE(ctx);
         return NULL;
     }
-    pipe_condvar_init(ctx->event_processed);
+    cnd_init(&ctx->event_processed);
     pipe_mutex_init(ctx->mutex_processed);
     pipe_mutex_init(ctx->thread_running);
     pipe_mutex_init(ctx->thread_resume);