Merge branch '7.8'
[mesa.git] / src / gallium / drivers / llvmpipe / lp_rast.c
index 4046701b85a2a24f7c252235351dd4e7b1d9d9b9..e2c1b6d5cbaccd56d5bbdf36ecb04e246f34b247 100644 (file)
@@ -28,7 +28,6 @@
 #include <limits.h>
 #include "util/u_memory.h"
 #include "util/u_math.h"
-#include "util/u_cpu_detect.h"
 #include "util/u_surface.h"
 
 #include "lp_scene_queue.h"
@@ -122,9 +121,11 @@ lp_rast_end( struct lp_rasterizer *rast )
 
    rast->curr_scene = NULL;
 
+#ifdef DEBUG
    if (0)
-      printf("Post render scene: tile read: %d  tile write: %d\n",
-             tile_read_count, tile_write_count);
+      debug_printf("Post render scene: tile unswizzle: %u tile swizzle: %u\n",
+                   lp_tile_unswizzle_count, lp_tile_swizzle_count);
+#endif
 }
 
 
@@ -869,20 +870,6 @@ create_rast_threads(struct lp_rasterizer *rast)
 {
    unsigned i;
 
-#ifdef PIPE_OS_WINDOWS
-   /* Multithreading not supported on windows until conditions and barriers are
-    * properly implemented. */
-   rast->num_threads = 0;
-#else
-#ifdef PIPE_OS_EMBEDDED
-   rast->num_threads = 0;
-#else
-   rast->num_threads = util_cpu_caps.nr_cpus;
-#endif
-   rast->num_threads = debug_get_num_option("LP_NUM_THREADS", rast->num_threads);
-   rast->num_threads = MIN2(rast->num_threads, MAX_THREADS);
-#endif
-
    /* NOTE: if num_threads is zero, we won't use any threads */
    for (i = 0; i < rast->num_threads; i++) {
       pipe_semaphore_init(&rast->tasks[i].work_ready, 0);
@@ -895,12 +882,12 @@ create_rast_threads(struct lp_rasterizer *rast)
 
 
 /**
- * Create new lp_rasterizer.
- * \param empty  the queue to put empty scenes on after we've finished
- *               processing them.
+ * Create new lp_rasterizer.  If num_threads is zero, don't create any
+ * new threads, do rendering synchronously.
+ * \param num_threads  number of rasterizer threads to create
  */
 struct lp_rasterizer *
-lp_rast_create( void )
+lp_rast_create( unsigned num_threads )
 {
    struct lp_rasterizer *rast;
    unsigned i;
@@ -917,6 +904,8 @@ lp_rast_create( void )
       task->thread_index = i;
    }
 
+   rast->num_threads = num_threads;
+
    create_rast_threads(rast);
 
    /* for synchronizing rasterization threads */