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

Author: Rob Clark <[email protected]>
Date:   Tue May 16 08:37:50 2017 -0400

freedreno/gmem: fix hw binning hangs with large render targets

On all 3 gens, we have 4 bits for width and height in the VSC pipe
config.  And overflow results in setting width and/or height to zero
which causes hangs.

Signed-off-by: Rob Clark <[email protected]>

---

 src/gallium/drivers/freedreno/a3xx/fd3_gmem.c | 3 +++
 src/gallium/drivers/freedreno/a4xx/fd4_gmem.c | 7 ++++---
 src/gallium/drivers/freedreno/a5xx/fd5_gmem.c | 6 ++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c 
b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
index 0ec769b9d6..151ecfbf61 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
@@ -152,6 +152,9 @@ use_hw_binning(struct fd_batch *batch)
        if ((gmem->maxpw * gmem->maxph) > 32)
                return false;
 
+       if ((gmem->maxpw > 15) || (gmem->maxph > 15))
+               return false;
+
        return fd_binning_enabled && ((gmem->nbins_x * gmem->nbins_y) > 2);
 }
 
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c 
b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c
index 5b7dc03204..49476d8636 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c
@@ -135,10 +135,11 @@ static bool
 use_hw_binning(struct fd_batch *batch)
 {
        struct fd_gmem_stateobj *gmem = &batch->ctx->gmem;
-       struct pipe_framebuffer_state *pfb = &batch->framebuffer;
 
-       /* this seems to be a hw bug.. but this hack fixes piglit fbo-maxsize: 
*/
-       if ((pfb->width > 4096) && (pfb->height > 4096))
+       if ((gmem->maxpw * gmem->maxph) > 32)
+               return false;
+
+       if ((gmem->maxpw > 15) || (gmem->maxph > 15))
                return false;
 
        return fd_binning_enabled && ((gmem->nbins_x * gmem->nbins_y) > 2);
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c 
b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
index 1a45181145..7fb0191fed 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
@@ -212,6 +212,12 @@ use_hw_binning(struct fd_batch *batch)
 {
        struct fd_gmem_stateobj *gmem = &batch->ctx->gmem;
 
+       if ((gmem->maxpw * gmem->maxph) > 32)
+               return false;
+
+       if ((gmem->maxpw > 15) || (gmem->maxph > 15))
+               return false;
+
        return fd_binning_enabled && ((gmem->nbins_x * gmem->nbins_y) > 2) &&
                        (batch->num_draws > 0);
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to