radv: do not emit PKT3_CONTEXT_CONTROL with AMDGPU 3.6.0+
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 19 Aug 2019 13:01:20 +0000 (15:01 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 20 Aug 2019 10:13:41 +0000 (12:13 +0200)
It's emitted by the kernel.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/si_cmd_buffer.c

index 7cd7d9da1d6aa52bd939cc7c6f61dfde7b509ad0..cc45ac95c08f7d197047f94659bdc992c73a0519 100644 (file)
@@ -2010,9 +2010,12 @@ VkResult radv_CreateDevice(
                device->empty_cs[family] = device->ws->cs_create(device->ws, family);
                switch (family) {
                case RADV_QUEUE_GENERAL:
-                       radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
-                       radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
-                       radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
+                     /* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
+                       if (device->physical_device->rad_info.drm_minor < 6) {
+                               radeon_emit(device->empty_cs[family], PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
+                               radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_LOAD_ENABLE(1));
+                               radeon_emit(device->empty_cs[family], CONTEXT_CONTROL_SHADOW_ENABLE(1));
+                       }
                        break;
                case RADV_QUEUE_COMPUTE:
                        radeon_emit(device->empty_cs[family], PKT3(PKT3_NOP, 0, 0));
index e8911dc591fe45fec12086ef13124fe6f330f707..42c7010ca8706a583ecb6eddf5cc29d2f18b0ab9 100644 (file)
@@ -161,9 +161,12 @@ si_emit_graphics(struct radv_physical_device *physical_device,
 {
        int i;
 
-       radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
-       radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
-       radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
+       /* Since amdgpu version 3.6.0, CONTEXT_CONTROL is emitted by the kernel */
+       if (physical_device->rad_info.drm_minor < 6) {
+               radeon_emit(cs, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
+               radeon_emit(cs, CONTEXT_CONTROL_LOAD_ENABLE(1));
+               radeon_emit(cs, CONTEXT_CONTROL_SHADOW_ENABLE(1));
+       }
 
        if (physical_device->has_clear_state) {
                radeon_emit(cs, PKT3(PKT3_CLEAR_STATE, 0, 0));