From d4dccea0ba37d6b8f91b689dd441ba6a4c8ff58c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Feb 2021 11:08:33 -0500 Subject: [PATCH] panfrost: Add UBO push data structure Will be used to generalize RMU on Midgard and also to support Bifrost's FAU (which is essentially the same thing). Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/util/pan_ir.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/panfrost/util/pan_ir.h b/src/panfrost/util/pan_ir.h index 7dd01e63647..02af7174911 100644 --- a/src/panfrost/util/pan_ir.h +++ b/src/panfrost/util/pan_ir.h @@ -78,6 +78,25 @@ struct panfrost_sysvals { struct hash_table_u64 *sysval_to_id; }; +/* Technically Midgard could go up to 92 in a pathological case but we don't + * take advantage of that. Likewise Bifrost's FAU encoding can address 128 + * words but actual implementations (G72, G76) are capped at 64 */ + +#define PAN_MAX_PUSH 64 + +/* Architectural invariants (Midgard and Bifrost): UBO must be <= 2^16 bytes so + * an offset to a word must be < 2^16. There are less than 2^8 UBOs */ + +struct panfrost_ubo_word { + uint16_t ubo; + uint16_t offset; +}; + +struct panfrost_ubo_push { + unsigned count; + struct panfrost_ubo_word words[PAN_MAX_PUSH]; +}; + void panfrost_nir_assign_sysvals(struct panfrost_sysvals *ctx, void *memctx, nir_shader *shader); @@ -100,6 +119,10 @@ typedef struct { unsigned sysval_count; unsigned sysvals[MAX_SYSVAL_COUNT]; + /* UBOs to push to Register Mapped Uniforms (Midgard) or Fast Access + * Uniforms (Bifrost) */ + struct panfrost_ubo_push push; + int first_tag; struct util_dynarray compiled;