-
-/**
- * Called by rasterization threads to get the next chunk of work.
- * We use a lock to make sure that all the threads get the same bins.
- */
-static struct lp_bins *
-get_next_full_bin( struct lp_rasterizer *rast )
-{
- pipe_mutex_lock( rast->get_bin_mutex );
- if (!rast->curr_bins) {
- /* this will wait until there's something in the queue */
- rast->curr_bins = lp_bins_dequeue( rast->full_bins );
- rast->release_count = 0;
-
- lp_bin_iter_begin( rast->curr_bins );
- }
- pipe_mutex_unlock( rast->get_bin_mutex );
- return rast->curr_bins;
-}
-
-
-/**
- * Called by rasterization threads after they've finished with
- * the current bin. When all threads have called this, we reset
- * the bin and put it into the 'empty bins' queue.
- */
-static void
-release_current_bin( struct lp_rasterizer *rast )
-{
- pipe_mutex_lock( rast->get_bin_mutex );
- rast->release_count++;
- if (rast->release_count == rast->num_threads) {
- assert(rast->curr_bins);
- lp_reset_bins( rast->curr_bins );
- lp_bins_enqueue( rast->empty_bins, rast->curr_bins );
- rast->curr_bins = NULL;
- }
- pipe_mutex_unlock( rast->get_bin_mutex );
-}
-
-
-