Commit Graph

904 Commits

Author SHA1 Message Date
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
Alyssa Rosenzweig a89bc59980 pan/mdg: Fix spills to TLS
LOCAL_STORAGE.zw is workgroup local memory, whereas LOCAL_STORAGE.xy is
thread local memory. Likewise PC_SP.zw is the stack pointer, which is
initialized to (LOCAL_STORAGE.zw + offset) but is modifiable by the
shader. Panfrost doesn't modify the s tack pointer, and the register
allocation logic assumes a zero offset, so let's always spill to thread
local memory = LOCAL_STORAGE.xy, as was intended by Italo's cleanup.

This is visible on any shader that spills. Compute shaders aren't
advertised yet, so WLS will be null, causing a fault like the following
(reproduced on Mali T860 with the glyphy trace):

[15634.148873] panfrost ff9a0000.gpu: Unhandled Page fault in AS0 at VA 0x0000000000000000
          Reason: TODO
          raw fault status: 0x70003C2
          decoded fault status: SLAVE FAULT
          exception type 0xC2: TRANSLATION_FAULT_LEVEL2
          access type 0x3: WRITE
          source id 0x700
[15634.658170] panfrost ff9a0000.gpu: gpu sched timeout, js=0, config=0x3300, status=0x8, head=0x31d4540,
tail=0x31d4540, sched_job=00000000e8101b2e

Fixes: 6a12ea02fe ("pan/mdg: properly encode/decode ldst instructions")
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 8d2d711026 pan/mdg: Fix output types for scalar fields
Already fixed vector, but scalar was missed.

Fixes: 4d9c0a32e7 ("pan/mdg: Use _output_ type for outmod printing")
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 6f2ea57e1d pan/mdg: Remove unused midgard_int_alu_op_prefix
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
Emma Anholt 958f11d537 midgard: Fix type for vertex_builtin_arg() and compute_builtin_arg().
It takes an intrinsic, not an ALU op.  Fixes a clang complaint about enum
conversion.

