diff options
author | Alyssa Rosenzweig <alyssa@collabora.com> | 2022-02-12 16:43:36 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-02-23 12:56:30 +0000 |
commit | 6fc81f163e8508bca7006ea00f0759e9426a6fe7 (patch) | |
tree | 7ff5d6e5482e5a5878a3ac005689c00e798e9722 | |
parent | 7e703e4428c096fcf12019ba0f4f75940c1fa1f4 (diff) | |
download | mesa-6fc81f163e8508bca7006ea00f0759e9426a6fe7.tar.gz |
pan/mdg: Fix partial execution mode names
cont -> skip, last -> kill, and fix the special case handling. It's just an
enum. Makes the disassembly easier to read and closer to Bifrost.
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15123>
-rw-r--r-- | src/panfrost/midgard/disassemble.c | 18 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard.h | 15 | ||||
-rw-r--r-- | src/panfrost/midgard/midgard_emit.c | 10 |
3 files changed, 24 insertions, 19 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index 738b00a82f1..8437e0e0d70 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -1717,6 +1717,17 @@ derivative_mode(enum mali_derivative_mode mode) } } +static const char * +partial_exection_mode(enum midgard_partial_execution mode) +{ + switch (mode) { + case MIDGARD_PARTIAL_EXECUTION_NONE: return ""; + case MIDGARD_PARTIAL_EXECUTION_SKIP: return ".skip"; + case MIDGARD_PARTIAL_EXECUTION_KILL: return ".kill"; + default: return ".reserved"; + } +} + static void print_texture_word(disassemble_context *ctx, FILE *fp, uint32_t *word, unsigned tabs, unsigned in_reg_base, unsigned out_reg_base) @@ -1746,12 +1757,7 @@ print_texture_word(disassemble_context *ctx, FILE *fp, uint32_t *word, print_texture_format(fp, texture->format); /* Instruction "modifiers" parallel the ALU instructions. */ - - if (texture->cont) - fprintf(fp, ".cont"); - - if (texture->last) - fprintf(fp, ".last"); + fputs(partial_exection_mode(texture->exec), fp); if (texture->out_of_order) fprintf(fp, ".ooo%u", texture->out_of_order); diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h index f6d721cc901..d7715c697cd 100644 --- a/src/panfrost/midgard/midgard.h +++ b/src/panfrost/midgard/midgard.h @@ -871,6 +871,12 @@ enum mali_derivative_mode { TEXTURE_DFDY = 1, }; +enum midgard_partial_execution { + MIDGARD_PARTIAL_EXECUTION_SKIP = 1, + MIDGARD_PARTIAL_EXECUTION_KILL = 2, + MIDGARD_PARTIAL_EXECUTION_NONE = 3 +}; + typedef struct __attribute__((__packed__)) { @@ -879,14 +885,7 @@ __attribute__((__packed__)) enum mali_texture_op op : 4; unsigned mode : 4; - - /* A little obscure, but last is set for the last texture operation in - * a shader. cont appears to just be last's opposite (?). Yeah, I know, - * kind of funky.. BiOpen thinks it could do with memory hinting, or - * tile locking? */ - - unsigned cont : 1; - unsigned last : 1; + enum midgard_partial_execution exec : 2; unsigned format : 2; diff --git a/src/panfrost/midgard/midgard_emit.c b/src/panfrost/midgard/midgard_emit.c index 58bcfd1a2aa..1d4b1178258 100644 --- a/src/panfrost/midgard/midgard_emit.c +++ b/src/panfrost/midgard/midgard_emit.c @@ -1019,10 +1019,10 @@ emit_binary_bundle(compiler_context *ctx, ins->texture.type = bundle->tag; ins->texture.next_type = next_tag; + ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_NONE; /* default */ /* Nothing else to pack for barriers */ if (ins->op == midgard_tex_op_barrier) { - ins->texture.cont = ins->texture.last = 1; ins->texture.op = ins->op; util_dynarray_append(emission, midgard_texture_word, ins->texture); return; @@ -1052,10 +1052,10 @@ emit_binary_bundle(compiler_context *ctx, ins->texture.outmod = ins->outmod; if (mir_op_computes_derivatives(ctx->stage, ins->op)) { - ins->texture.cont = !ins->helper_terminate; - ins->texture.last = ins->helper_terminate || ins->helper_execute; - } else { - ins->texture.cont = ins->texture.last = 1; + if (ins->helper_terminate) + ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_KILL; + else if (!ins->helper_execute) + ins->texture.exec = MIDGARD_PARTIAL_EXECUTION_SKIP; } midgard_texture_word texture = texture_word_from_instr(ins); |