anv: limit aux invalidations to primary command buffers

This AUX-TT is only updated on the CPU since ee6e2bc4a3 ("anv: Place
images into the aux-map when safe to do so"). So the only really
important invalidation that needs to happens is on the beginning of a
primary command buffer.

We are required to idle the pipes prior invalidation the AUX-TT. This
might not be happening when the invalidation is put at the beginning
of the secondary command buffers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29671>
This commit is contained in:
Lionel Landwerlin 2024-06-06 00:39:57 +03:00 committed by Marge Bot
parent 27cc8e375b
commit 1851629407

View file

@ -2806,11 +2806,11 @@ genX(cmd_buffer_begin_companion)(struct anv_cmd_buffer *cmd_buffer,
cmd_buffer->state.current_db_mode = ANV_CMD_DESCRIPTOR_BUFFER_MODE_LEGACY;
genX(cmd_buffer_emit_bt_pool_base_address)(cmd_buffer);
/* Re-emit the aux table register in every command buffer. This way we're
* ensured that we have the table even if this command buffer doesn't
* initialize any images.
/* Invalidate the aux table in every primary command buffer. This ensures
* the command buffer see the last updates made by the host.
*/
if (cmd_buffer->device->info->has_aux_map) {
if (cmd_buffer->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY &&
cmd_buffer->device->info->has_aux_map) {
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_AUX_TABLE_INVALIDATE_BIT,
"new cmd buffer with aux-tt");
@ -2904,11 +2904,11 @@ genX(BeginCommandBuffer)(
if (anv_cmd_buffer_is_video_queue(cmd_buffer) ||
anv_cmd_buffer_is_blitter_queue(cmd_buffer)) {
/* Re-emit the aux table register in every command buffer. This way we're
* ensured that we have the table even if this command buffer doesn't
* initialize any images.
/* Invalidate the aux table in every primary command buffer. This
* ensures the command buffer see the last updates made by the host.
*/
if (cmd_buffer->device->info->has_aux_map) {
if (cmd_buffer->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY &&
cmd_buffer->device->info->has_aux_map) {
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_AUX_TABLE_INVALIDATE_BIT,
"new cmd buffer with aux-tt");
@ -2946,11 +2946,11 @@ genX(BeginCommandBuffer)(
ANV_PIPE_VF_CACHE_INVALIDATE_BIT,
"new cmd buffer");
/* Re-emit the aux table register in every command buffer. This way we're
* ensured that we have the table even if this command buffer doesn't
* initialize any images.
/* Invalidate the aux table in every primary command buffer. This ensures
* the command buffer see the last updates made by the host.
*/
if (cmd_buffer->device->info->has_aux_map) {
if (cmd_buffer->vk.level == VK_COMMAND_BUFFER_LEVEL_PRIMARY &&
cmd_buffer->device->info->has_aux_map) {
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_AUX_TABLE_INVALIDATE_BIT,
"new cmd buffer with aux-tt");