diff options
author | Eric Anholt <[email protected]> | 2017-11-01 14:39:47 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-11-07 09:19:48 -0800 |
commit | 3da39f22975703ad3688bfb4b658d219147ce9a1 (patch) | |
tree | d196272e9ab0675bd97ef84e9e0eab0017017a16 /src/gallium/drivers/vc5/vc5_cl.h | |
parent | 078b163a9c581e5b0e7bcc7436f0bf569cbc020d (diff) |
broadcom/vc5: Introduce a helper for pre-packing our V3DXX structs.
This is so much more pleasant to write than the manual
V3D33_whatever_pack() calls, and will be useful for when we start doing
actual per-V3D compiles.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_cl.h')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_cl.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_cl.h b/src/gallium/drivers/vc5/vc5_cl.h index 4c64f084d3d..f62376e296a 100644 --- a/src/gallium/drivers/vc5/vc5_cl.h +++ b/src/gallium/drivers/vc5/vc5_cl.h @@ -248,6 +248,19 @@ cl_get_emit_space(struct vc5_cl_out **cl, size_t size) cl_advance(&(cl)->next, sizeof(*packet)); \ } while (0) +#define v3dx_pack(packed, packet, name) \ + for (struct cl_packet_struct(packet) name = { \ + cl_packet_header(packet) \ + }, \ + *_loop_terminate = &name; \ + __builtin_expect(_loop_terminate != NULL, 1); \ + ({ \ + cl_packet_pack(packet)(NULL, (uint8_t *)packed, &name); \ + VG(VALGRIND_CHECK_MEM_IS_DEFINED((uint8_t *)packed, \ + cl_packet_length(packet))); \ + _loop_terminate = NULL; \ + })) \ + /** * Helper function called by the XML-generated pack functions for filling in * an address field in shader records. |