mesa.git
4 years agopanfrost: Filter compressed texture formats
Alyssa Rosenzweig [Fri, 10 Jul 2020 21:18:00 +0000 (17:18 -0400)]
panfrost: Filter compressed texture formats

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>

4 years agopanfrost: Pipe in compressed texture feature mask
Alyssa Rosenzweig [Fri, 10 Jul 2020 14:42:24 +0000 (10:42 -0400)]
panfrost: Pipe in compressed texture feature mask

So we can query at run-time as part of Gallium's checks.

v2: More explicit naming.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>

4 years agopanfrost: Add format codes for new compressed textures
Alyssa Rosenzweig [Fri, 10 Jul 2020 14:17:44 +0000 (10:17 -0400)]
panfrost: Add format codes for new compressed textures

Compressed formats line up with CONFIG_TEX_COMPRESSED_FORMAT_ENABLE
documented on
https://releases.linaro.org/archive/14.07/android/images/armv8-android-juno-lsk/

None of the new formats have been seen in the wild.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>

4 years agopanfrost: Compact unused BO flag bits
Alyssa Rosenzweig [Mon, 13 Jul 2020 14:07:56 +0000 (10:07 -0400)]
panfrost: Compact unused BO flag bits

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Remove panfrost_bo_access type
Alyssa Rosenzweig [Tue, 26 May 2020 18:47:21 +0000 (14:47 -0400)]
panfrost: Remove panfrost_bo_access type

It's just whether it writes or not, which is already implied by the
presence/absence of a writer. So no need to track explicitly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Remove PAN_BO_DONT_REUSE
Alyssa Rosenzweig [Tue, 26 May 2020 17:10:41 +0000 (13:10 -0400)]
panfrost: Remove PAN_BO_DONT_REUSE

Equivalent to SHARED.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Remove PAN_BO_COHERENT_LOCAL
Alyssa Rosenzweig [Tue, 26 May 2020 17:08:40 +0000 (13:08 -0400)]
panfrost: Remove PAN_BO_COHERENT_LOCAL

Ancient relic from kbase. Panfrost kernel doesn't need this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED
Alyssa Rosenzweig [Tue, 26 May 2020 17:07:23 +0000 (13:07 -0400)]
panfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED

Always checked together and really signal the same property from
different perspectives.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Index BOs from the BO map sparse array
Alyssa Rosenzweig [Tue, 26 May 2020 16:04:42 +0000 (12:04 -0400)]
panfrost: Index BOs from the BO map sparse array

Now we have a central store of them, so we may remove active_bo.

v2: Squash two patches together to prevent a race condition mid-series.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Add a sparse array to map GEM handles to BOs
Alyssa Rosenzweig [Mon, 25 May 2020 23:48:30 +0000 (19:48 -0400)]
panfrost: Add a sparse array to map GEM handles to BOs

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Fix write to free'd memory
Alyssa Rosenzweig [Thu, 9 Jul 2020 23:13:59 +0000 (19:13 -0400)]
panfrost: Fix write to free'd memory

No clue how this worked before.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 82f18b713ac ("panfrost: Keep track of active BOs")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agopanfrost: Fix fence leak
Alyssa Rosenzweig [Tue, 26 May 2020 20:57:44 +0000 (16:57 -0400)]
panfrost: Fix fence leak

When overwriting the writer, we need to release the old reference.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 2dad9fde505 ("panfrost: Start tracking inter-batch dependencies")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>

4 years agoaco: add 32-bit integer addition to can_swap_operands
Rhys Perry [Tue, 30 Jun 2020 15:16:18 +0000 (16:16 +0100)]
aco: add 32-bit integer addition to can_swap_operands

fossil-db (Navi):
Totals from 167 (0.12% of 135946) affected shaders:
CodeSize: 484892 -> 482628 (-0.47%)

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/5695>

4 years agoradv: use lower_shuffle_to_swizzle_amd
Rhys Perry [Tue, 23 Jun 2020 16:38:37 +0000 (17:38 +0100)]
radv: use lower_shuffle_to_swizzle_amd

Affects a few shaders in Detroit: Become Human and Doom Eternal.

