From 8e36f7da85d7078bc63dfd709f0ab0b53fa6405d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Fri, 12 Mar 2021 10:13:39 +0200 Subject: [PATCH] anv: move L3 initialization to device init on Gen11+ On Gen11+ we tend to only use a single configuration, so just get rid of the stalls in the command buffers by moving the config to device initialization. v2: drop NULL config check Signed-off-by: Lionel Landwerlin Reviewed-by: Jason Ekstrand Part-of: --- src/intel/vulkan/anv_private.h | 2 ++ src/intel/vulkan/genX_cmd_buffer.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 0bfe1523aa3..30ac0b69023 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1254,6 +1254,8 @@ struct anv_device { struct intel_aux_map_context *aux_map_ctx; + const struct intel_l3_config *l3_config; + struct gen_debug_block_frame *debug_frame_desc; }; diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index c082c23bd79..f7ba136f1bb 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -1887,6 +1887,12 @@ genX(cmd_buffer_config_l3)(struct anv_cmd_buffer *cmd_buffer, if (cfg == cmd_buffer->state.current_l3_config) return; +#if GEN_GEN >= 11 + /* On Gen11+ we use only one config, so verify it remains the same and skip + * the stalling programming entirely. + */ + assert(cfg == cmd_buffer->device->l3_config); +#else if (INTEL_DEBUG & DEBUG_L3) { mesa_logd("L3 config transition: "); intel_dump_l3_config(cfg, stderr); @@ -1934,6 +1940,7 @@ genX(cmd_buffer_config_l3)(struct anv_cmd_buffer *cmd_buffer, } genX(emit_l3_config)(&cmd_buffer->batch, cmd_buffer->device, cfg); +#endif /* GEN_GEN >= 11 */ cmd_buffer->state.current_l3_config = cfg; }