From bc6f1afc79c0258dae7b082d9bf2f7ef8e9aadc3 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 30 Jun 2022 08:53:11 -0700 Subject: [PATCH] freedreno: Add pkt4 assert Add assert to catch places where we overflow max PKT4 size Signed-off-by: Rob Clark Part-of: --- src/freedreno/common/freedreno_pm4.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h index 4320a5c8508..5a46c0a8124 100644 --- a/src/freedreno/common/freedreno_pm4.h +++ b/src/freedreno/common/freedreno_pm4.h @@ -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));