diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-14 19:53:33 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-01 15:46:24 +0000 |
commit | 6aa7f6792d30f91eccc68fcec65b81105afc347a (patch) | |
tree | 27290d67bea4c7d16e185e21d66c9eeeba7c30fc /src/gallium/drivers | |
parent | c46b11438d363f27e9f4418766063c5be9b3e0c2 (diff) |
panfrost: Check for large tilebuffer requirements
Fixes the rest of dEQP-GLES3.functional.fragment_out.array.uint.*, this
situation occurs with MRT and large pixels.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5265>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index f477ad6dd35..5cbc53b45a3 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -390,6 +390,25 @@ panfrost_mfbd_upload(struct panfrost_batch *batch, #undef UPLOAD +/* Determines whether a framebuffer uses too much tilebuffer space (requiring + * us to scale up the tile at a performance penalty). This is conservative but + * afaict you get 128-bits per pixel normally */ + +static bool +pan_is_large_tib(struct panfrost_batch *batch) +{ + unsigned size = 0; + + for (int cb = 0; cb < batch->key.nr_cbufs; ++cb) { + struct pipe_surface *surf = batch->key.cbufs[cb]; + assert(surf); + unsigned bpp = util_format_get_blocksize(surf->format); + size += ALIGN_POT(bpp, 4); + } + + return (size > 16); +} + static struct mali_framebuffer panfrost_emit_mfbd(struct panfrost_batch *batch, unsigned vertex_count) { @@ -406,7 +425,8 @@ panfrost_emit_mfbd(struct panfrost_batch *batch, unsigned vertex_count) .width2 = MALI_POSITIVE(width), .height2 = MALI_POSITIVE(height), - .unk1 = 0x1080, + /* Seems to configure tib size */ + .unk1 = pan_is_large_tib(batch) ? 0xc80 : 0x1080, .rt_count_1 = MALI_POSITIVE(batch->key.nr_cbufs), .rt_count_2 = 4, |