From 398e65693b0be51f2300ed345185865a8baa86b7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 14 May 2021 18:00:10 -0400 Subject: [PATCH] panfrost: Add draw-time merge helper The famous GenXML "OR" trick. Will be *essential* to packing RSDs. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/lib/gen_pack.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/lib/gen_pack.py b/src/panfrost/lib/gen_pack.py index fbb08a4eed5..8f9411a0f7d 100644 --- a/src/panfrost/lib/gen_pack.py +++ b/src/panfrost/lib/gen_pack.py @@ -169,6 +169,12 @@ __gen_unpack_padded(const uint8_t *restrict cl, uint32_t start, uint32_t end) #define pan_section_print(fp, A, S, var, indent) \\ MALI_ ## A ## _SECTION_ ## S ## _print(fp, &(var), indent) +#define pan_merge(packed1, packed2, type) \ + do { \ + for (unsigned i = 0; i < (MALI_ ## type ## _LENGTH / 4); ++i) \ + packed1.opaque[i] |= packed2.opaque[i]; \ + } while(0) + #define mali_pixel_format_print_v6(fp, format) \\ fprintf(fp, "%*sFormat (v6): %s%s%s %s%s%s%s\\n", indent, "", \\ mali_format_as_str((enum mali_format)((format >> 12) & 0xFF)), \\