radeonsi: Disable clear_state with radeon kernel driver
authorSonny Jiang <sonny.jiang@amd.com>
Fri, 19 Oct 2018 20:16:41 +0000 (16:16 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 19 Oct 2018 20:16:57 +0000 (16:16 -0400)
Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_state.c

index 46cf37567f9d3b70debae27d1e1fc3199f53fd46..7bc34498cf438183cbff993184a58449e4de49bd 100644 (file)
@@ -993,8 +993,10 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
        }
 
        /* The mere presense of CLEAR_STATE in the IB causes random GPU hangs
-        * on SI. */
-       sscreen->has_clear_state = sscreen->info.chip_class >= CIK;
+        * on SI. Some CLEAR_STATE cause asic hang on radeon kernel, etc.
+        * SPI_VS_OUT_CONFIG. So only enable CI CLEAR_STATE on amdgpu kernel.*/
+       sscreen->has_clear_state = sscreen->info.chip_class >= CIK &&
+                                  sscreen->info.drm_major == 3;
 
        sscreen->has_distributed_tess =
                sscreen->info.chip_class >= VI &&
index 176ec74914835632c3556c877cbe1da1d93b9a0c..36dce3815398e2097e093bea061f24fa529489d2 100644 (file)
@@ -4899,8 +4899,9 @@ static void si_init_config(struct si_context *sctx)
        bool has_clear_state = sscreen->has_clear_state;
        struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
 
-       /* Only SI can disable CLEAR_STATE for now. */
-       assert(has_clear_state || sscreen->info.chip_class == SI);
+       /* SI, radeon kernel disabled CLEAR_STATE. */
+       assert(has_clear_state || sscreen->info.chip_class == SI ||
+              sscreen->info.drm_major != 3);
 
        if (!pm4)
                return;