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 <robdclark@gmail.com>
This commit is contained in:
Rob Clark 2017-05-16 08:37:50 -04:00
parent da9a1cb8a6
commit dafc2f1887
3 changed files with 13 additions and 3 deletions

View file

@ -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);
}

View file

@ -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);

View file

@ -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);
}