From 3866d0776f79cdadb5a82b14b9520d362c33ad3a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 11 Nov 2019 08:13:46 -0500 Subject: [PATCH] pan/midgard: Generalize texture registers across GPUs Early Midgard uses a different set of texture registers; let's not hardcode. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Tested-by: Andre Heider --- src/panfrost/midgard/midgard_ra.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c index 39ced65e272..7035a2a160b 100644 --- a/src/panfrost/midgard/midgard_ra.c +++ b/src/panfrost/midgard/midgard_ra.c @@ -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); -- 2.30.2