freedreno: Add pkt4 assert

Add assert to catch places where we overflow max PKT4 size

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17317>
This commit is contained in:
Rob Clark 2022-06-30 08:53:11 -07:00 committed by Marge Bot
parent b41620f9ed
commit bc6f1afc79
1 changed files with 1 additions and 0 deletions

View File

@ -71,6 +71,7 @@ pm4_pkt3_hdr(uint8_t opcode, uint16_t cnt)
static inline uint32_t
pm4_pkt4_hdr(uint16_t regindx, uint16_t cnt)
{
assert(cnt < 0x7f);
return CP_TYPE4_PKT | cnt | (pm4_odd_parity_bit(cnt) << 7) |
((regindx & 0x3ffff) << 8) |
((pm4_odd_parity_bit(regindx) << 27));