fossil-db (Navi):
Totals from 9 (0.01% of 135946) affected shaders:
CodeSize: 31188 -> 25096 (-19.53%)
Instrs: 6136 -> 4999 (-18.53%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5695>

4 years agonir/lower_subgroups: add lower_shuffle_to_swizzle_amd
Rhys Perry [Tue, 23 Jun 2020 16:37:37 +0000 (17:37 +0100)]
nir/lower_subgroups: add lower_shuffle_to_swizzle_amd

masked_swizzle_amd can be much faster than shuffle.

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/5695>

4 years agonir/lower_subgroups: pass options struct to lower_shuffle
Rhys Perry [Mon, 6 Jul 2020 16:59:08 +0000 (17:59 +0100)]
nir/lower_subgroups: pass options struct to lower_shuffle

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/5695>

4 years agoaco: implement <32-bit masked_swizzle_amd
Rhys Perry [Thu, 2 Jul 2020 11:15:28 +0000 (12:15 +0100)]
aco: implement <32-bit masked_swizzle_amd

This is needed since we will be lowering some 8/16-bit shuffles to
masked_swizzle_amd.

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/5695>

4 years agoaco: optimize some masked swizzles to DPP
Rhys Perry [Thu, 2 Jul 2020 11:12:12 +0000 (12:12 +0100)]
aco: optimize some masked swizzles to DPP

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/5695>

4 years agoaco: read 0 from inactive lanes when using dpp
Rhys Perry [Mon, 29 Jun 2020 18:48:54 +0000 (19:48 +0100)]
aco: read 0 from inactive lanes when using dpp

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/5695>

4 years agopanfrost: Enable framebuffer fetch
Icecream95 [Mon, 6 Jul 2020 00:03:46 +0000 (12:03 +1200)]
panfrost: Enable framebuffer fetch

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Extend fetched framebuffer results
Alyssa Rosenzweig [Fri, 10 Jul 2020 17:54:06 +0000 (13:54 -0400)]
panfrost: Extend fetched framebuffer results

So NIR doesn't complain about invalid swizzles when reading a format
with less than 4 channels.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Always use SOFTWARE for pure formats
Alyssa Rosenzweig [Fri, 10 Jul 2020 16:12:36 +0000 (12:12 -0400)]
panfrost: Always use SOFTWARE for pure formats

Otherwise we end up implicitly converting ints to floating point.
Likewise for floats which again have strange interactions.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Generate shader variants on framebuffer bind
Alyssa Rosenzweig [Fri, 10 Jul 2020 16:12:14 +0000 (12:12 -0400)]
panfrost: Generate shader variants on framebuffer bind

If we keyed the shader for the framebuffer.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Use f2fmp for framebuffer lowering conversions
Icecream95 [Thu, 9 Jul 2020 01:26:26 +0000 (13:26 +1200)]
panfrost: Use f2fmp for framebuffer lowering conversions

This allows the conversion to be removed when the output is needed as
f32 anyway, for example for highp framebuffer fetch.

v2: Also change operations such as i2i16 to i2imp (Alyssa).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Stop keying on rt format when using native loads
Icecream95 [Tue, 7 Jul 2020 03:06:08 +0000 (15:06 +1200)]
panfrost: Stop keying on rt format when using native loads

Native loads are the same for any format, so we can use the same
shader variant for all framebuffer formats with a native load.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Implement texture_barrier
Icecream95 [Thu, 9 Jul 2020 23:19:07 +0000 (11:19 +1200)]
panfrost: Implement texture_barrier

This is needed for KHR_blend_equation_advanced with a blend
barrier.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Use a 32-bit ld_color_buffer op when needed
Icecream95 [Thu, 9 Jul 2020 11:44:41 +0000 (23:44 +1200)]
pan/mdg: Use a 32-bit ld_color_buffer op when needed

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Set the z/s store intrinsic base correctly
Icecream95 [Wed, 8 Jul 2020 04:00:51 +0000 (16:00 +1200)]
pan/mdg: Set the z/s store intrinsic base correctly

When EXT_shader_framebuffer_fetch is used and only depth and/or
stencil are written, we can't rely on the first output being to
depth/stencil.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Support MRT in output load lowering
Icecream95 [Mon, 6 Jul 2020 07:54:56 +0000 (19:54 +1200)]
pan/mdg: Support MRT in output load lowering

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Handle non-blend framebuffer lowering
Icecream95 [Mon, 6 Jul 2020 07:34:49 +0000 (19:34 +1200)]
pan/mdg: Handle non-blend framebuffer lowering

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Emit a tilebuffer wait loop when needed
Icecream95 [Wed, 8 Jul 2020 01:15:09 +0000 (13:15 +1200)]
pan/mdg: Emit a tilebuffer wait loop when needed

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Do the pan_lower_framebuffer pass later
Icecream95 [Mon, 6 Jul 2020 07:30:37 +0000 (19:30 +1200)]
pan/mdg: Do the pan_lower_framebuffer pass later

The pass is useful for EXT_shader_framebuffer_fetch, not just blend
shaders, so we should do it with the other lowering passes in
midgard_compile_shader_nir.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Add a bitset of render targets read by shaders
Icecream95 [Mon, 6 Jul 2020 07:41:28 +0000 (19:41 +1200)]
panfrost: Add a bitset of render targets read by shaders

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Add rt formats to shader state
Icecream95 [Mon, 6 Jul 2020 07:40:05 +0000 (19:40 +1200)]
panfrost: Add rt formats to shader state

load_output lowering will depend on the framebuffer formats.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Use the writeout tag for tilebuffer wait loops
Icecream95 [Mon, 6 Jul 2020 22:11:53 +0000 (10:11 +1200)]
pan/mdg: Use the writeout tag for tilebuffer wait loops

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopan/mdg: Handle tilebuffer wait loops
Icecream95 [Sun, 5 Jul 2020 12:22:22 +0000 (00:22 +1200)]
pan/mdg: Handle tilebuffer wait loops

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Clamp pure int pixels
Alyssa Rosenzweig [Fri, 10 Jul 2020 17:57:58 +0000 (13:57 -0400)]
panfrost: Clamp pure int pixels

We need saturate, not wrap semantic. Could optimize to a .isat/.usat
modifier but that's for future.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agopanfrost: Fix MALI_READS_TILEBUFFER
Icecream95 [Sun, 5 Jul 2020 12:19:55 +0000 (00:19 +1200)]
panfrost: Fix MALI_READS_TILEBUFFER

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agonir: Add a base value to load_raw_output_pan
Icecream95 [Mon, 6 Jul 2020 07:49:11 +0000 (19:49 +1200)]
nir: Add a base value to load_raw_output_pan

This is the render target the read instruction uses.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>

4 years agoglx: drop always-true #ifdef
Eric Engestrom [Sat, 23 May 2020 00:21:29 +0000 (02:21 +0200)]
glx: drop always-true #ifdef

Meson already guarantees we have at least xdamage >= 1.1

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5862>

4 years agoegl/wayland: add missing newline between functions
Eric Engestrom [Fri, 22 May 2020 23:44:52 +0000 (01:44 +0200)]
egl/wayland: add missing newline between functions

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5862>

4 years agoegl: Build surfaceless platform on Android
Roman Stratiienko [Sat, 11 Jul 2020 21:10:19 +0000 (00:10 +0300)]
egl: Build surfaceless platform on Android

Fixes: a38e21d6683a ("egl: always compile surfaceless")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5866>

4 years agoradv: advertise VK_EXT_extended_dynamic_state
Samuel Pitoiset [Mon, 13 Apr 2020 09:00:02 +0000 (11:00 +0200)]
radv: advertise VK_EXT_extended_dynamic_state

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add support for dynamic vertex input binding stride
Samuel Pitoiset [Mon, 13 Apr 2020 12:35:44 +0000 (14:35 +0200)]
radv: add support for dynamic vertex input binding stride

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add support for dynamic depth/stencil states
Samuel Pitoiset [Mon, 13 Apr 2020 12:47:08 +0000 (14:47 +0200)]
radv: add support for dynamic depth/stencil states

Out-of-order rasterization is disabled if a pipeline uses an
extended dynamic depth/stencil state because the driver doesn't
support enabling/disabling out-of-order dynamically.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add support for dynamic and scissor count
Samuel Pitoiset [Mon, 13 Apr 2020 11:35:33 +0000 (13:35 +0200)]
radv: add support for dynamic and scissor count

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add support for dynamic primitive topology
Samuel Pitoiset [Mon, 13 Apr 2020 11:14:59 +0000 (13:14 +0200)]
radv: add support for dynamic primitive topology

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add support for dynamic cull mode and front face
Samuel Pitoiset [Mon, 13 Apr 2020 09:33:44 +0000 (11:33 +0200)]
radv: add support for dynamic cull mode and front face

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: declare new extended dynamic states
Samuel Pitoiset [Mon, 13 Apr 2020 09:29:28 +0000 (11:29 +0200)]
radv: declare new extended dynamic states

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: add VK_EXT_extended_dynamic_state but leave it disabled
Samuel Pitoiset [Tue, 30 Jun 2020 08:56:53 +0000 (10:56 +0200)]
radv: add VK_EXT_extended_dynamic_state but leave it disabled

To make sure the new prototypes are declared.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: rework dynamic viewports/scissors support
Samuel Pitoiset [Tue, 30 Jun 2020 08:38:11 +0000 (10:38 +0200)]
radv: rework dynamic viewports/scissors support

The number of viewports/scissors is currently static because it can
only be specified at pipeline creation, but it doesn't hurt to
assume it's dynamic. Will help for supporting setting the number
of viewports/scissors dynamically.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5718>

4 years agoradv: remove the secure compile support feature
Samuel Pitoiset [Sun, 12 Jul 2020 11:59:14 +0000 (13:59 +0200)]
radv: remove the secure compile support feature

Steam was the only client of this feature and it seems no longer used.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5869>

4 years agonouveau: avoid LTO ODR warning (v2)
Dave Airlie [Mon, 13 Jul 2020 00:53:19 +0000 (10:53 +1000)]
nouveau: avoid LTO ODR warning (v2)

../src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp:69:8: warning: type ‘struct opProperties’ violates the C++ One Definition Rule [-Wodr]
   69 | struct opProperties
      |        ^
../src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp:88:8: note: a different type is defined in another translation unit
   88 | struct opProperties
      |        ^
../src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp:77:17: note: the first difference of corresponding definitions is field ‘fShared’
   77 |    unsigned int fShared : 3;
      |                 ^
../src/gallium/drivers/nouveau/codegen/nv50_ir_target_nvc0.cpp:96:17: note: a field with different name is defined in another translation unit
   96 |    unsigned int fImmd  : 4; // last bit indicates if full immediate is suppoted

nvc0 code also has the same thing.

v2: rename both paths (Karol)

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5873>

4 years agonvc0: set sampler index mode to independently on gv100 compute
Karol Herbst [Sun, 12 Jul 2020 22:13:54 +0000 (00:13 +0200)]
nvc0: set sampler index mode to independently on gv100 compute

We don't use linked texture/samplers. Fixes a bunch of CTS issues which
also seem to fail a bit randomly depending on what tests ran before and
such, so the list is incomplete.

Fixes:
KHR-GL46.texture_gather.*
KHR-GL46.compute_shader.resource-texture
KHR-GL46.multi_bind.dispatch_bind_samplers
KHR-GL46.multi_bind.dispatch_bind_textures
KHR-GL46.shading_language_420pack.binding_sampler_array
KHR-GL46.shading_language_420pack.binding_sampler_single
KHR-GL46.shading_language_420pack.binding_samplers
KHR-GL46.stencil_texturing.functional
KHR-GL46.texture_gather.incomplete-texture-last-comp

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5874>

4 years agoradv: return VK_ERROR_DEVICE_LOST if wait-for-idle failed or expired
Samuel Pitoiset [Fri, 10 Jul 2020 12:45:19 +0000 (14:45 +0200)]
radv: return VK_ERROR_DEVICE_LOST if wait-for-idle failed or expired

When ctx_wait_idle failed, something really bad happened likely
a GPU hang. Make sure to return the appropriate Vulkan error code
in this case.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5843>

4 years agospirv: Allow block-decorated struct types for constants
Jason Ekstrand [Fri, 10 Jul 2020 20:58:39 +0000 (15:58 -0500)]
spirv: Allow block-decorated struct types for constants

Whenever a struct type is decorated Block or BufferBlock we turn that
into a GLSL_TYPE_INTERFACE.  Since these decorations can end up random
places, we should allow them for constants.

Closes: #3252
Fixes: 9d0ae777dd6 "spirv: Use interface type for block and buffer..."
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5855>

4 years agospirv: Skip phis in unreachable blocks in the second phi pass
Jason Ekstrand [Fri, 10 Jul 2020 21:09:27 +0000 (16:09 -0500)]
spirv: Skip phis in unreachable blocks in the second phi pass

Closes: #3253
Fixes: 22fdb2f8551 "nir/spirv: Update to the latest revision"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5855>

4 years agonvc0: set local mem size for compute on gv100
Karol Herbst [Thu, 9 Jul 2020 21:52:56 +0000 (23:52 +0200)]
nvc0: set local mem size for compute on gv100

This is required when the shader uses local memory for arrays or spills.
I really dislike how it's done right now, but oh well, it's the same for
other gens.

Fixes CTS tests:
KHR-GL46.shading_language_420pack.binding_image_array
KHR-GL46.shading_language_420pack.length_of_compute_result

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5840>

4 years agofreedreno: fix layout pitchalign field not being set for imported buffers
Jonathan Marek [Sat, 11 Jul 2020 17:49:51 +0000 (13:49 -0400)]
freedreno: fix layout pitchalign field not being set for imported buffers

The pitchalign value was being left to 0 and then wrapping around when
the base offset was subtracted in texture state.

Fixes: 979e7e3680792 ("freedreno/layout: layout simplifications and pitch from level 0 pitch")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5864>

4 years agonir: allow nir_lower_clip_halfz to run in geometry shaders
Mike Blumenkrantz [Wed, 8 Jul 2020 16:43:23 +0000 (12:43 -0400)]
nir: allow nir_lower_clip_halfz to run in geometry shaders

the final output of gl_Position needs this transform, and geometry shaders
must write this value for stream 0 if rasterization is enabled

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5851>

4 years agonir: allow nir_lower_point_size_mov to run in geometry shader
Mike Blumenkrantz [Wed, 8 Jul 2020 15:59:16 +0000 (11:59 -0400)]
nir: allow nir_lower_point_size_mov to run in geometry shader

geometry shaders may need to emit PSIZ as well

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5851>

4 years agointel/compiler: don't propagate cmp to add if add is saturated
Yevhenii Kolesnikov [Thu, 12 Mar 2020 17:42:37 +0000 (19:42 +0200)]
intel/compiler: don't propagate cmp to add if add is saturated

From the Kaby Lake PRM Vol. 7 "Assigning Conditional Flags":

   * Note that the [post condition signal] bits generated at
     the output of a compute are before the .sat.

Paragraph about post_zero does not mention saturation, but
testing it on actual GPUs shows that conditional modifiers
are applied after saturation.

   * post_zero bit: This bit reflects whether the final
     result is zero after all the clamping, normalizing,
     or format conversion logic.

For signed types we don't care about saturation: it won't
change the result of conditional modifier.

For floating and unsigned types there two special cases,
when we can remove inst even if scan_inst is saturated: G
and LE. Since conditional modifiers are just comparations
against zero, saturating positive values to the upper
limit never changes the result of comparation.

For negative values:
(sat(x) >  0) == (x >  0) --- false
(sat(x) <= 0) == (x <= 0) --- true

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2610
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4167>

4 years agoaco: don't create phis with undef operands in the boolean phi pass
Rhys Perry [Fri, 10 Jul 2020 15:31:31 +0000 (16:31 +0100)]
aco: don't create phis with undef operands in the boolean phi pass

We can create better merge code is we pass on undef.

fossil-db (Navi):
Totals from 1208 (0.89% of 135946) affected shaders:
SGPRs: 66864 -> 66200 (-0.99%); split: -1.04%, +0.05%
SpillSGPRs: 1179 -> 1156 (-1.95%)
CodeSize: 6516672 -> 6469564 (-0.72%); split: -0.76%, +0.04%
Instrs: 1232680 -> 1220859 (-0.96%); split: -0.97%, +0.01%

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/3388>

4 years agoaco: optimize boolean phis with uniform selections
Rhys Perry [Thu, 9 Jan 2020 16:51:34 +0000 (16:51 +0000)]
aco: optimize boolean phis with uniform selections

Even though the boolean can be divergent, the control flow can be (at
least partially) uniform. For example, we don't have to create any
s_andn2_b64/s_and_b64/s_or_b64 instructions with this code:
a = ...
loop {
    b = bool_phi a, c
    if (uniform)
        break
    c = ...
}
d = phi c

fossil-db (Navi):
Totals from 5506 (4.05% of 135946) affected shaders:
SGPRs: 605720 -> 604024 (-0.28%)
SpillSGPRs: 52025 -> 51733 (-0.56%)
CodeSize: 65221188 -> 64957808 (-0.40%); split: -0.41%, +0.00%
Instrs: 12637881 -> 12584610 (-0.42%); split: -0.42%, +0.00%

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/3388>

4 years agoaco: create better code for boolean phis with constant operands
Rhys Perry [Mon, 6 Jan 2020 16:50:41 +0000 (16:50 +0000)]
aco: create better code for boolean phis with constant operands

fossil-db (Navi):
Totals from 6394 (4.70% of 135946) affected shaders:
SGPRs: 651408 -> 651344 (-0.01%)
SpillSGPRs: 52102 -> 52019 (-0.16%)
CodeSize: 68369664 -> 68229180 (-0.21%); split: -0.21%, +0.00%
Instrs: 13236611 -> 13202126 (-0.26%); split: -0.26%, +0.00%

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/3388>

4 years agoaco: rework boolean phi pass
Rhys Perry [Mon, 6 Jan 2020 15:46:28 +0000 (15:46 +0000)]
aco: rework boolean phi pass

The pass should now create much less linear phis.

Removes piles of phis and lots of sgpr spilling from Detroit: Become
Human and parallel-rdp.

fossil-db (Navi):
Totals from 7654 (5.63% of 135946) affected shaders:
SGPRs: 796224 -> 787616 (-1.08%); split: -1.08%, +0.00%
VGPRs: 576164 -> 572116 (-0.70%); split: -0.70%, +0.00%
SpillSGPRs: 147695 -> 52258 (-64.62%)
SpillVGPRs: 2167 -> 2102 (-3.00%)
CodeSize: 80671680 -> 76240420 (-5.49%); split: -5.50%, +0.01%
Scratch: 137216 -> 135168 (-1.49%)
MaxWaves: 54235 -> 54707 (+0.87%)
Instrs: 15569429 -> 14820569 (-4.81%); split: -4.82%, +0.01%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3388>

4 years agollvmpipe/cs: fix image/sampler binding for compute
Dave Airlie [Fri, 10 Jul 2020 05:46:54 +0000 (15:46 +1000)]
llvmpipe/cs: fix image/sampler binding for compute

The compute shader dirtying is a bit wrong here, since we don't
have a second stage like for fragment shaders, so dirty the compute
shader whenever a sampler or image changes, (ssbo/contexts don't
needs this).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5835>

4 years agollvmpipe: flush resources on sampler view binding
Dave Airlie [Thu, 23 Apr 2020 02:32:53 +0000 (12:32 +1000)]
llvmpipe: flush resources on sampler view binding

The resource may have been written to as images previously.

KHR-GL45.shader_image_load_store.advanced-sync-imageAccess2

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5835>

4 years agollvmpipe: denote NEW fs when images change.
Dave Airlie [Thu, 9 Apr 2020 03:27:09 +0000 (13:27 +1000)]
llvmpipe: denote NEW fs when images change.

The fragment shader needs to be regenerated here,
so flag the same as for sampler views.

This causes correct flushing:
KHR-GL46.shader_image_load_store.non-layered_binding

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5835>

4 years agonv50/ir/tgsi: move call to tgsi_scan_shader inside Source constructor
Karol Herbst [Fri, 10 Jul 2020 18:23:42 +0000 (20:23 +0200)]
nv50/ir/tgsi: move call to tgsi_scan_shader inside Source constructor

We actually need it there already, we just missed to move it.

Fixes: 66ed9792edb702 ("nv50: Clear nv50_ir_prog_info of dead and codegen specific variables")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5849>

4 years agobin/gen_release_notes.py: drop new_features.txt when we release XX.Y.0
Eric Engestrom [Wed, 10 Jun 2020 17:50:31 +0000 (19:50 +0200)]
bin/gen_release_notes.py: drop new_features.txt when we release XX.Y.0

Otherwise, we (rightfully) get a warning about having new features in
a bugfix release.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5416>

4 years agointroduce `commit_in_branch.py` script to help devs figure this out
Eric Engestrom [Tue, 2 Jun 2020 22:22:33 +0000 (00:22 +0200)]
introduce `commit_in_branch.py` script to help devs figure this out

It's been pointed out to me that determining whether a commit is present
in a stable branch is non-trivial (cherry-picks are a pain to search for)
and the commands are hard to remember, making it too much to ask.

This script aims to solve that problem; at its simplest form, it only
takes a commit and a branch and tells the user whether that commit
predates the branch, was cherry-picked to it, or is not present in any
form in the branch.

    $ bin/commit_in_branch.py e58a10af640ba58b6001f5c5ad750b782547da76 fdo/20.1
    Commit e58a10af640ba58b6001f5c5ad750b782547da76 is in branch 20.1
    $ echo $?
    0

    $ bin/commit_in_branch.py dd2bd68fa69124c86cd008b256d06f44fab8e6cd fdo/20.1
    Commit dd2bd68fa69124c86cd008b256d06f44fab8e6cd was backported to branch 20.1 as commit d043d24654c851f0be57dbbf48274b5373dea42b
    $ echo $?
    0

    $ bin/commit_in_branch.py master fdo/20.1
    Commit 2fbcfe170bf50fcbcd2fc70a564a4d69096d968c is NOT in branch 20.1
    $ echo $?
    1

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5306>

4 years agoanv: fix uninitialized variable access
Lionel Landwerlin [Thu, 9 Jul 2020 15:12:17 +0000 (18:12 +0300)]
anv: fix uninitialized variable access

Found with valgrind :

  ==415016== Conditional jump or move depends on uninitialised value(s)
  ==415016==    at 0x513C22B: anv_cache_lock (anv_pipeline_cache.c:346)
  ==415016==    by 0x513C2A0: anv_pipeline_cache_search (anv_pipeline_cache.c:364)
  ==415016==    by 0x50E7C88: lookup_blorp_shader (anv_blorp.c:38)
  ==415016==    by 0x5D20A98: blorp_params_get_clear_kernel (blorp_clear.c:60)
  ==415016==    by 0x5D23EFD: blorp_ccs_ambiguate (blorp_clear.c:1358)
  ==415016==    by 0x50EDE25: anv_image_ccs_op (anv_blorp.c:1882)
  ==415016==    by 0x555D92F: transition_color_buffer (genX_cmd_buffer.c:1179)
  ==415016==    by 0x5598B71: cmd_buffer_begin_subpass (genX_cmd_buffer.c:5060)
  ==415016==    by 0x559AB00: gen9_CmdBeginRenderPass (genX_cmd_buffer.c:5772)
  ==415016==    by 0x11DACE: begin_render_pass (vr-test.c:375)
  ==415016==    by 0x11DF55: set_state (vr-test.c:529)
  ==415016==    by 0x11F7A1: clear (vr-test.c:1228)

v2: Don't break external sync feature

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5823>

4 years agoiris: fix fallback to swrast driver
Lionel Landwerlin [Fri, 10 Jul 2020 07:46:53 +0000 (10:46 +0300)]
iris: fix fallback to swrast driver

The helper we use to query the kernel returns -1 if the getparam is
not supported.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f402b7c57641dd ("iris: fail screen creation when kernel support is not there")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5838>

4 years agoegl: automatically compile the `drm` platform when available
Eric Engestrom [Tue, 25 Jun 2019 14:44:16 +0000 (15:44 +0100)]
egl: automatically compile the `drm` platform when available

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>

4 years agomeson: move xlib-lease block further down
Eric Engestrom [Thu, 19 Dec 2019 02:11:18 +0000 (02:11 +0000)]
meson: move xlib-lease block further down

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>

4 years agovulkan: automatically compile the `display` platform when available
Eric Engestrom [Tue, 25 Jun 2019 13:23:15 +0000 (14:23 +0100)]
vulkan: automatically compile the `display` platform when available

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>

4 years agoegl: always compile surfaceless
Eric Engestrom [Tue, 25 Jun 2019 12:47:04 +0000 (13:47 +0100)]
egl: always compile surfaceless

It has no dependencies and costs virtually nothing to build. There is
no downside to enabling it unconditionally, so let's do just that.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3161>

4 years agou_prim_restart: handle user buffers in util_translate_prim_restart_ib()
Mike Blumenkrantz [Thu, 2 Jul 2020 20:08:44 +0000 (16:08 -0400)]
u_prim_restart: handle user buffers in util_translate_prim_restart_ib()

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5806>

4 years agonv50: Clear nv50_ir_prog_info of dead and codegen specific variables
mmenzyns [Tue, 30 Jun 2020 13:57:49 +0000 (15:57 +0200)]
nv50: Clear nv50_ir_prog_info of dead and codegen specific variables

These variables are either not used in the code, only assigned but
never accessed, or only used inside codegen. Another reason is that this
patch will be preceding shader cache, and these variables are useless to
cache. Removing/moving them should make it clearer by removing the case something
from the structure is not cached.

Shader cache patch: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4264

Signed-off-by: Mark Menzynski <mmenzyns@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5697>

4 years agoac/llvm: export ac_init_llvm_once in targets
Pierre-Eric Pelloux-Prayer [Thu, 25 Jun 2020 13:14:01 +0000 (15:14 +0200)]
ac/llvm: export ac_init_llvm_once in targets

If a program like mpv uses both radeon_dri.so (because --vo=gpu) and
radeonsi_drv_video.so (because --hwdec=vaapi) then LLVM will be inialized twice.

The commit exports the ac_init_llvm_once so there's only one instance of the
function.

See also 18b12bf5335 ("targets: export radeon winsys_create functions to silence LLVM warning")
which implemented this workaround initially.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1377
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>

4 years agobin/symbols-check.py: add --ignore-symbol argument
Pierre-Eric Pelloux-Prayer [Wed, 8 Jul 2020 11:55:24 +0000 (13:55 +0200)]
bin/symbols-check.py: add --ignore-symbol argument

This will be used by radv to ignore 'the ac_init_llvm_once' symbol,
which is not part of vulkan-icd-symbols.txt but is required to be
exported to improve interop with radeonsi/vaapi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5648>

4 years agost/mesa: set compressed_data to NULL when freed
Pierre-Eric Pelloux-Prayer [Thu, 9 Jul 2020 14:59:39 +0000 (16:59 +0200)]
st/mesa: set compressed_data to NULL when freed

Reported-by: Karol Herbst <kherbst@redhat.com>
Fixes: b6db703e0f0 ("st/mesa: make texture views inherit compressed_data storage")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5821>

4 years agoaco: fix more validation errors from vgpr spill/restore code
Samuel Pitoiset [Thu, 9 Jul 2020 17:03:21 +0000 (19:03 +0200)]
aco: fix more validation errors from vgpr spill/restore code

It looks like the attempt to fix this in 1e791e51a65 was incomplete.

This fixes crashes with Devil May Cry 5 with a debug build.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5828>

4 years agogitlab-ci: Enable -Werror in `meson-gallium` job
Timothy Arceri [Wed, 8 Jul 2020 03:56:51 +0000 (13:56 +1000)]
gitlab-ci: Enable -Werror in `meson-gallium` job

It's warning-clean.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5799>

4 years agolima: add missing break
Timothy Arceri [Wed, 8 Jul 2020 10:35:37 +0000 (20:35 +1000)]
lima: add missing break

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5799>

4 years agolima: add missing fallthrough comments
Timothy Arceri [Wed, 8 Jul 2020 10:27:05 +0000 (20:27 +1000)]
lima: add missing fallthrough comments

Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5799>

4 years agoetnaviv: add missing fallthrough comments
Timothy Arceri [Wed, 8 Jul 2020 09:31:21 +0000 (19:31 +1000)]
etnaviv: add missing fallthrough comments

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5799>

4 years agoiris: Add missing break in switch in modifier_is_supported
Jordan Justen [Tue, 23 Jun 2020 02:46:23 +0000 (19:46 -0700)]
iris: Add missing break in switch in modifier_is_supported

The current fall-through doesn't cause a difference in code flow, but
I think we want a break here.

Fixes: 2305ab693820 ("iris: Refactor modifier_is_supported for gen12")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5618>

4 years agofreedreno/ir3: run nir_opt_loop_unroll in optimization loop
Jonathan Marek [Sat, 4 Jul 2020 21:46:24 +0000 (17:46 -0400)]
freedreno/ir3: run nir_opt_loop_unroll in optimization loop

GL driver was relying on this being done by gallium, but there might be
new loops to unroll during optimizations and turnip needs it.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5818>

4 years agofreedreno/ir3: fix setup_input for sparse vertex inputs
Jonathan Marek [Sat, 4 Jul 2020 15:46:02 +0000 (11:46 -0400)]
freedreno/ir3: fix setup_input for sparse vertex inputs

With turnip we can have sparse input variables like:

decl_var shader_in INTERP_MODE_NONE float @1 (VERT_ATTRIB_GENERIC1.x, 1, 0)
decl_var shader_in INTERP_MODE_NONE float @2 (VERT_ATTRIB_GENERIC1.y, 1, 0)
decl_var shader_in INTERP_MODE_NONE float @3 (VERT_ATTRIB_GENERIC1.w, 1, 0)

Example of a test fixed:

dEQP-VK.glsl.440.linkage.varying.component.vert_in.vec2.as_float_float_unused

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5818>

4 years agointel/compiler/fs: Still attempt simd32 when INTEL_DEBUG=no16 is used
Jordan Justen [Sun, 31 May 2020 16:27:28 +0000 (09:27 -0700)]
intel/compiler/fs: Still attempt simd32 when INTEL_DEBUG=no16 is used

If INTEL_DEBUG=no16 is used, then simd16 will not be attempted. This,
in turn prevents simd32 from running, because we attempt to skip
simd32 when simd16 fails to compile.

This change more accurately recognizes when we attempted simd16, but
simd16 failed.

One easy way to cause an issue is to set both no8 and no16. Before
this change, we would be left with no FS program, even though simd32
could still be generated in some cases.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5269>

4 years agointel/compiler/cs: Allow simd32 in some more cases with no8 and/or no16
Jordan Justen [Tue, 3 Mar 2020 10:28:24 +0000 (02:28 -0800)]
intel/compiler/cs: Allow simd32 in some more cases with no8 and/or no16

If no16 was specified, and the shader can't run in simd8 due to the
local_size, then we need to generate a simd32 program.

If both no8 and no16 are specified, then we need to generate a simd32
program.

Rework:
 * Drop update of `if` that would have changed `do32` to try simd32
   even if simd16 spilled registers. (Caio)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5269>

4 years agogitlab-ci: Don't rebuild kernels and rootfs if they have been already built in mainline
Tomeu Vizoso [Thu, 9 Jul 2020 14:14:14 +0000 (16:14 +0200)]
gitlab-ci: Don't rebuild kernels and rootfs if they have been already built in mainline

Use the ones from mainline if possible to save cycles rebuilding the same files.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5822>

4 years agogitlab-ci: do not run full CI on scheduled pipelines
Benjamin Tissoires [Tue, 7 Jul 2020 13:02:35 +0000 (15:02 +0200)]
gitlab-ci: do not run full CI on scheduled pipelines

Currently, scheduled pipelines are only used to rebuild
the git-cache archive daily. There is no point in rebuilding
eveything, so ensure that any normal jobs are removed from
the scheduled pipelines.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5804>

4 years agogitlab-ci: update ci-fairy minio to latest upstream
Benjamin Tissoires [Tue, 7 Jul 2020 12:44:33 +0000 (14:44 +0200)]
gitlab-ci: update ci-fairy minio to latest upstream

the new ci-fairy minio on ci-templates can copy
data to/from the MinIO server with much less permissions.

Upgrading mesa to this commit will allow us to restrict the
git-cache bucket permission to only "fetch" objects, i.e.
not allow anybody to walk through the tree of any repo.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5804>

4 years agopanfrost: Report blend shader work count
Alyssa Rosenzweig [Wed, 8 Jul 2020 21:17:14 +0000 (17:17 -0400)]
panfrost: Report blend shader work count

This was going uninitialized, whoops!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>

4 years agopanfrost: Move panfrost_translate_texture_type
Alyssa Rosenzweig [Wed, 8 Jul 2020 19:59:17 +0000 (15:59 -0400)]
panfrost: Move panfrost_translate_texture_type

We need it in pan_job.c

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>

4 years agopanfrost: Handle PIPE_FORMAT_S8_UINT
Alyssa Rosenzweig [Wed, 8 Jul 2020 20:37:00 +0000 (16:37 -0400)]
panfrost: Handle PIPE_FORMAT_S8_UINT

For wallpaper blits with separate stencil.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>

4 years agopanfrost: Handle PIPE_FORMAT_X24S8_UINT
Alyssa Rosenzweig [Fri, 3 Jul 2020 17:01:16 +0000 (13:01 -0400)]
panfrost: Handle PIPE_FORMAT_X24S8_UINT

We can treat it as RGBA32UI and swizzle away everything but R, like the
blob does. Maybe not the most efficient thing in the world.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>