freedreno: limit string marker to max packet size
authorRob Clark <robclark@freedesktop.org>
Sun, 24 Jan 2016 18:18:39 +0000 (13:18 -0500)
committerRob Clark <robclark@freedesktop.org>
Sat, 30 Jan 2016 17:10:13 +0000 (12:10 -0500)
Experimentally derived max size.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_context.c

index c5ea86f93680a0fda2cbc3da1ae5c9e884b3d446..c54bb1091f77ec10f8deae6176bb2b5a1981edf3 100644 (file)
@@ -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);