From f4ee8d055c8b32190faab4346d279ae7ebc25f45 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 10 Jun 2019 11:51:54 -0700 Subject: [PATCH] panfrost/midgard/disasm: LOD immediate/register select Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/disassemble.c | 8 ++++++-- src/gallium/drivers/panfrost/midgard/midgard.h | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c index 49e2042f7fd..0007c01e3d0 100644 --- a/src/gallium/drivers/panfrost/midgard/disassemble.c +++ b/src/gallium/drivers/panfrost/midgard/disassemble.c @@ -1137,8 +1137,12 @@ print_texture_word(uint32_t *word, unsigned tabs) printf(","); } - if (texture->bias) - printf("%f, ", texture->bias / 256.0f); + if (texture->lod_register) { + /* TODO: Decode */ + printf("lod/bias/grad reg 0x%X, ", texture->bias); + } else if (texture->bias) { + printf("%f /* %d */, ", texture->bias / 256.0f, texture->bias); + } printf("\n"); diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h index bc283bb3651..354d611e9df 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard.h +++ b/src/gallium/drivers/panfrost/midgard/midgard.h @@ -520,7 +520,13 @@ __attribute__((__packed__)) unsigned cont : 1; unsigned last : 1; - unsigned format : 5; + unsigned format : 4; + + /* Is a register used to specify the + * LOD/bias/offset? If set, use the `bias` field as + * a register index. If clear, use the `bias` field + * as an immediate. */ + unsigned lod_register : 1; /* Is a register used to specify an offset? If set, use the * offset_reg_* fields to encode this, duplicated for each of the -- 2.30.2