From 6a7987aba10aaf05fbe678b3f3ccf5882b687aea Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 2 Mar 2020 21:45:47 -0500 Subject: [PATCH] pan/bi: Pull out bifrost_load_var We're not using this structure yet but we want everything in the ISA ready for us. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost.h | 20 ++++++++++++++++++++ src/panfrost/bifrost/disassemble.c | 8 ++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 237b99e93d6..50bcc92bebb 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -184,6 +184,26 @@ struct bifrost_ld_attr { unsigned op : 5; }; +enum bifrost_interp_mode { + BIFROST_INTERP_PER_FRAG = 0x0, + BIFROST_INTERP_CENTROID = 0x1, + BIFROST_INTERP_DEFAULT = 0x2, + BIFROST_INTERP_EXPLICIT = 0x3 +}; + +struct bifrost_ld_var { + unsigned src0 : 3; + + /* If top two bits set, indirect with src in bottom three */ + unsigned addr : 5; + + unsigned channels : 2; /* MALI_POSITIVE */ + enum bifrost_interp_mode interp_mode : 2; + unsigned reuse : 1; + unsigned flat : 1; + unsigned op : 6; +}; + struct bifrost_tex_ctrl { unsigned sampler_index : 4; // also used to signal indirects unsigned tex_index : 7; diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c index f16f96cd73b..19964d36a5d 100644 --- a/src/panfrost/bifrost/disassemble.c +++ b/src/panfrost/bifrost/disassemble.c @@ -1324,15 +1324,15 @@ static void dump_add(FILE *fp, uint64_t word, struct bifrost_regs regs, if (ADD.op & 0x400) fprintf(fp, ".flat"); switch ((ADD.op >> 7) & 0x3) { - case 0: + case BIFROST_INTERP_PER_FRAG: fprintf(fp, ".per_frag"); break; - case 1: + case BIFROST_INTERP_CENTROID: fprintf(fp, ".centroid"); break; - case 2: + case BIFROST_INTERP_DEFAULT: break; - case 3: + case BIFROST_INTERP_EXPLICIT: fprintf(fp, ".explicit"); break; } -- 2.30.2