Commit Graph

145027 Commits

Author SHA1 Message Date
Ian Romanick b042c71ac1 iris: Move iris_set_max_shader_compiler_threads and iris_is_parallel_shader_compilation_finished
There's going to be at least one more shader function set in
pipe_screen, so it makes more sense to do it in iris_program.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>
2021-09-17 16:36:08 -07:00
Ian Romanick aaf2e6a9f5 iris: Eliminate iris_uncompiled_shader::needs_edge_flag
Use the flag that was set by nir_lower_passthrough_edgeflags.  The
lowering passes will soon be moved to a finalize_nir hook, so there
won't be any choice.  Ideally we'd like to eliminate iris_fix_edge_flags
completely, and this is a first step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>
2021-09-17 16:36:08 -07:00
Ian Romanick d7ba52cce9 nir/edgeflags: Add a flag to indicate the edge flag input is needed
Most modern hardware needs the edge flag added as a hidden vertex input
and needs code added to the vertex shader to copy the input to an
output.  Intel hardware is a little different.  Gfx4 and Gfx5 hardware
works in the previously described mannter.  Gfx6+ hardware needs the
edge flag as a specific vertex shader input, and that input is magically
processed by fixed-function hardware without need for extra shader code.

This flag signals only that the vertex shader input is needed.  It would
be nice if we could decouple adding the vertex shader input from
generating the copy-to-output code, but that has proven to be
challenging.  Not having that code causes other passes to want to
eliminate that shader input.

v2: Convert conditional to assertion.  This pass is only called for
vertex shaders.  Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>
2021-09-17 16:36:08 -07:00
Ian Romanick 3281ccf4b1 iris: Calculate uses_atomic_load_store after all lowering
The lowering passes will soon be moved to another function, so there
won't be any choice.

