pan/bi: Pull out bifrost_load_var
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 3 Mar 2020 02:45:47 +0000 (21:45 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 5 Mar 2020 14:35:38 +0000 (14:35 +0000)
We're not using this structure yet but we want everything in the ISA
ready for us.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4061>

src/panfrost/bifrost/bifrost.h
src/panfrost/bifrost/disassemble.c

index 237b99e93d682f5f13e1f7979f1f1de93c9d8a7e..50bcc92bebb29c969179170644dc989245965908 100644 (file)
@@ -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;
index f16f96cd73bb848fdf12f1a0918d697040a51537..19964d36a5deb647ab5c1048b3decf10732370e4 100644 (file)
@@ -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;
                 }