tu: add "flushall" and "syncdraw" debug options

They will be useful to check whether some issue is due to the lack
of flushing or waiting.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12283>
This commit is contained in:
Danylo Piliaiev 2021-08-09 21:19:11 +03:00 committed by Marge Bot
parent 03ddffd19f
commit 4f9ac2f737
3 changed files with 14 additions and 1 deletions

View File

@ -67,6 +67,14 @@ tu6_emit_flushes(struct tu_cmd_buffer *cmd_buffer,
struct tu_cs *cs,
enum tu_cmd_flush_bits flushes)
{
if (unlikely(cmd_buffer->device->physical_device->instance->debug_flags & TU_DEBUG_FLUSHALL))
flushes |= TU_CMD_FLAG_ALL_FLUSH | TU_CMD_FLAG_GPU_INVALIDATE;
if (unlikely(cmd_buffer->device->physical_device->instance->debug_flags & TU_DEBUG_SYNCDRAW))
flushes |= TU_CMD_FLAG_WAIT_MEM_WRITES |
TU_CMD_FLAG_WAIT_FOR_IDLE |
TU_CMD_FLAG_WAIT_FOR_ME;
/* Experiments show that invalidating CCU while it still has data in it
* doesn't work, so make sure to always flush before invalidating in case
* any data remains that hasn't yet been made available through a barrier.
@ -110,7 +118,8 @@ void
tu_emit_cache_flush_renderpass(struct tu_cmd_buffer *cmd_buffer,
struct tu_cs *cs)
{
if (!cmd_buffer->state.renderpass_cache.flush_bits)
if (!cmd_buffer->state.renderpass_cache.flush_bits &&
likely(!cmd_buffer->device->physical_device->instance->debug_flags))
return;
tu6_emit_flushes(cmd_buffer, cs, cmd_buffer->state.renderpass_cache.flush_bits);
cmd_buffer->state.renderpass_cache.flush_bits = 0;

View File

@ -281,6 +281,8 @@ static const struct debug_control tu_debug_options[] = {
{ "nomultipos", TU_DEBUG_NOMULTIPOS },
{ "nolrz", TU_DEBUG_NOLRZ },
{ "perfc", TU_DEBUG_PERFC },
{ "flushall", TU_DEBUG_FLUSHALL },
{ "syncdraw", TU_DEBUG_SYNCDRAW },
{ NULL, 0 }
};

View File

@ -234,6 +234,8 @@ enum tu_debug_flags
TU_DEBUG_NOMULTIPOS = 1 << 7,
TU_DEBUG_NOLRZ = 1 << 8,
TU_DEBUG_PERFC = 1 << 9,
TU_DEBUG_FLUSHALL = 1 << 10,
TU_DEBUG_SYNCDRAW = 1 << 11,
};
struct tu_instance