As a side benefit, this allows eliminating the uses_atomic_load_store
**pointer** parameter from brw_nir_lower_storage_image.  For some reason
crocus was passing false instead of NULL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>
2021-09-17 16:36:08 -07:00
Ian Romanick e33055874b iris: crocus: Use shader_info::is_arb_asm flag
...instead of looking for "ARB" in the name of the shader.  This matches
the behavior of i965.  Using "ARB" was added in a1ebac3750 ("iris:
Implement ALT mode for ARB_{vertex,fragment}_shader"), but there's no
explanation of why that method was used.

v2: Just use shader_info::is_arb_asm everywhere instead of
iris_uncompiled_shader::use_alt_mode.  Suggested by Ken.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12858>
2021-09-17 16:36:08 -07:00
Rob Clark bf74d58f21 freedreno/a6xx: Pre-bake SO-disable stateobj
No need to re-create this every time we transition from stream-out
enabled to disabled.

Creation of streamout_disable_stateobj is deferred until we create
a program state using streamout to avoid creating it unnecessarily
and because fd6_prog_init() is called before ctx->pipe is created.
(Changing that ordering is complicated by the fact that u_blitter
copies pctx->bind_fs_state(), and friends.)

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12918>
2021-09-17 20:03:40 +00:00
Mike Blumenkrantz 60f12ac127 zink: don't leak drm fd on drmPrimeFDToHandle failure
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12911>
2021-09-17 19:33:43 +00:00
Rob Clark 8c6e789c24 freedreno: Add perf warning for WC readback
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 7e088d3621 freedreno: Used cached coherent for staging resources
These are really only accessed by the GPU once, so CPU access speed is
more important.  Especially for PIPE_MAP_READ.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 926ffea994 freedreno/drm: Use cached-coherent for control bo
Userspace frequently reads the elapsed fence, but the GPU only writes it
once per submit.  So this should be another useful place for cached-
coherent.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark f5879012ca freedreno/drm: Use cached-coherent cmdstream buffers
Some more extreme examples, like gl_driver2_off, can be bottlenecked on
writes to cmdstream.  OTOH the CP is pretty pipelined in how it slurps
in memory, so the penalty of using coherent buffers should not be so
much.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 076196ae08 freedreno/drm: Add cached-coherent bo support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 21fcb2657f freedreno/drm: Don't return shared/control bo's to cache
They can never be allocated from the cache, as fd_bo_state() would
return FD_BO_STATE_UNKNOWN

Fixes: 7dabd62464 ("freedreno/drm: Userspace fences")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 429986d5aa freedreno/drm: Consider allocation flags in bo-cache
It hasn't really mattered until now, as we keep a separate cache for
cmdstream (which is FD_BO_GPU_READONLY), and the only other flag so
far is FD_BO_SCANOUT (which the bo cache probably messes up, but it
does not matter on most hw, and on hw where it does the scanout buffer
will be imported (and therefore won't end up in the bo cache).

But when we add cached-coherent (or if we wanted to use GPU_READONLY
more) it starts to matter.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark 83085a8f39 freedreno/drm: Rename bo->flags to bo->reloc_flags
Next patch adds alloc_flags, lets rename bo->flags first to make it
clear *which* flags these are.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Rob Clark f8d2587960 freedreno/drm: Garbage collect unused bo_cache
The ring_cache that is actually used is in fd_device.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
2021-09-17 18:24:34 +00:00
Christian Gmeiner dce3c6b436 ci/bare-metal: add etnaviv
Add deqp gles2 CI run for GC2000.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>
2021-09-17 17:54:39 +00:00
Christian Gmeiner 739ef184cc ci/bare-metal: add support for eth008 power relay
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>
2021-09-17 17:54:39 +00:00
Christian Gmeiner 736c159f54 ci/bare-metal: add telnet based serial
Makes it possible to use e.g. a ser2net server in the lan.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>
2021-09-17 17:54:39 +00:00
Christian Gmeiner bdf991ff67 ci: update kernel
Switch to v5.13-rc5-for-mesa-ci-2bb5d9ffd79c branch, which includes
etnaviv MMU patches.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>
2021-09-17 17:54:39 +00:00
Christian Gmeiner 172f5db20d ci: include etnaviv support in ARMHF container.
Build the kernel with CONFIG_DRM_ETNAVIV=y and include
imx6q-cubox-i.dtb.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12852>
2021-09-17 17:54:39 +00:00
Rhys Perry a1af902531 nir/algebraic: distribute fmul(fadd(a, b), c) when b and c are constants
This allows for more MAD/FMA instructions to be created.

fossil-db (Sienna Cichlid):
Totals from 50134 (33.46% of 149839) affected shaders:
VGPRs: 2436536 -> 2436000 (-0.02%); split: -0.05%, +0.03%
SpillSGPRs: 13136 -> 13135 (-0.01%); split: -0.02%, +0.02%
CodeSize: 206621424 -> 206278292 (-0.17%); split: -0.23%, +0.07%
MaxWaves: 1116804 -> 1117448 (+0.06%); split: +0.07%, -0.01%
Instrs: 38977460 -> 38862886 (-0.29%); split: -0.33%, +0.04%
Latency: 832425389 -> 827432260 (-0.60%); split: -0.63%, +0.03%
InvThroughput: 184193457 -> 183563350 (-0.34%); split: -0.37%, +0.03%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7458>
2021-09-17 17:28:26 +00:00
Emma Anholt 63cc1fe71f freedreno: Remove dead fd_batch_reset().
Unused since 58f5605124 ("freedreno: Handle full blit discards by
invalidating the resource.")

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Emma Anholt 3ade94df86 freedreno: Use a BO bitset for faster checks for resource referenced.
When moving the batch cache to the context, I added hash table lookups
from batch to rsc for "is this resource in use" because we could no longer
store data in the rsc bo under the batch cache's lock.

We can save that cost by tracking a bitfield of resources referenced by
the batch, which gives us very cheap checks in the draw path at a minor
cost in memory.  We can just use the GEM BO handle, since it's a nice
small integer already (we can't use the TC buffer ID, because the frontend
changes that, and we're in the driver thread).

This required moving the !pending() assert up in resource shadowing, since
the BO swap meant we were checking pending on the wrong resource.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Emma Anholt 22486ffa51 freedreno: Remove the submit lock locking.
I think the whole submit lock thing should be possible to remove now, but
just getting rid of the lock since we're no longer sharing batches between
ctxes means another several percent draw overhead improvement.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Emma Anholt b2349a4671 freedreno: Move the batch cache to the context.
Our draw call rate was significantly limited by the atomics we had to do
to manage access to the batch cache.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Emma Anholt c3d6493122 freedreno: Use TC's flag for whether get_query is in the driver thread.
In moving batch cache to the context, the check for whether there's
pending work being done to this resources ends up accessing the context,
so we can't do it outside of the fd_context_access_begin().  This flag
lets us do the driver-thread asserts before we've decided whether we need
to flush.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Emma Anholt cbbe3e7641 freedreno: Precompute resource pointer hash values.
It was around half a percent of the CPU in the fd-bc-ctx branch, and adds
4b to our 472b struct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11511>
2021-09-17 17:07:43 +00:00
Rhys Perry f24f62f4ad aco/nops: fix handle_raw_hazard_internal when visiting the current block
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12720>
2021-09-17 16:43:00 +00:00
Rhys Perry a8cc911aaf aco/nops: add State
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12720>
2021-09-17 16:43:00 +00:00
Rhys Perry bdf7eed045 aco/nops: create handle_raw_hazard_instr helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12720>
2021-09-17 16:43:00 +00:00
Rhys Perry bd07118b56 aco/nops: use up-to-date mask_size
fossil-db (Pitcairn):
Totals from 6 (0.00% of 129702) affected shaders:
CodeSize: 8760 -> 8736 (-0.27%)
Instrs: 1714 -> 1708 (-0.35%)
Latency: 12325 -> 12302 (-0.19%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12720>
2021-09-17 16:43:00 +00:00
Connor Abbott dfe432d829 ir3: Make trig replacement expression exact
This prevents other optimizations from associating the inner multiply,
which can add inaccuracies that can lead to discontinuities around the
boundary of the ffract. We should use exactly the sequence that the blob
uses to avoid problems.

Since fadd + fmul cannot be combined to ffma when exact is specified, we
have to use ffma ourselves.

Fixes artifacts in PixMark Volplosion with !7458.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12912>
2021-09-17 15:45:29 +00:00
Rhys Perry 6ed18749de aco: allow live-range splits of linear vgprs in top-level blocks
Fixes dEQP-VK.ssbo.phys.layout.random.8bit.all_per_block_buffers.46 on
GFX8.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry 8d50385bbd aco: implement linear vgpr copies
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry b1e4794f0f aco/tests: add regalloc.scratch_sgpr.create_vector
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry f41200d289 aco/tests: fix finish_ra_test()
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry 207b2cd434 aco: find scratch reg for sub-dword psuedo instructions which read sgprs
If there's a sgpr operand before a sub-dword operand, a scratch register
will not be found on GFX6/7.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry f2a48f4eae aco: find a scratch register for sub-dword copies on GFX7 if scc is empty
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry da74e0f012 aco: rewrite print_reg_class()
Make it work for any regclass, and print linear VGPRs differently from
logical ones.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry e2b77e6cd4 aco: add and use RegClass::resize helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry 783609a849 aco: add RegClass::is_linear_vgpr helper
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12172>
2021-09-17 14:36:03 +00:00
Rhys Perry dfa8ef723b radv: fix pipeline caching with robust buffer access
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12900>
2021-09-17 13:49:46 +00:00
Mike Blumenkrantz 5eb59a03ec util/tc: rename tc_replace_buffer_storage_func::num_rebinds and document
this parameter is only a hint, as tc provides no method for tracking cases
when a buffer is bound multiple times to the same site (e.g., multiple vertex
buffer slots will be counted as 1 bind), so rename to "minimum" to be more clear

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12898>
2021-09-17 12:32:29 +00:00
Mike Blumenkrantz 85305b2d61 features: fix listing for GL_ARB_parallel_shader_compile
this isn't actually all drivers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12909>
2021-09-17 12:27:15 +00:00
Samuel Pitoiset c952655693 ac/rgp, radv: report wave size for shaders
Fills the "Wave mode" in "Pipelines" for GPUs that supports Wave32.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12896>
2021-09-17 08:05:36 +00:00
Samuel Pitoiset d29c381c64 ac/rgp, radv: report scratch memory size for shaders
Fills the "Scatch Mem" with "Yes/No" in "Pipelines", this requires
instruction timing to be enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12896>
2021-09-17 08:05:36 +00:00
Pierre-Eric Pelloux-Prayer 57c63d7204 Revert "ci/v3d: add piglit flake"
This reverts commit 7d5aea9edf.

The test isn't flaky: now that the regression is fixed we can
remove it from the flakes list.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12849>
2021-09-17 09:42:19 +02:00
Pierre-Eric Pelloux-Prayer 4c0b8254a2 vbo/dlist: reallocate the vertex buffer on vertex upgrade
upgrade_vertex copies save->copied.nr vertices to the vertex buffer,
so we need to make sure it has enough space to accomodate them.

This commit also drops the usage of COPY_CLEAN_4V_TYPE_AS_UNION in
this function because it always writes 4-components for all attributes,
but our buffer might be smaller. Instead, only write the needed
components.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5353
Fixes: cc57156dce ("vbo/dlist: rework vertex_store management")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12849>
2021-09-17 09:42:19 +02:00
Filip Gawin beb7ed2b89 r300: assert that array in translate_vertex_program is initialized
Problematic usage is in case RC_OPCODE_ENDLOOP, at line
ret_addr = loops[--loop_depth];

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12880>
2021-09-17 07:19:24 +00:00