pan/midgard: Generalize texture registers across GPUs
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 11 Nov 2019 13:13:46 +0000 (08:13 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 15 Nov 2019 18:37:33 +0000 (18:37 +0000)
Early Midgard uses a different set of texture registers; let's not
hardcode.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Andre Heider <a.heider@gmail.com>
src/panfrost/midgard/midgard_ra.c

index 39ced65e272621141edfb6d04754f334b2ea7c47..7035a2a160b8beb8676a66055da262575a9873e7 100644 (file)
@@ -619,19 +619,16 @@ install_registers_instr(
                 struct phys_reg coord = index_to_reg(ctx, l, ins->src[1], mir_srcsize(ins, 1));
                 struct phys_reg lod = index_to_reg(ctx, l, ins->src[2], mir_srcsize(ins, 2));
 
-                assert(dest.reg == 28 || dest.reg == 29);
-                assert(coord.reg == 28 || coord.reg == 29);
-
                 /* First, install the texture coordinate */
                 ins->texture.in_reg_full = 1;
                 ins->texture.in_reg_upper = 0;
-                ins->texture.in_reg_select = coord.reg - 28;
+                ins->texture.in_reg_select = coord.reg & 1;
                 offset_swizzle(ins->swizzle[1], coord.offset, coord.size, 0);
 
                 /* Next, install the destination */
                 ins->texture.out_full = 1;
                 ins->texture.out_upper = 0;
-                ins->texture.out_reg_select = dest.reg - 28;
+                ins->texture.out_reg_select = dest.reg & 1;
                 offset_swizzle(ins->swizzle[0], 0, 4, dest.offset);
                 mir_set_bytemask(ins, mir_bytemask(ins) << dest.offset);