From 0be1116b818edd56351d0415172015771eea1f44 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 20 Mar 2020 12:39:29 -0400 Subject: [PATCH] pan/bi: Pack st_vary This should let varying writes go through finally. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_pack.c | 19 +++++++++++++++++++ src/panfrost/bifrost/bifrost.h | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index c8070dbf96b..556ed68961f 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -593,6 +593,23 @@ bi_pack_add_ld_var_addr(bi_clause *clause, bi_instruction *ins, struct bi_regist RETURN_PACKED(pack); } +static unsigned +bi_pack_add_st_vary(bi_clause *clause, bi_instruction *ins, struct bi_registers *regs) +{ + assert(ins->store_channels >= 1 && ins->store_channels <= 4); + + struct bifrost_st_vary pack = { + .src0 = bi_get_src(ins, regs, 1, false), + .src1 = bi_get_src(ins, regs, 2, false), + .src2 = bi_get_src(ins, regs, 3, false), + .channels = MALI_POSITIVE(ins->store_channels), + .op = BIFROST_ADD_OP_ST_VAR + }; + + bi_read_data_register(clause, ins); + RETURN_PACKED(pack); +} + static unsigned bi_pack_add_atest(bi_clause *clause, bi_instruction *ins, struct bi_registers *regs) { @@ -663,7 +680,9 @@ bi_pack_add(bi_clause *clause, bi_bundle bundle, struct bi_registers *regs) case BI_FMOV: case BI_SHIFT: case BI_STORE: + return BIFROST_ADD_NOP; case BI_STORE_VAR: + return bi_pack_add_st_vary(clause, bundle.add, regs); case BI_SPECIAL: case BI_SWIZZLE: case BI_TEX: diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index b0662966eab..6ee9291ca7b 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -121,6 +121,16 @@ struct bifrost_add_2src { unsigned op : 14; } __attribute__((packed)); +#define BIFROST_ADD_OP_ST_VAR (0x19300 >> 8) + +struct bifrost_st_vary { + unsigned src0 : 3; + unsigned src1 : 3; + unsigned src2 : 3; + unsigned channels : 2; + unsigned op : 9; +} __attribute__((packed)); + #define BIFROST_ADD_OP_ATEST (0xc8f) struct bifrost_add_atest { -- 2.30.2