anv: add an option to disable secondary command buffer calls
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 8 Jun 2020 17:33:14 +0000 (20:33 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Jun 2020 20:23:52 +0000 (20:23 +0000)
Those are currently hurting Felix' ability to look at the batches.

We can probably detect this in the aubinator but that's a bit more
work than falling back to the previous behavior.

v2: Condition VK_KHR_performance_query to not using this variable (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5391>

src/intel/vulkan/anv_batch_chain.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_extensions.py
src/intel/vulkan/anv_private.h

index d4cd56dc1770cecc274730ce3a248a284ba9a495..d6311a66fa4b2c3794e7c0e8c15416363bfdb93e 100644 (file)
@@ -928,7 +928,7 @@ anv_cmd_buffer_end_batch_buffer(struct anv_cmd_buffer *cmd_buffer)
       const uint32_t length = cmd_buffer->batch.next - cmd_buffer->batch.start;
       if (!cmd_buffer->device->can_chain_batches) {
          cmd_buffer->exec_mode = ANV_CMD_BUFFER_EXEC_MODE_GROW_AND_EMIT;
-      } else if (cmd_buffer->device->physical->use_softpin) {
+      } else if (cmd_buffer->device->physical->use_call_secondary) {
          cmd_buffer->exec_mode = ANV_CMD_BUFFER_EXEC_MODE_CALL_AND_RETURN;
          /* If the secondary command buffer begins & ends in the same BO and
           * its length is less than the length of CS prefetch, add some NOOPs
index 8178a12808903a5669ed59564399e245f978e9b2..52f2ab44af55b8a2f00a15468862b26582bfb2c9 100644 (file)
@@ -454,6 +454,10 @@ anv_physical_device_try_create(struct anv_instance *instance,
    device->always_use_bindless =
       env_var_as_boolean("ANV_ALWAYS_BINDLESS", false);
 
+   device->use_call_secondary =
+      device->use_softpin &&
+      !env_var_as_boolean("ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS", false);
+
    /* We first got the A64 messages on broadwell and we can only use them if
     * we can pass addresses directly into the shader which requires softpin.
     */
index 82bdee9b90e464718c8d5553919dfe74df034949..8ee1ab7230caef2b206740a16c8b60d54fb479c3 100644 (file)
@@ -87,7 +87,10 @@ EXTENSIONS = [
     Extension('VK_KHR_maintenance2',                      1, True),
     Extension('VK_KHR_maintenance3',                      1, True),
     Extension('VK_KHR_multiview',                         1, True),
-    Extension('VK_KHR_performance_query',                 1, 'device->use_softpin && device->perf && device->perf->i915_perf_version >= 3'),
+    Extension('VK_KHR_performance_query',                 1,
+              'device->use_softpin && device->perf && ' +
+              'device->perf->i915_perf_version >= 3 && ' +
+              'device->use_call_secondary'),
     Extension('VK_KHR_pipeline_executable_properties',    1, True),
     Extension('VK_KHR_push_descriptor',                   1, True),
     Extension('VK_KHR_relaxed_block_layout',              1, True),
index 5f9bff5d5aaf3b9cc9d5148318780d674ba53ce4..56fadcd8e0a5ea5256654025f23ee088a169d55f 100644 (file)
@@ -1084,6 +1084,7 @@ struct anv_physical_device {
 
     bool                                        use_softpin;
     bool                                        always_use_bindless;
+    bool                                        use_call_secondary;
 
     /** True if we can access buffers using A64 messages */
     bool                                        has_a64_buffer_access;