Skip to content
Snippets Groups Projects
Commit c6ed8bf7 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig Committed by Marge Bot
Browse files

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: ed810eb0 ("panfrost: Don't truncate uniform_count")
Signed-off-by: default avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: default avatarRobin Murphy <robin.murphy@arm.com>
Part-of: <!9109>
parent 0fc146e7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment