From: Alyssa Rosenzweig Date: Sat, 12 Feb 2022 21:43:36 +0000 (-0500) Subject: pan/mdg: Fix partial execution mode names X-Git-Tag: upstream/22.3.5~12369 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fc81f163e8508bca7006ea00f0759e9426a6fe7;p=platform%2Fupstream%2Fmesa.git 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 Part-of: --- diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index 738b00a..8437e0e 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 f6d721c..d7715c6 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 58bcfd1..1d4b117 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);