From 9e05e8cb7511d7c575e226176f6e9be1c67268a4 Mon Sep 17 00:00:00 2001
From: Rob Clark <robclark@freedesktop.org>
Date: Sun, 24 Jan 2016 13:18:39 -0500
Subject: freedreno: limit string marker to max packet size

Experimentally derived max size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
---
 src/gallium/drivers/freedreno/freedreno_context.c | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'src/gallium')

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);
-- 
cgit v1.2.3