The intended limit for command stream size is 64KB, as this is what old
kernels can reliably do and what allows for maximum number of queued
streams on newer kernels. However, due to unit confusion with the size
member, which is in dwords, the submitted streams could grow up to
~128KB. Fix this by using the proper limit in dwords.
Flushing due to some limits being exceeded is not an issue, but is
expected with certain workloads, so lower the severity of the message
being emitted in this case to debug level.
Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14425>
void *buffer;
/*
- * Increase the command buffer size by 1 kiB. Here we pick 1 kiB
+ * Increase the command buffer size by 4 kiB. Here we pick 4 kiB
* increment to prevent it from growing too much too quickly.
*/
size = ALIGN(stream->size + n, 1024);
/* Command buffer is too big for older kernel versions */
- if (size >= 32768)
+ if (size > 0x4000)
goto error;
buffer = realloc(stream->buffer, size * 4);
return;
error:
- WARN_MSG("command buffer too long, forcing flush.");
+ DEBUG_MSG("command buffer too long, forcing flush.");
etna_cmd_stream_force_flush(stream);
}