anv: add an option to disable secondary command buffer calls

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>
This commit is contained in:
Lionel Landwerlin 2020-06-08 20:33:14 +03:00 committed by Marge Bot
parent 20b6ee82ac
commit 762706c5a6
4 changed files with 10 additions and 2 deletions

View 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

View 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.
*/

View 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),

View 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;