Commit Graph

22 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 58b408611f panfrost: Remove is_64b assignments
These are redundant with GenXML defaults, they're just noise.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16916>
2022-06-08 13:42:42 +00:00
Alyssa Rosenzweig ae4841c105 panfrost: Remove redundant first_tag access
This already happens in the common prepare_rsd call.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16916>
2022-06-08 13:42:42 +00:00
Alyssa Rosenzweig c999a9daa8 panfrost: Deduplicate indirect dispatch structs
The input is specified in two identical structs, tear that apart.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16916>
2022-06-08 13:42:42 +00:00
Alyssa Rosenzweig 43884a9b09 panfrost: Use push constants for indirect dispatch
Much simpler than creating a UBO and relying on it getting optimized to a push
constant, with possible reordering.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16916>
2022-06-08 13:42:42 +00:00
Jason Ekstrand 4e60f0655a panfrost,panvk: Make fixed_sysval_ubo < 0 mean compiler-assigned
In 3559efb9bf ("panfrost: Allow passing an explicit UBO index for the
sysval UBO"), an explicit UBO index was added and it was implicitly
assumed that it would be > num_ubos.  This was convenient because it
meant 0, the default for designated initializers, implicitly meant
compiler-assigned.  However, we're about to move the sysval UBO to 0
which breaks this assumption.   Also, we don't want the back-end
compiler to even look at num_ubos since it's meaningless in Vulkan.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16276>
2022-05-12 10:53:15 +00:00
Alyssa Rosenzweig 294a357b33 panfrost,asahi,radv: Don't set internal=true manually
nir_builder_init_simple_shader does this automatically now.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14936>
2022-02-17 23:30:46 +00:00
Alyssa Rosenzweig 6c0d433d19 panfrost: Centralize our model list
Replaces panfrost-quirks.h

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14726>
2022-01-28 17:47:46 +00:00
Boris Brezillon b76420be1f panfrost: Split command stream descriptor definitions per-gen
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12208>
2021-09-30 10:30:19 +00:00
Boris Brezillon bdb37c862f panfrost: Prepare shader helpers to per-gen XML
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12935>
2021-09-20 15:18:56 +02:00
Boris Brezillon 1447db0d51 panfrost: Prepare indirect dispatch helpers to per-gen XML
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12551>
2021-08-26 10:35:17 +02:00
Boris Brezillon 423f67c1bd pan/gen_pack: Add pan_size() and pan_align() macros
And replace all references to MALI_xxx_{LENGTH,ALIGN} by
pan_{size,alignment}(xxx) calls so we can give generic alias to
midgard/bifrost specific descriptors.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12551>
2021-08-26 10:35:16 +02:00
Boris Brezillon deb4074a54 panfrost: Start splitting the panfrost pool logic
The Gallium and Vulkan drivers will soon use different memory pool
implementation, but some pieces in libpanfrost depend on pan_pool. Let's
split the implementation so we have common bits still available while
letting the drivers implement what really matters: the allocation logic.

All the generic pieces are prefixed pan_pool, and what will become the
gallium implementation is prefixed panfrost_pool. We'll then duplicate
the panfrost_pool bits in panvk and prefix it with panvk_pool, and
implementations will start diverging from there.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Alyssa Rosenzweig 77aff51090 panfrost: Don't clobber indirect dispatch fields
These should be kept as zero so they can be packed correctly. Fixes a
number of KHR-GLES31 fails.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig d4f25a9588 pan/indirect_dispatch: Use extracted values
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig fdfc8b9806 pan/indirect_dispatch: Expand split expressions
Careful algebraic transforms makes these much simpler.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig 989caacc32 pan/indirect_dispatch: Distinguish minus-1 defs
This makes the logic clearer and allows the original values to be
accessed.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig a90345d4c8 pan/indirect_dispatch: Simplify empty command case
Job type is alone with bitsize in the bottom byte of the addressed
worse, so if we use an 8-bit store we avoid the RMW complexity.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig 52991aad7f pan/indirect_dispatch: Indent NIR blocks
Easier to visualize the control flow this way.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11123>
2021-06-10 18:06:11 +00:00
Alyssa Rosenzweig 3fa1f93dac panfrost: Label all BOs in userspace
Doesn't do any fancy cross-process labeling like @shadeslayer's patches
but helps with all your intra-process labeling needs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10866>
2021-05-18 19:19:01 +00:00
Alyssa Rosenzweig b131f96aa8 pan/mdg: Set lower_uniforms_to_ubo
Rip off the band-aid. No other driver in Mesa has this combination, and
there's a reason for that. It confuses nir_to_tgsi; this commit fixes
GALLIUM_HUD (again) on Midgard.

shader-db stats aren't as bad as they appear at first blush, since the
added cycles are from added if-else branches (and only one side of the
if is taken on Midgard, which does no warping*).

total instructions in shared programs: 97036 -> 98107 (1.10%)
instructions in affected programs: 8297 -> 9368 (12.91%)
helped: 0
HURT: 45
HURT stats (abs)   min: 1 max: 52 x̄: 23.80 x̃: 25
HURT stats (rel)   min: 0.61% max: 61.90% x̄: 16.18% x̃: 14.66%
95% mean confidence interval for instructions value: 20.04 27.56
95% mean confidence interval for instructions %-change: 12.62% 19.74%
Instructions are HURT.

total bundles in shared programs: 45507 -> 46091 (1.28%)
bundles in affected programs: 3138 -> 3722 (18.61%)
helped: 2
HURT: 40
helped stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1
helped stats (rel) min: 1.54% max: 2.17% x̄: 1.86% x̃: 1.86%
HURT stats (abs)   min: 2 max: 44 x̄: 14.65 x̃: 12
HURT stats (rel)   min: 2.70% max: 50.00% x̄: 23.03% x̃: 21.25%
95% mean confidence interval for bundles value: 10.35 17.46
95% mean confidence interval for bundles %-change: 16.81% 26.88%
Bundles are HURT.

total quadwords in shared programs: 76952 -> 77849 (1.17%)
quadwords in affected programs: 6556 -> 7453 (13.68%)
helped: 2
HURT: 44
helped stats (abs) min: 1 max: 5 x̄: 3.00 x̃: 3
helped stats (rel) min: 1.73% max: 4.55% x̄: 3.14% x̃: 3.14%
HURT stats (abs)   min: 2 max: 58 x̄: 20.52 x̃: 18
HURT stats (rel)   min: 2.11% max: 46.34% x̄: 17.20% x̃: 12.96%
95% mean confidence interval for quadwords value: 15.18 23.82
95% mean confidence interval for quadwords %-change: 12.68% 19.96%
Quadwords are HURT.

total registers in shared programs: 6966 -> 6925 (-0.59%)
registers in affected programs: 347 -> 306 (-11.82%)
helped: 26
HURT: 8
helped stats (abs) min: 1 max: 4 x̄: 2.04 x̃: 2
helped stats (rel) min: 6.67% max: 42.86% x̄: 20.92% x̃: 22.22%
HURT stats (abs)   min: 1 max: 5 x̄: 1.50 x̃: 1
HURT stats (rel)   min: 9.09% max: 50.00% x̄: 17.19% x̃: 11.81%
95% mean confidence interval for registers value: -1.85 -0.56
95% mean confidence interval for registers %-change: -18.97% -4.93%
Registers are helped.

total threads in shared programs: 5040 -> 5050 (0.20%)
threads in affected programs: 13 -> 23 (76.92%)
helped: 10
HURT: 1
helped stats (abs) min: 1 max: 2 x̄: 1.10 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 50.00% max: 50.00% x̄: 50.00% x̃: 50.00%
95% mean confidence interval for threads value: 0.44 1.38
95% mean confidence interval for threads %-change: 55.98% 116.75%
Threads are helped.

Fixes: 24d7c413fe ("panfrost: Enable packed uniforms.")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10866>
2021-05-18 19:19:01 +00:00
Boris Brezillon 7db79fa677 panfrost: Flag indirect draw/dispatch shaders as internal
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10417>
2021-05-12 07:03:51 +00:00
Boris Brezillon 9b22cda364 panfrost: Add helpers to emit indirect dispatch jobs
Indirect dispatch is implemented using an extra compute job patching
the compute job header to apply the final num_workgroup values. Add
helpers to simplify emission of the such jobs.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10332>
2021-04-22 16:59:18 +00:00