freedreno/a3xx: fix hang w/ large render targets and small gmem
authorRob Clark <robdclark@gmail.com>
Sat, 6 May 2017 18:00:35 +0000 (14:00 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 6 May 2017 18:16:33 +0000 (14:16 -0400)
Possibly other gen's have a similar limit.  Fixes glmark2 -b shadow
with larger resolutions on devices with small gmem (for example,
fullscreen 1080p on 8x16/db410c).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a3xx/fd3_gmem.c
src/gallium/drivers/freedreno/freedreno_gmem.c
src/gallium/drivers/freedreno/freedreno_gmem.h

index 493fdd29e5cf09620e08482764da1b4b0f3f9e0a..0ec769b9d6d86e952b8e119c468b8882320310f2 100644 (file)
@@ -149,6 +149,9 @@ use_hw_binning(struct fd_batch *batch)
        if (gmem->minx || gmem->miny)
                return false;
 
+       if ((gmem->maxpw * gmem->maxph) > 32)
+               return false;
+
        return fd_binning_enabled && ((gmem->nbins_x * gmem->nbins_y) > 2);
 }
 
index 23be0472b2597dde60941c8e082cc554bab01806..d4b2e8d92fc0aa6abdf7707363f63b03567a3b19 100644 (file)
@@ -219,6 +219,9 @@ calculate_tiles(struct fd_batch *batch)
                        div_round_up(nbins_x, tpp_x)) > 8)
                tpp_x += 1;
 
+       gmem->maxpw = tpp_x;
+       gmem->maxph = tpp_y;
+
        /* configure pipes: */
        xoff = yoff = 0;
        for (i = 0; i < ARRAY_SIZE(ctx->pipe); i++) {
index 42a8dfa80478ff3af103a735eee98483026deb39..f5276ce4481b6b7e96e0e40161b0b31e6e79f656 100644 (file)
@@ -57,6 +57,7 @@ struct fd_gmem_stateobj {
        uint16_t bin_w, nbins_x;
        uint16_t minx, miny;
        uint16_t width, height;
+       uint16_t maxpw, maxph;   /* maximum pipe width/height */
 };
 
 struct fd_batch;