Commit Graph

3407 Commits

Author SHA1 Message Date
Emma Anholt 6e819585da ci/turnip: Add a bit of spilling-vs-ballot testing on a618.
The shared reg usage involved in the subgroup-related macros can cause
trouble for the spiller, and spilling may be implicated in CTS failures
with old versions of the subgroup tests, so let's make sure we get some
coverage.  It does seem to catch a couple of failures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17642>
2022-07-21 01:25:33 +00:00
Konrad Dybcio d3b38213e5 freedreno: Enable A619
Enable A619 as found in various SKUs of the SM Lagoon SoC, such as
SM6350 and SM7225.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17495>
2022-07-21 00:16:32 +00:00
Danylo Piliaiev 7b0fcd8932 turnip: Disable LRZ fast-clear for gen1 and gen2
LRZ fast-clear works on all gens, however blob disables it on
gen1 and gen2. We also elect to disable fast-clear on these gens
because for close to none gains it adds complexity and seem to work
a bit differently from gen3+. Which creates at least one edge case:
if first draw which uses LRZ fast-clear doesn't lock LRZ direction
the fast-clear value is undefined.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6829

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17599>
2022-07-20 02:58:44 +00:00
Emma Anholt 7e381ba9fc ci/freedreno: Switch a630 to manual/disabled for lab maintenance.
We're getting several more 630s in the lab, but need a bit of time to swap
out some broken old ones and stabilize the new ones.  Fritz thinks this
should be done in an hour or so, but I want to turn off the CI for main so
that we don't block anyone else.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17641>
2022-07-20 02:00:43 +00:00
Jason Ekstrand b510ee0d22 Use vk_foreach_struct_const where needed
We're about to make it so that the compiler warns/errors if you use the
wrong iterator macro.  Fix up a bunch of places where someone used the
wrong one before we break anything.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17630>
2022-07-19 19:55:17 +00:00
Hyunjun Ko 4bccee123f turnip: expose VK_EXT_shader_module_identifier
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17614>
2022-07-19 16:12:15 +00:00
Hyunjun Ko d046d6e9e0 turnip: Remove an unnecessary assert.
The assertion is already in the common implementation.

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17614>
2022-07-19 16:12:15 +00:00
Emma Anholt 3d62a41dcc freedreno/ir3: Enable core NIR's 16-bit ALU optimizations.
In addition to hopefully generating shorter code, this optimizes out a
comparison of a mediump-cast value in
dEQP-GLES2.functional.shaders.algorithm.rgb_to_hsl_fragment passed
through ANGLE, and allows the test to pass.  We believe it to be a
test bug, but emitting better code like apparently everyone else does
is also a fine result.

No change on GLES gfxbench shaders.

Fixes: #6585
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17546>
2022-07-18 22:41:18 +00:00
Konstantin Seurer fc26fbde3d vulkan: Common vk_format_get_component_bits
RADV and PowerVR use the same implementation.
Turnip does use a slightly modified version but the helper only has one
use -> just inline it and get rid of turnip's vk_format.h.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17515>
2022-07-18 22:14:06 +00:00
Daniel Stone cdb7a3b0e2 Revert "CI: Disable Collabora lab"
This reverts commit 7a336c97ef692ed96cc93394596a7d0650983874.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17563>
2022-07-16 11:44:26 +00:00
Daniel Stone 02d9d1557b CI: Disable Collabora lab
It's everyone's favourite day, infrastructure maintenance Friday.

This includes manual disables for a618-vk and zink-anv-tgl, because
apparently the disable-on-variable rules don't carry through to those
jobs for ... some reason.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17553>
2022-07-15 13:26:42 +00:00
Connor Abbott 67c9ca2319 tu: Use incoherent CCU write for buffer accesses
Unlike image writes, buffer writes may access the same memory in
different ways, which we've seen in the past can cause problems. Use an
incoherent access to force flush/invalidate between accesses to the same
buffer, unless we know the barrier applies to images only.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17193>
2022-07-14 17:23:39 +00:00
Emma Anholt 43579901be ir3: Fix the no-emitted-vertex condition emission in geom lowering.
The if statement we insert would insert a new block before the end block
(and remove the old pre-end-block).  If the new block ended up later in
the HT due to its pointer's hash value, you'd emit another copy of the if
statement after the last one.  I saw this happen up to 4 times in testing.
The worst case would be if all those additions and removals ended up
reallocating the HT, at which point we might use-after-free.

