mesa/src/panfrost
Alyssa Rosenzweig c6ed8bf77c panfrost: Fix uniform_count on Midgard
The compiler ABI specifies push uniforms at a 4-byte granularity (like
Bifrost), but Midgard require a 16-byte granularity. As such if the
number of pushed words is not a multiple of 4, there is a buffer overrun
at shader load time. Ordinarily this is inaccessible so the garbage is
ignored.

However, there was a great deal of confusion around the `uniform_cutoff`
variable. In some cases (such a full glmark2 run on a 64-bit processor),
the push uniforms would be at the end of a BO and the overrun would
cause a page fault.

Remove uniform_cutoff entirely and work with count directly to avoid
faulting, and round the count up to be defensive.

Closes: #4289
Fixes: ed810eb0a0 ("panfrost: Don't truncate uniform_count")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Robin Murphy <robin.murphy@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9109>
2021-02-18 16:06:36 +00:00
..
bifrost pan/bi: Use the correct size for UBO loads 2021-02-16 13:14:30 +00:00
include panfrost: Get rid of IS_BIFROST 2021-02-02 09:04:15 +01:00
lib panfrost: Fix uniform_count on Midgard 2021-02-18 16:06:36 +00:00
midgard panfrost: Fix uniform_count on Midgard 2021-02-18 16:06:36 +00:00
shared util: Add helgrind support for simple_mtx 2020-11-24 21:03:34 +00:00
util panfrost: Fix uniform_count on Midgard 2021-02-18 16:06:36 +00:00
Android.bifrost.mk android: pan/bi: Remove old IR packs 2021-01-04 17:32:31 +00:00
Android.lib.mk android: panfrost: use python3 for generated sources rules 2020-10-05 21:23:56 +00:00
Android.midgard.mk android: panfrost: use python3 for generated sources rules 2020-10-05 21:23:56 +00:00
Android.mk android: panfrost: Move pandecode into lib/ 2020-08-10 21:35:31 +02:00
Android.shared.mk android: Add panfrost support to build scripts 2019-10-31 10:03:54 +01:00
Android.util.mk panfrost: Align Android makefiles with recent changes 2020-03-23 14:03:22 +00:00
Makefile.sources panfrost: Move the blend logic out of the gallium driver 2021-02-15 11:23:46 +00:00
meson.build pan/bi: Drop on-board packing tests 2020-12-23 17:06:56 +00:00