Skip to content
Snippets Groups Projects
Commit d33e79e5 authored by Lucas Stach's avatar Lucas Stach Committed by Eric Engestrom
Browse files

etnaviv: drm: fix size limit in etna_cmd_stream_realloc


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: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <mesa/mesa!14425>
(cherry picked from commit ccfd5054)
parent 4781087c
No related branches found
No related tags found
Loading
......@@ -949,7 +949,7 @@
"description": "etnaviv: drm: fix size limit in etna_cmd_stream_realloc",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},
......
......@@ -56,13 +56,13 @@ void etna_cmd_stream_realloc(struct etna_cmd_stream *stream, size_t n)
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);
......@@ -75,7 +75,7 @@ void etna_cmd_stream_realloc(struct etna_cmd_stream *stream, size_t n)
return;
error:
WARN_MSG("command buffer too long, forcing flush.");
DEBUG_MSG("command buffer too long, forcing flush.");
etna_cmd_stream_force_flush(stream);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment