Module: Mesa
Branch: main
Commit: 027ee6c9e9c20033d0afb3c65684573f286072c7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=027ee6c9e9c20033d0afb3c65684573f286072c7

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Oct 21 16:38:38 2022 -0400

panfrost: Lower MAX_BLOCK_SIZE on Midgard

To match PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK, having it be higher in any
dimension is nonsensical and can confuse apps. Fixes tests in
KHR-GLES31.core.texture_buffer.* on Mali-T860.

Fixes: 9b19104a30b ("pan/mdg: Lower PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK on 
Midgard")
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19238>

---

 src/gallium/drivers/panfrost/pan_screen.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_screen.c 
b/src/gallium/drivers/panfrost/pan_screen.c
index 94ff4a5d3a5..e37695fe912 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -682,9 +682,16 @@ panfrost_get_compute_param(struct pipe_screen *pscreen, 
enum pipe_shader_ir ir_t
 
         case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE:
                 /* Unpredictable behaviour at larger sizes. Mali-G52 advertises
-                 * 384x384x384. The smaller size is advertised by Mali-T628,
-                 * use min until we have a need to key by arch */
-               RET(((uint64_t []) { 256, 256, 256 }));
+                 * 384x384x384.
+                 *
+                 * On Midgard, we don't allow more than 128 threads in each
+                 * direction to match PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK.
+                 * That still exceeds the minimum-maximum.
+                 */
+                if (dev->arch >= 6)
+                        RET(((uint64_t []) { 256, 256, 256 }));
+                else
+                        RET(((uint64_t []) { 128, 128, 128 }));
 
        case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK:
                 /* On Bifrost and newer, all GPUs can support at least 256 
threads

Reply via email to