diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-07-14 17:08:54 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-16 19:59:43 +0000 |
commit | 9addb82148c487d6660aecea1af370c2d21d1788 (patch) | |
tree | f794fa86c389b1b3e78631edda30325d3f8e8c3b /src/gallium/drivers | |
parent | 77bb19eebd1d59c7fc48b41c0f356114f5eab2ef (diff) |
panfrost: Avoid integer underflow in rt_count_1
If rt_count = 0, this underflows to MAX_MRT. The hw doesn't seem to care
but it's semantically incorrect and confuses pandecode.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5858>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_mfbd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index ac890b5c56f..7e9d8cb013a 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -482,7 +482,7 @@ panfrost_emit_mfbd(struct panfrost_batch *batch, unsigned vertex_count) /* Seems to configure tib size */ .unk1 = pan_is_large_tib(batch) ? 0xc80 : 0x1080, - .rt_count_1 = MALI_POSITIVE(batch->key.nr_cbufs), + .rt_count_1 = MALI_POSITIVE(MAX2(batch->key.nr_cbufs, 1)), .rt_count_2 = 4, }; |