Mesa (master): lima: adjust pp and gp max const buffer size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 16 01:12:04 UTC 2020


Module: Mesa
Branch: master
Commit: 001411774d203007850a157900c9cd9d0307a417
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=001411774d203007850a157900c9cd9d0307a417

Author: Erico Nunes <nunes.erico at gmail.com>
Date:   Fri Dec 11 19:58:07 2020 +0100

lima: adjust pp and gp max const buffer size

According to the mali driver output, the Mali-400 GP provides space for
304 vec4 uniforms, globals and temporary variables.

The Mali-PP supports a uniform table up to size 32768 total.
However, indirect access to an uniform only supports indices up to 8192
(a 2048 vec4 array). Trying to access beyond that currently causes a pp
job timeout with both lima and the mali driver. To prevent indices
bigger than that in application uniforms, limit to 8192 for now.

Signed-off-by: Erico Nunes <nunes.erico at gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8079>

---

 src/gallium/drivers/lima/lima_screen.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c
index 0d65aa48731..28a40e3e1cb 100644
--- a/src/gallium/drivers/lima/lima_screen.c
+++ b/src/gallium/drivers/lima/lima_screen.c
@@ -197,8 +197,10 @@ get_vertex_shader_param(struct lima_screen *screen,
    case PIPE_SHADER_CAP_MAX_OUTPUTS:
       return LIMA_MAX_VARYING_NUM; /* varying */
 
+   /* Mali-400 GP provides space for 304 vec4 uniforms, globals and
+    * temporary variables. */
    case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
-      return 16 * 1024 * sizeof(float);
+      return 304 * 4 * sizeof(float);
 
    case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
       return 1;
@@ -234,8 +236,12 @@ get_fragment_shader_param(struct lima_screen *screen,
    case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
       return 1024;
 
+   /* The Mali-PP supports a uniform table up to size 32768 total.
+    * However, indirect access to an uniform only supports indices up
+    * to 8192 (a 2048 vec4 array). To prevent indices bigger than that,
+    * limit max const buffer size to 8192 for now. */
    case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
-      return 16 * 1024 * sizeof(float);
+      return 2048 * 4 * sizeof(float);
 
    case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
       return 1;



More information about the mesa-commit mailing list