Fixes: 306800d747 ("pan/midgard: Lower gl_VertexID/gl_InstanceID to attributes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10843>
2021-05-17 17:58:49 +00:00
Alyssa Rosenzweig 01ef56a7e4 pan/mdg: Use smaller LD_UNIFORM instructions
If we only read 8 bytes from a UBO, we need to use LD_UNIFORM.64 as
opposed to LD_UNIFORM.128. In addition to probably being faster, this
fixes a buffer overrun manifesting as MMU faults with source ID
0x500/0x600/0x700, visible in WebGL Aquarium.

This is essentially the same patch as 616394cf31 ("pan/mdg: Use
appropriate sizes for global loads/stores"), only this is for UBOs where
that was for SSBOs.

Before enabling PACKED_UNIFORMS, this bug was not visible since we could
guarantee the UBO size was a multiple of 16. We no longer have that
invariant, and in rare cases the last 8 bytes of the last 16-byte slot
of a mapped uniform buffer would overrun the BO and trigger a fault,
even if the result is unused.

Fixes: 24d7c413fe ("panfrost: Enable packed uniforms.")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10772>
2021-05-12 20:04:21 +00:00
Tomeu Vizoso e882b0505e pan/midgard: Don't emit zero padding
util_dynarray_grow_bytes doesn't cope well with zero grow bytes.

../mesa/src/util/u_dynarray.h:134:8: runtime error: division by zero
    #0 0xffffa2d99288 in util_dynarray_grow_bytes ../mesa/src/util/u_dynarray.h:134
    #1 0xffffa2d99288 in emit_alu_bundle ../mesa/src/panfrost/midgard/midgard_emit.c:350
    #2 0xffffa2d99288 in emit_binary_bundle ../mesa/src/panfrost/midgard/midgard_emit.c:390
    #3 0xffffa2d738a8 in midgard_compile_shader_nir ../mesa/src/panfrost/midgard/midgard_compile.c:2740
    #4 0xffffa2cc8aa8 in panfrost_shader_compile ../mesa/src/gallium/drivers/panfrost/pan_assemble.c:68
    #5 0xffffa2c9918c in panfrost_bind_shader_state ../mesa/src/gallium/drivers/panfrost/pan_context.c:2015
    #6 0xffffa0726d94 in st_update_vp ../mesa/src/mesa/state_tracker/st_atom_shader.c:238
    #7 0xffffa070e028 in st_validate_state ../mesa/src/mesa/state_tracker/st_atom.c:261
    #8 0xffffa06c30bc in prepare_draw ../mesa/src/mesa/state_tracker/st_draw.c:132
    #9 0xffffa06c30bc in st_draw_vbo ../mesa/src/mesa/state_tracker/st_draw.c:184
    #10 0xffffa167bb20 in _mesa_validated_drawrangeelements ../mesa/src/mesa/main/draw.c:816
    #11 0xffffa167c684 in _mesa_DrawElements ../mesa/src/mesa/main/draw.c:970
    #12 0xaaaadfa5b55c in glu::drawFromUserPointers(glu::RenderContext const&, unsigned int, int, glu::VertexArrayBinding const*, glu::PrimitiveList const&, glu::DrawUtilCallback*) (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x3b355c)
    #13 0xaaaadf9ce514 in deqp::gls::ShaderLibraryCase::execute() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x326514)
    #14 0xaaaadf9cfb38 in deqp::gls::ShaderLibraryCase::iterate() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x327b38)
    #15 0xaaaadf70cc9c in deqp::gles2::TestCaseWrapper::iterate(tcu::TestCase*) (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x64c9c)
    #16 0xaaaadfb9a47c in tcu::TestSessionExecutor::iterateTestCase(tcu::TestCase*) (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x4f247c)
    #17 0xaaaadfb9b240 in tcu::TestSessionExecutor::iterate() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x4f3240)
    #18 0xaaaadfb7a564 in tcu::App::iterate() (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x4d2564)
    #19 0xaaaadf70a20c in main (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x6220c)
    #20 0xffffaf1e12a8 in __libc_start_main ../csu/libc-start.c:308
    #21 0xaaaadf70a8dc  (/home/tomeu/deqp-build/modules/gles2/deqp-gles2+0x628dc)

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10695>
2021-05-10 17:02:09 +00:00
Alyssa Rosenzweig 54046d61f8 pan/mdg: Model blend shader interference
Backport of 4439757db2 ("pan/bi: Use the interference mechanism
to describe blend shader reg use") to Midgard.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9239>
2021-05-06 23:26:21 +00:00
Alyssa Rosenzweig 1378c67bcf panfrost/blend: Inline blend constants
If we're going to key them in NIR, we might as well get the benefit of
constant folding them too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10652>
2021-05-06 16:40:50 +00:00
Alyssa Rosenzweig ba39367b96 pan/mdg: Enable nir_opt_{move, sink}
I felt bad about the last patch regressing Midgard perf, so here's some
moar Midgard perf for you ^^

total instructions in shared programs: 97089 -> 97036 (-0.05%)
instructions in affected programs: 5230 -> 5177 (-1.01%)
helped: 53
HURT: 31
helped stats (abs) min: 1 max: 17 x̄: 4.40 x̃: 6
helped stats (rel) min: 0.61% max: 12.24% x̄: 7.74% x̃: 11.54%
HURT stats (abs)   min: 1 max: 8 x̄: 5.81 x̃: 8
HURT stats (rel)   min: 1.08% max: 13.79% x̄: 9.69% x̃: 11.11%
95% mean confidence interval for instructions value: -1.89 0.63
95% mean confidence interval for instructions %-change: -3.41% 0.80%
Inconclusive result (value mean confidence interval includes 0).

total bundles in shared programs: 45612 -> 45507 (-0.23%)
bundles in affected programs: 17331 -> 17226 (-0.61%)
helped: 139
HURT: 166
helped stats (abs) min: 1 max: 21 x̄: 3.76 x̃: 2
helped stats (rel) min: 0.85% max: 18.37% x̄: 6.38% x̃: 4.55%
HURT stats (abs)   min: 1 max: 10 x̄: 2.51 x̃: 1
HURT stats (rel)   min: 0.79% max: 31.25% x̄: 7.54% x̃: 4.55%
95% mean confidence interval for bundles value: -0.90 0.21
95% mean confidence interval for bundles %-change: 0.05% 2.34%
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 77275 -> 76952 (-0.42%)
quadwords in affected programs: 32314 -> 31991 (-1.00%)
helped: 142
HURT: 179
helped stats (abs) min: 1 max: 28 x̄: 4.38 x̃: 2
helped stats (rel) min: 0.34% max: 13.79% x̄: 4.29% x̃: 2.78%
HURT stats (abs)   min: 1 max: 6 x̄: 1.67 x̃: 2
HURT stats (rel)   min: 0.44% max: 16.67% x̄: 2.93% x̃: 2.63%
95% mean confidence interval for quadwords value: -1.56 -0.45
95% mean confidence interval for quadwords %-change: -0.78% 0.25%
Inconclusive result (%-change mean confidence interval includes 0).

total registers in shared programs: 7081 -> 6771 (-4.38%)
registers in affected programs: 2217 -> 1907 (-13.98%)
helped: 193
HURT: 75
helped stats (abs) min: 1 max: 6 x̄: 2.04 x̃: 1
helped stats (rel) min: 6.25% max: 62.50% x̄: 24.32% x̃: 20.00%
HURT stats (abs)   min: 1 max: 3 x̄: 1.11 x̃: 1
HURT stats (rel)   min: 7.14% max: 50.00% x̄: 17.17% x̃: 14.29%
95% mean confidence interval for registers value: -1.37 -0.94
95% mean confidence interval for registers %-change: -15.53% -9.89%
Registers are helped.

total threads in shared programs: 5036 -> 5152 (2.30%)
threads in affected programs: 185 -> 301 (62.70%)
helped: 93
HURT: 19
helped stats (abs) min: 1 max: 2 x̄: 1.49 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1 max: 2 x̄: 1.21 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.82 1.25
95% mean confidence interval for threads %-change: 63.96% 85.14%
Threads are helped.

total loops in shared programs: 19 -> 19 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 2 -> 0
spills in affected programs: 2 -> 0
helped: 1
HURT: 0

total fills in shared programs: 15 -> 0
fills in affected programs: 15 -> 0
helped: 1
HURT: 0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10652>
2021-05-06 16:40:50 +00:00
Alyssa Rosenzweig ad6e53da5c pan/mdg: Remove midgard_opt_copy_prop_reg
This is known broken code, and the fix is highly nontrivial. It isn't
doing terribly much for perf, so just rip off the band-aid. Prevents a
dEQP regression, and likely fixes bugs in real apps too.

total instructions in shared programs: 96640 -> 97089 (0.46%)
instructions in affected programs: 27831 -> 28280 (1.61%)
helped: 33
HURT: 301
helped stats (abs) min: 1 max: 6 x̄: 3.64 x̃: 5
helped stats (rel) min: 1.96% max: 10.00% x̄: 6.48% x̃: 7.94%
HURT stats (abs)   min: 1 max: 18 x̄: 1.89 x̃: 1
HURT stats (rel)   min: 0.46% max: 15.00% x̄: 3.17% x̃: 2.38%
95% mean confidence interval for instructions value: 1.09 1.59
95% mean confidence interval for instructions %-change: 1.80% 2.63%
Instructions are HURT.

total bundles in shared programs: 45615 -> 45612 (<.01%)
bundles in affected programs: 11257 -> 11254 (-0.03%)
helped: 121
HURT: 146
helped stats (abs) min: 1 max: 7 x̄: 2.34 x̃: 1
helped stats (rel) min: 1.22% max: 23.33% x̄: 7.85% x̃: 5.26%
HURT stats (abs)   min: 1 max: 17 x̄: 1.92 x̃: 2
HURT stats (rel)   min: 0.42% max: 25.00% x̄: 5.17% x̃: 3.85%
95% mean confidence interval for bundles value: -0.34 0.31
95% mean confidence interval for bundles %-change: -1.69% 0.23%
Inconclusive result (value mean confidence interval includes 0).

total quadwords in shared programs: 76662 -> 77275 (0.80%)
quadwords in affected programs: 20148 -> 20761 (3.04%)
helped: 28
HURT: 275
helped stats (abs) min: 1 max: 4 x̄: 1.54 x̃: 1
helped stats (rel) min: 0.43% max: 25.00% x̄: 4.89% x̃: 2.50%
HURT stats (abs)   min: 1 max: 12 x̄: 2.39 x̃: 2
HURT stats (rel)   min: 0.51% max: 28.57% x̄: 5.18% x̃: 4.26%
95% mean confidence interval for quadwords value: 1.80 2.25
95% mean confidence interval for quadwords %-change: 3.64% 4.86%
Quadwords are HURT.

total registers in shared programs: 7078 -> 7081 (0.04%)
registers in affected programs: 1028 -> 1031 (0.29%)
helped: 62
HURT: 70
helped stats (abs) min: 1 max: 2 x̄: 1.11 x̃: 1
helped stats (rel) min: 8.33% max: 50.00% x̄: 15.03% x̃: 12.50%
HURT stats (abs)   min: 1 max: 2 x̄: 1.03 x̃: 1
HURT stats (rel)   min: 8.33% max: 66.67% x̄: 20.13% x̃: 11.25%
95% mean confidence interval for registers value: -0.17 0.21
95% mean confidence interval for registers %-change: -0.14% 7.38%
Inconclusive result (value mean confidence interval includes 0).

total threads in shared programs: 5032 -> 5036 (0.08%)
threads in affected programs: 31 -> 35 (12.90%)
helped: 12
HURT: 6
helped stats (abs) min: 1 max: 2 x̄: 1.08 x̃: 1
helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00%
HURT stats (abs)   min: 1 max: 2 x̄: 1.50 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.43 0.87
95% mean confidence interval for threads %-change: 13.82% 86.18%
Inconclusive result (value mean confidence interval includes 0).

total loops in shared programs: 19 -> 19 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 0 -> 2
spills in affected programs: 0 -> 2
helped: 0
HURT: 1

total fills in shared programs: 0 -> 15
fills in affected programs: 0 -> 15
helped: 0
HURT: 1

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10652>
2021-05-06 16:40:50 +00:00
Alyssa Rosenzweig 4d9c0a32e7 pan/mdg: Use _output_ type for outmod printing
Fixes incorrect outmods printed for conversions.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10652>
2021-05-06 16:40:50 +00:00
Alyssa Rosenzweig a9621c4493 pan/mdg: Don't print zero
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig cb10a8e2f1 pan/mdg: Reduced printed parens
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 0b45d4b6b5 pan/mdg: Don't print mem addr brackets
Already comma separated.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig d0fc23b7bd pan/mdg: Don't print explicit .rte
Default round mode.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 9bd3ebf829 pan/mdg: Suppress most attribute tables
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 07740e78b4 pan/mdg: Don't print zero shifts
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig fa68c8bca9 pan/mdg: More concise RMU name
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 7752b09ade pan/mdg: Hide units behind MIDGARD_MESA_DEBUG=verbose
Not usually interesting unless debugging bundling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 03e3e65cd4 panfrost: Assume lower_fragcolor has been called
Allows us to clean up quite a bit.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10393>
2021-05-04 20:04:03 +00:00
Alyssa Rosenzweig 0ec27d02e1 panfrost: Don't unroll loops in GLSL
GLSL loop analysis is trouble. Just use NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10392>
2021-05-03 15:10:20 +00:00
Icecream95 f85b7aa5d4 pan/mdg: Fix calculation of available work registers
Make the rmu variable signed; otherwise the MAX2 has no effect and
work_count can end up being larger than 16.

Fixes INSTR_OPERAND_FAULTs in SuperTuxKart.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4707
Fixes: c6ed8bf77c ("panfrost: Fix uniform_count on Midgard")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10507>
2021-04-30 10:38:35 +00:00
Juan A. Suarez Romero e532a47f76 util/hash_table: do not leak u64 struct key
For non 64bit devices the key stored in hash_table_u64 is wrapped in
hash_key_u64 structure, which is never free.

This commit fixes this issue by just removing the user-defined
`delete_function` parameter in hash_table_u64_{destroy,clear} (which
nobody is using) and using instead a delete function to free this
structure.

Fixes: 608257cf82 ("i965: Fix INTEL_DEBUG=bat")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10480>
2021-04-29 12:58:23 +02:00
Italo Nicola 337957956e pan/mdg: improve tex opcode decoding and add missing ops
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola 6a12ea02fe pan/mdg: properly encode/decode ldst instructions
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola 4b933260d9 pan/mdg: print names of non-work registers
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola d2119073de pan/mdg: improve ldst opcode names and add missing ops
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola a567f60b3e pan/mdg: add helpers for load/store special read regs
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola 733d25cfce pan/mdg: misc cleanups
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola 291df07edb pan/mdg: print special alu arg outmods
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola cefa2e27da pan/mdg: remove register prefixes
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:08 +00:00
Italo Nicola 0ef3efb7fa pan/mdg: improve mask decoding
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 7abeee1eff pan/mdg: fix midgard.h indentation
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola cb7527a9ef pan/mdg: stop using size disambiguation suffixes
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola ce445c0e47 pan/mdg: print input data type for ALU opcodes
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 5d8301977b pan/mdg: stop querying datatype by reading opcode name
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola fdae70b807 pan/mdg: fix/change ALU opcodes descriptions and add some missing ops
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 94c03264d8 pan/mdg: improve swizzle decoding
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 7f0bf3d82d pan/mdg: improve input modifier printing
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola baea01816a pan/mdg: add midgard_src_expand_mode validation
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola b6c7da98be pan/mdg: encode/decode expand_mode properly
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola f8a8dc1645 pan/mdg: add proper expand_mode enum
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 77e05b6a86 pan/mdg: refactor mir_pack_swizzle
This commit makes mir_pack_swizzle set rep_low, rep_high and half in a
more explicit way, helping in the transition to a unified expand_mode
enum in the following commit.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola ea3115027e pan/mdg: improve outmod printing
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola 4cc7f2d84e pan/mdg: rename dest_override to shrink_mode
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Italo Nicola eddb2a8988 pan/mdg: clean up redundant/unused variables in disassemble.c
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9461>
2021-04-27 07:04:07 +00:00
Boris Brezillon 54a4e75223 pan/midg: Make sure the constant offset is in range in mir_match_iadd()
The offset field is an 18-bit signed integer, if the offset is bigger
than that we can get rid of the intermediate iadd.

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/10332>
2021-04-22 16:59:18 +00:00
Boris Brezillon c09439721c pan/midg: Fix midgard_pack_common_store_mask()
st_u64() gets an invalid mask when component Y is written.

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/10332>
2021-04-22 16:59:18 +00:00
Boris Brezillon 51a4bca3c3 pan/midg: Fix 2 memory leaks
The ssa_constants hash table and its elements are leaked. Pass the
context to the allocator to avoid that.

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/10408>
2021-04-22 16:25:40 +02:00