Module: Mesa Branch: main Commit: c4b7128d84b81a8455dc3ed029fa67f530c40784 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4b7128d84b81a8455dc3ed029fa67f530c40784
Author: Simon Perretta <[email protected]> Date: Tue Feb 14 01:12:20 2023 +0000 pvr: Add support for IDF Signed-off-by: Simon Perretta <[email protected]> Acked-by: Frank Binns <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21474> --- .../rogue/passes/rogue_schedule_instr_groups.c | 4 ++++ src/imagination/rogue/rogue.h | 2 ++ src/imagination/rogue/rogue_backend_instrs.def | 1 + src/imagination/rogue/rogue_encode.c | 9 +++++++++ src/imagination/rogue/rogue_info.c | 6 ++++++ src/imagination/rogue/rogue_isa.h | 18 ++++++++++++++++++ 6 files changed, 40 insertions(+) diff --git a/src/imagination/rogue/passes/rogue_schedule_instr_groups.c b/src/imagination/rogue/passes/rogue_schedule_instr_groups.c index 7cef13a0c9c..af234289758 100644 --- a/src/imagination/rogue/passes/rogue_schedule_instr_groups.c +++ b/src/imagination/rogue/passes/rogue_schedule_instr_groups.c @@ -624,6 +624,10 @@ static void rogue_calc_backend_instrs_size(rogue_instr_group *group, } break; + case ROGUE_BACKEND_OP_IDF: + group->size.instrs[phase] = 2; + break; + case ROGUE_BACKEND_OP_EMITPIX: group->size.instrs[phase] = 1; break; diff --git a/src/imagination/rogue/rogue.h b/src/imagination/rogue/rogue.h index 46a8e55eedc..04c1d61eb28 100644 --- a/src/imagination/rogue/rogue.h +++ b/src/imagination/rogue/rogue.h @@ -1343,6 +1343,8 @@ enum rogue_backend_op { ROGUE_BACKEND_OP_UVSW_EMITTHENENDTASK, ROGUE_BACKEND_OP_UVSW_WRITETHENEMITTHENENDTASK, + ROGUE_BACKEND_OP_IDF, + ROGUE_BACKEND_OP_EMITPIX, ROGUE_BACKEND_OP_LD, diff --git a/src/imagination/rogue/rogue_backend_instrs.def b/src/imagination/rogue/rogue_backend_instrs.def index f962e0da411..011c320be4c 100644 --- a/src/imagination/rogue/rogue_backend_instrs.def +++ b/src/imagination/rogue/rogue_backend_instrs.def @@ -65,6 +65,7 @@ ROGUE_BUILDER_DEFINE_BACKEND02(EMITPIX) ROGUE_BUILDER_DEFINE_BACKEND11(UVSW_WRITE) ROGUE_BUILDER_DEFINE_BACKEND11(UVSW_WRITETHENEMITTHENENDTASK) +ROGUE_BUILDER_DEFINE_BACKEND11(IDF) ROGUE_BUILDER_DEFINE_BACKEND13(LD) ROGUE_BUILDER_DEFINE_BACKEND13(FITR_PIXEL) diff --git a/src/imagination/rogue/rogue_encode.c b/src/imagination/rogue/rogue_encode.c index 6b15ad9be41..7e52739ab37 100644 --- a/src/imagination/rogue/rogue_encode.c +++ b/src/imagination/rogue/rogue_encode.c @@ -527,6 +527,15 @@ static void rogue_encode_backend_instr(const rogue_backend_instr *backend, break; + case ROGUE_BACKEND_OP_IDF: + instr_encoding->backend.op = BACKENDOP_DMA; + instr_encoding->backend.dma.dmaop = DMAOP_IDF; + instr_encoding->backend.dma.idf.drc = + rogue_ref_get_drc_index(&backend->dst[0].ref); + instr_encoding->backend.dma.idf.srcseladd = + rogue_ref_get_io_src_index(&backend->src[0].ref); + break; + case ROGUE_BACKEND_OP_EMITPIX: instr_encoding->backend.op = BACKENDOP_EMIT; instr_encoding->backend.emitpix.freep = diff --git a/src/imagination/rogue/rogue_info.c b/src/imagination/rogue/rogue_info.c index 518ebd81111..c90f3bc595b 100644 --- a/src/imagination/rogue/rogue_info.c +++ b/src/imagination/rogue/rogue_info.c @@ -258,6 +258,12 @@ const rogue_backend_op_info rogue_backend_op_infos[ROGUE_BACKEND_OP_COUNT] = { .supported_dst_types = { [0] = T(REG), }, .supported_src_types = { [0] = T(REG), }, }, + [ROGUE_BACKEND_OP_IDF] = { .str = "idf", .num_dsts = 1, .num_srcs = 1, + .phase_io = { .src[0] = IO(S0), }, + .supported_dst_types = { [0] = T(DRC), }, + .supported_src_types = { [0] = T(REG), }, + }, + [ROGUE_BACKEND_OP_EMITPIX] = { .str = "emitpix", .num_srcs = 2, .phase_io = { .src[0] = IO(S0), .src[1] = IO(S2), }, .supported_op_mods = OM(FREEP), diff --git a/src/imagination/rogue/rogue_isa.h b/src/imagination/rogue/rogue_isa.h index 2035db423e4..a3b210e0007 100644 --- a/src/imagination/rogue/rogue_isa.h +++ b/src/imagination/rogue/rogue_isa.h @@ -925,6 +925,23 @@ enum sbmode { SBMODE_BOTH = 0b11, }; +typedef struct rogue_backend_dma_idf_encoding { + /* Byte 0 */ + struct { + unsigned : 3; + unsigned drc : 1; + unsigned : 4; + } PACKED; + + /* Byte 1 */ + struct { + unsigned srcseladd : 3; + unsigned : 5; + } PACKED; +} PACKED rogue_backend_dma_idf_encoding; +static_assert(sizeof(rogue_backend_dma_idf_encoding) == 2, + "sizeof(rogue_backend_dma_idf_encoding) != 2"); + typedef struct rogue_backend_dma_encoding { union { /* Byte 0 */ @@ -934,6 +951,7 @@ typedef struct rogue_backend_dma_encoding { } PACKED; rogue_backend_dma_smp_encoding smp; + rogue_backend_dma_idf_encoding idf; rogue_backend_dma_ld_encoding ld; } PACKED; } PACKED rogue_backend_dma_encoding;
