From: Rob Clark Date: Sun, 24 Jan 2016 18:18:39 +0000 (-0500) Subject: freedreno: limit string marker to max packet size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e05e8cb7511d7c575e226176f6e9be1c67268a4;p=mesa.git freedreno: limit string marker to max packet size Experimentally derived max size. Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index c5ea86f9368..c54bb1091f7 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -152,6 +152,9 @@ fd_emit_string_marker(struct pipe_context *pctx, const char *string, int len) struct fd_ringbuffer *ring = ctx->ring; const uint32_t *buf = (const void *)string; + /* max packet size is 0x3fff dwords: */ + len = MIN2(len, 0x3fff * 4); + OUT_PKT3(ring, CP_NOP, align(len, 4) / 4); while (len >= 4) { OUT_RING(ring, *buf);