Fixes inconsistent shader-db results with geometry shaders.

Cc: mesa-stable.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17501>
2022-07-13 18:16:45 +00:00
Adam Jackson 768238fdc0 glx: Fix drawable refcounting for naked Windows
driFetchDrawable is only ever called from the MakeCurrent path, which
means it has to handle the case of pre-GLX-1.3 Windows being named as
the drawable. When it finds the drawable in the hash, it increments its
refcount before returning it, so for a GLXWindow it would be 2 on first
return, one from glXCreateWindow and one from glXMakeCurrent. But when
it does not find the drawable and creates one for the naked Window, the
reference count on first return would only be 1. As a result, if this
context was then ever bound to a different drawable, the old Window's
DRI drawable state (like the back buffer) would be destroyed.

Fixes piglit's glx-multi-window-single-context and glx-make-current for
a variety of drivers.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6713
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17479>
2022-07-13 12:25:30 -04:00
Georg Lehmann d9fb1b05eb ir3: Implement [iu]sub_sat.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17468>
2022-07-13 07:34:09 +00:00
Danylo Piliaiev b059cdad40 turnip: Add TU_GPU_TRACEPOINT envvar to toggle tracepoints
All tracepoints are enabled by default.

Example:
 TU_GPU_TRACEPOINT=-sysmem_clear

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16781>
2022-07-12 22:24:19 +00:00
Danylo Piliaiev d903c6c7f3 turnip: Refactor tracepoints generation to reduce duplication
This way we will not need to repeat arguments for "start" and "end"
tracepoints.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16781>
2022-07-12 22:24:19 +00:00
Emma Anholt e9d4c29f6a ci/freedreno: Mark an occasional flake pass that happens on a530.
This MR just saw it happen for the second time I've noticed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>
2022-07-12 21:57:23 +00:00
Connor Abbott cf0cfd572e freedreno/a6xx: VPC_SO_NCOMP is actually VPC_SO_BUFFER_STRIDE
This answers the question in a comment in turnip, and fixes some GL46
tests and piglit tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17494>
2022-07-12 17:57:07 +00:00
Eric Engestrom 2c99dc5b22 turnip: use updated tokens from vk.xml
Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>
2022-07-12 15:53:11 +00:00
Emma Anholt 4822058b1c ir3: Use non-persp interpolation when appropriate for interpolateAtOffset.
Fixes dEQP-VK.draw.renderpass.linear_interpolation.offset_min_4_samples.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt c5eb7ef246 ir3: Clarify what's happening in the interpolateAtOffset() math.
nir_builder lets us build much cleaner code than we had (assuming that we
get a scalarizing after this).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt 240a98297d freedreno: Rename the "SIZE" regs for interpolateAtOffset to "CENTERRHW"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt 0e1fb2d984 nir+ir3: Rename load_size_ir3 to load_center_rhw_ir3.
Now that we know what it does, it also explains what it's doing in
interpolateAtOffset in ir3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt 9dcb94e0e1 ir3: Make sure to pass the interp_mode through in our load_bary lowering.
Fixes dEQP-VK.draw.renderpass.linear_interpolation.* in vkcts 1.3.3.0

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17322>
2022-07-11 16:56:05 +00:00
Emma Anholt 4b404e22d0 turnip: Refactor vertex input setup a little.
The repeated reservation code could be moved into the function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17102>
2022-07-11 16:32:03 +00:00
Emma Anholt ec5984c0d4 turnip: Fix the reservation for vertex inputs.
It was too large since 2cd30266f1 ("tu: Refactor VS DECODE/DEST to be
emitted in two pkt4"), so fix it and also give it a name next to the code
it relates to.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17102>
2022-07-11 16:32:03 +00:00
Emma Anholt 12314067c4 turnip: Fix up per-stage additional size accounting.
input_size is the dwords emitted (hard to tell because of all of the * 4 /
4 going on), and constant_data is emitted with the emit_program call too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17102>
2022-07-11 16:32:03 +00:00
Emma Anholt 7d9a824d27 turnip: Account for additional_cs_reserve_size for both bin and render.
Both emit_program() calls will use this space.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17102>
2022-07-11 16:32:03 +00:00
İlhan Atahan 4bd128f748 Add Adreno 616 and 620 to use turnip on these GPU's .
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17441>
2022-07-10 15:36:52 +00:00
Marek Olšák c9ca8abe4f Change all debug_assert calls to assert
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>
2022-07-10 00:50:35 +00:00
Rob Clark c2c2da91a8 freedreno/a6xx: Do clip-plane lowering in backend
Our GS-lowered-to-quasi-VS confuses core nir passes, so handle clip-
plane lowering ourself.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 8f77187e3e freedreno/ir3: Fix GS clip-plane lowering
And also handle tess.  In all cases, we want to use the VS lowering pass
on the last geometry stage.  We don't make a special exception for GS
like other drivers, because GS gets lowered into a quasi-VS.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark f2d9805f9b freedreno/ir3: Add more tess varying slots
Fixes some piglits that I stumbled across by mistake.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark ff22be1110 freedreno/ir3: Copy vars if needed on EndPrimitive()
If we didn't EmitPrimitive() then the shadow (old) outputs would not
get copied to the emit temps (to eventually be copied back to the real
outputs.  This isn't so bad except that means the realy vertex_flags
output has an undefined value.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 1fdddb1424 freedreno/ir3: Add copy_vars() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 5434de7ab6 freedreno/ir3: Don't lower_gs multiple times
At least with gallium, this can be called multiple times via
pipe_screen::finalize_nir().  But it is not designed to be called
multiple times, and can result in vertex_flags getting 'optimized'
away.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6720
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Rob Clark 62c5d428bc turnip: assert valid vertex_flag reg
If this somehow gets optimized out, the GS will run forever.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17341>
2022-07-08 20:32:35 +00:00
Danylo Piliaiev bf4c160909 tu: Fix prim gen query and pipeline stats query interaction
Fixed:
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT was able to stop prim counter
  when pipeline stats query is running.
  - This may have happened when prim gen query was in secondary cmdbuf.
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT counting geometry in each tile.
- VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT counting geometry in each tile
  when pipeline stats query is started inside prim gen query and inside
  a renderpass.

The matter of VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT and pipeline stats
interaction is solved by tracking whether pipeline stats query is
running both on CPU (for non secondary cmdbuf case) and on GPU (for
secondary cmdbuf).

Note, prim gen query is not allowed with secondary command buffers, so
only pipeline stats query is tracked on gpu.
See https://gitlab.khronos.org/vulkan/vulkan/-/issues/3142

Counting geometry per each tile is solved by:
- Conditionally executing START/STOP_PRIMITIVE_CTRS to not run in tiling
  pass. Solves the case when prim gen query is inside a renderpass.
- Stop prim counters before executing `draw_cs` and restarting them
  afterwards. Solves prim gen query being outside a renderpass.

Fixes GL CTS tests with Zink + `TU_DEBUG=gmem`:
 GTF-GL46.gtf30.GL3Tests.transform_feedback.transform_feedback_max_separate
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_basic
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_framebuffer
 GTF-GL46.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_overflow
 GTF-GL46.gtf40.GL3Tests.transform_feedback3.transform_feedback3_streams_queried
 GTF-GL46.gtf40.GL3Tests.transform_feedback2.transform_feedback2_states

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6602

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17163>
2022-07-08 11:14:18 +03:00
Danylo Piliaiev 465e7c303b tu,freedreno: Refactored START/STOP events for pipeline stats
For a5xx+ renamed:
- RST_PIX_CNT -> START_FRAGMENT_CTRS
- RST_VTX_CNT -> STOP_FRAGMENT_CTRS
- TILE_FLUSH  -> START_COMPUTE_CTRS
- STAT_EVENT  -> STOP_COMPUTE_CTRS
I'm not sure about a5xx itself but I'll take a chance of it being
similar to a6xx in this regard.

Knowing this emit_begin_stat_query/emit_end_stat_query can now emit
only events that are needed for the pool's flags.

Also primitive generated query clearly doesn't need fragment and
compute counters.

Passes tests:
 dEQP-VK.query_pool.statistics_query.*
 dEQP-VK.transform_feedback.primitives_generated_query.*

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17163>
2022-07-08 11:14:18 +03:00
Pierre-Eric Pelloux-Prayer 8856379a03 mesa/st: don't guess the internal format if it's known
This fixes tests using imageLoad/imageStore on texture
created using glEGLImageTargetTexture2DOES.

Before this change, the format was guessed as GL_RGBA,
which would be rejected by _mesa_get_shader_image_format.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16662>
2022-07-07 12:25:05 +00:00
Emma Anholt 00ad29dd23 ci: Uprev deqp to 1.3.3.0.
New tests, dEQP line rasterization test fix that lets Intel pass.

Clears out bogus xfails from 1.3.2.0 uprev on a630, which I suspect were
"we lost the device twice on a full run once, and those fails got pasted
in without checking if it happened a full run again" (since we haven't
seen them in other full run attempts).

Also clears out the a630 vk asan xfails (essentially all tests run) by
turning off leak detection which was just catching leaks in vkcts.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17304>
2022-07-05 17:02:33 +00:00
Emma Anholt 01988667fd ir3: Retire the cp postsched pass now that we do RA in SSA.
Before, we needed CP post-sched to copy-propagate references to NIR
registers produced by out-of-ssa.  Now that we're in SSA, this pass ends
up not doing anything useful, and actually gets in the way by occasionally
creating a cycle in the DAG.

The entire shader-db impact is:

instructions HURT:   shaders/closed/steam/tropico-5/78.shader_test FRAG: 238 -> 242 (1.68%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17320>
2022-07-04 22:15:58 +00:00
David Heidelberg fb2266631f Revert "ci/freedreno: temporary disable AmnesiaTDD"
This reverts commit f77695d13f.

Acked-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17353>
2022-07-04 18:46:57 +02:00
Rob Clark 9e1bf8e7ac freedreno/registers: Small cleanup
Whitespace fix plus move a couple regs that ended split apart from the
rest of the VFD regs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17317>
2022-07-03 23:20:46 +00:00
Rob Clark bc6f1afc79 freedreno: Add pkt4 assert
Add assert to catch places where we overflow max PKT4 size

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17317>
2022-07-03 23:20:46 +00:00
Jonathan Marek b41620f9ed freedreno/registers: add missing varset="chip" for new enum values
Fixes: de8c769d11 ("freedreno/registers: add a7xx registers for drm/msm kernel driver")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6788
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17351>
2022-07-03 18:01:17 +00:00
David Heidelberg 1bcb883ea5 ci/freedreno: disable SpecOps trace, each run flaky
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17336>
2022-07-01 15:47:09 +00:00
Jonathan Marek de8c769d11 freedreno/registers: add a7xx registers for drm/msm kernel driver
Most of this is taken directly from the downstream kernel driver.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15602>
2022-07-01 15:11:28 +00:00
David Heidelberg 6f2a991f78 ci/freedreno: disable Stellaris trace
Revert when it gets fixed on CI runner (works on OnePlus 6T with
5.18 kernel).

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17167>
2022-07-01 15:04:04 +02:00