radeonsi: don't emit PKT3_CONTEXT_CONTROL on amdgpu
authorMarek Olšák <marek.olsak@amd.com>
Tue, 6 Aug 2019 23:52:24 +0000 (19:52 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 19 Aug 2019 21:23:38 +0000 (17:23 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 19e568259c279bb343b7e0f509f8de41bdccc8e7..0ae89b821ff8a90027f724183121b7e388d3f69b 100644 (file)
@@ -5403,10 +5403,13 @@ static void si_init_config(struct si_context *sctx)
        if (!pm4)
                return;
 
-       si_pm4_cmd_begin(pm4, PKT3_CONTEXT_CONTROL);
-       si_pm4_cmd_add(pm4, CONTEXT_CONTROL_LOAD_ENABLE(1));
-       si_pm4_cmd_add(pm4, CONTEXT_CONTROL_SHADOW_ENABLE(1));
-       si_pm4_cmd_end(pm4, false);
+       /* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
+       if (!sscreen->info.is_amdgpu || sscreen->info.drm_minor < 6) {
+               si_pm4_cmd_begin(pm4, PKT3_CONTEXT_CONTROL);
+               si_pm4_cmd_add(pm4, CONTEXT_CONTROL_LOAD_ENABLE(1));
+               si_pm4_cmd_add(pm4, CONTEXT_CONTROL_SHADOW_ENABLE(1));
+               si_pm4_cmd_end(pm4, false);
+       }
 
        if (has_clear_state) {
                si_pm4_cmd_begin(pm4, PKT3_CLEAR_STATE);