radeonsi: disable sdma for gfx10
[mesa.git] / src / gallium / drivers / radeonsi / si_pipe.c
index d9cd4ff92e99bf71cfa6dfb5d90b4c5981f383bd..01c9d89ab4fe5eb7dc2eb9669baf2f00d4ddb0e0 100644 (file)
@@ -127,8 +127,7 @@ static const struct debug_named_value debug_options[] = {
        DEBUG_NAMED_VALUE_END /* must be last */
 };
 
-static void si_init_compiler(struct si_screen *sscreen,
-                            struct ac_llvm_compiler *compiler)
+void si_init_compiler(struct si_screen *sscreen, struct ac_llvm_compiler *compiler)
 {
        /* Only create the less-optimizing version of the compiler on APUs
         * predating Ryzen (Raven). */
@@ -484,7 +483,13 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
        if (!sctx->ctx)
                goto fail;
 
-       if (sscreen->info.num_sdma_rings && !(sscreen->debug_flags & DBG(NO_ASYNC_DMA))) {
+       if (sscreen->info.num_sdma_rings &&
+           !(sscreen->debug_flags & DBG(NO_ASYNC_DMA)) &&
+           /* SDMA timeouts sometimes on gfx10 so disable it for now. See:
+            *    https://bugs.freedesktop.org/show_bug.cgi?id=111481
+            *    https://gitlab.freedesktop.org/mesa/mesa/issues/1907
+            */
+           (sctx->chip_class != GFX10 || sscreen->debug_flags & DBG(FORCE_DMA))) {
                sctx->dma_cs = sctx->ws->cs_create(sctx->ctx, RING_DMA,
                                                   (void*)si_flush_dma_cs,
                                                   sctx, stop_exec_on_failure);
@@ -938,7 +943,7 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
                            const struct pipe_screen_config *config)
 {
        struct si_screen *sscreen = CALLOC_STRUCT(si_screen);
-       unsigned hw_threads, num_comp_hi_threads, num_comp_lo_threads, i;
+       unsigned hw_threads, num_comp_hi_threads, num_comp_lo_threads;
 
        if (!sscreen) {
                return NULL;
@@ -977,6 +982,7 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
                si_set_max_shader_compiler_threads;
        sscreen->b.is_parallel_shader_compilation_finished =
                si_is_parallel_shader_compilation_finished;
+       sscreen->b.finalize_nir = si_finalize_nir;
 
        si_init_screen_get_functions(sscreen);
        si_init_screen_buffer_functions(sscreen);
@@ -1223,11 +1229,6 @@ radeonsi_screen_create_impl(struct radeon_winsys *ws,
                }
        }
 
-       for (i = 0; i < num_comp_hi_threads; i++)
-               si_init_compiler(sscreen, &sscreen->compiler[i]);
-       for (i = 0; i < num_comp_lo_threads; i++)
-               si_init_compiler(sscreen, &sscreen->compiler_lowp[i]);
-
        sscreen->ge_wave_size = 64;
        sscreen->ps_wave_size = 64;
        sscreen->compute_wave_size = 64;