platform/upstream/mesa.git
3 years agov3dv/format: use XYZ1 swizzle for three-component formats
Alejandro Piñeiro [Wed, 28 Oct 2020 13:08:10 +0000 (14:08 +0100)]
v3dv/format: use XYZ1 swizzle for three-component formats

So far for the formats E5B9G9R9_UFLOAT_PACK32 and
B10G11R11_UFLOAT_PACK32 we were using a XYZW swizzle. But from Vulkan
spec those are three-component, without alpha, formats. So we should
use XYZ1 instead, as we were already doing for other three-component
formats.

Curiously the only case where this raised a problem were when using
clamp to border with transparent black. This change allows us to
remove the code that handled only that specific case.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7355>

3 years agovirgl: Correctly align size of blobs
Tomeu Vizoso [Tue, 27 Oct 2020 08:29:27 +0000 (09:29 +0100)]
virgl: Correctly align size of blobs

Probably a copy-paste error.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: cd31f46f08a7 ("virgl/drm: add resource create blob function")
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7332>

3 years agoglsl: Update loop_terminator constructor to accept parameters.
Vinson Lee [Fri, 23 Oct 2020 00:31:19 +0000 (17:31 -0700)]
glsl: Update loop_terminator constructor to accept parameters.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member continue_from_then is not
initialized in this constructor nor in any functions that it calls.

Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7283>

3 years agoaco/ngg: Incorporate GS invocations into workgroup size calculation.
Timur Kristóf [Thu, 15 Oct 2020 08:33:18 +0000 (10:33 +0200)]
aco/ngg: Incorporate GS invocations into workgroup size calculation.

If the workgroup_size variable is lower than the actual workgroup size,
that means it's possible that ACO won't emit some s_barrier instructions
when in fact it should. This can possibly cause a GPU hang.

This is just for the sake of general correctness, currently this
can't cause a real problem because the maximum vertex count is always
greater than (or equal to) the primitive count in GS, and already
takes into account the number of GS invocations.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco/ngg: Export a zero-area triangle when primitive count is 0.
Timur Kristóf [Thu, 15 Oct 2020 21:17:12 +0000 (23:17 +0200)]
aco/ngg: Export a zero-area triangle when primitive count is 0.

This is a workaround for a bug in Navi 1x NGG HW.

Very rarely, the Navi 1x PA can hang when an NGG workgroup exports
0 total primitives. According to AMD, we always need this workaround
when it is possible that the number of primitives is 0.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco: Add a few assertions about LDS usage.
Timur Kristóf [Thu, 15 Oct 2020 16:18:21 +0000 (18:18 +0200)]
aco: Add a few assertions about LDS usage.

This is to make sure we don't compile a shader which doesn't
fit the available LDS space.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco: Make emitting reduction instructions a bit more convenient.
Timur Kristóf [Thu, 15 Oct 2020 08:24:49 +0000 (10:24 +0200)]
aco: Make emitting reduction instructions a bit more convenient.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco: Add some validation for PSEUDO_REDUCTION instructions.
Timur Kristóf [Thu, 15 Oct 2020 08:23:42 +0000 (10:23 +0200)]
aco: Add some validation for PSEUDO_REDUCTION instructions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco/ngg: Put shader query reduction operand into a VGPR.
Timur Kristóf [Wed, 14 Oct 2020 15:23:15 +0000 (17:23 +0200)]
aco/ngg: Put shader query reduction operand into a VGPR.

The p_reduce instruction only works if this operand is in a VGPR,
and otherwise gets lowered to incorrect code.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoaco: Assert that workgroup barriers are not used inappropriately.
Timur Kristóf [Thu, 15 Oct 2020 08:58:34 +0000 (10:58 +0200)]
aco: Assert that workgroup barriers are not used inappropriately.

Example:
It is possible for some NGG GS waves to have 0 ES and/or GS invocations,
and in that case having an s_barrier inside divergent control flow can
very possibly hang the GPU.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7232>

3 years agoci/bare-metal: suppress 'No such file or directory'
Christian Gmeiner [Wed, 28 Oct 2020 11:00:00 +0000 (12:00 +0100)]
ci/bare-metal: suppress 'No such file or directory'

It fills the serial log with unimportant messages.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7347>

3 years agoaco: switch aco_print_asm to a FILE *
Rhys Perry [Thu, 15 Oct 2020 15:38:13 +0000 (16:38 +0100)]
aco: switch aco_print_asm to a FILE *

Streams are really stateful and (IMO) difficult to read for non-trivial
usage. This is also more consistent with NIR and the rest of ACO.

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

3 years agoaco: refactor repeated instruction disassembly
Rhys Perry [Thu, 15 Oct 2020 15:10:55 +0000 (16:10 +0100)]
aco: refactor repeated instruction disassembly

This seems simpler to me. It should also work correctly when repeated
instructions cross blocks.

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

3 years agoaco: move individual instruction disassembly to its own helper
Rhys Perry [Thu, 15 Oct 2020 15:03:00 +0000 (16:03 +0100)]
aco: move individual instruction disassembly to its own 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/7166>

3 years agodocs/features: Update extensions for swr
Adam Jackson [Thu, 22 Oct 2020 20:16:55 +0000 (16:16 -0400)]
docs/features: Update extensions for swr

The following are all supported:

- GL_ARB_shader_atomic_counters
- GL_ARB_shader_image_load_store
- GL_ARB_shader_image_size
- GL_ARB_texture_multisample
- GL_KHR_texture_compression_astc_ldr
- GL_KHR_texture_compression_astc_sliced_3d
- GL_OES_texture_float
- GL_OES_texture_float_linear
- GL_OES_texture_half_float
- GL_OES_texture_half_float_linear

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7281>

3 years agodocs/features: Update extensions for softpipe
Adam Jackson [Thu, 22 Oct 2020 19:50:50 +0000 (15:50 -0400)]
docs/features: Update extensions for softpipe

GLES 3.1 is supported, as are:

- GL_KHR_texture_compression_astc_ldr
- GL_KHR_texture_compression_astc_sliced_3d
- GL_EXT_render_snorm
- GL_EXT_texture_norm16

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7281>

3 years agoaco: use mubuf helper in select_gs_copy_shader
Rhys Perry [Tue, 28 Jul 2020 12:50:08 +0000 (13:50 +0100)]
aco: use mubuf helper in select_gs_copy_shader

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6103>

3 years agoaco: use control flow creation helpers in select_gs_copy_shader
Rhys Perry [Tue, 28 Jul 2020 12:42:44 +0000 (13:42 +0100)]
aco: use control flow creation helpers in select_gs_copy_shader

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6103>

3 years agoaco: round bytes_written to dwords if larger than 4 bytes
Rhys Perry [Tue, 27 Oct 2020 13:23:07 +0000 (13:23 +0000)]
aco: round bytes_written to dwords if larger than 4 bytes

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

3 years agoaco: default to a definition size of 32
Rhys Perry [Wed, 21 Oct 2020 15:00:36 +0000 (16:00 +0100)]
aco: default to a definition size of 32

For non-arithmetic opcodes such as buffer_load_dword and buffer_load_short,
default to a definition size of 32.

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

3 years agodocs: s3tc -> S3TC
Erik Faye-Lund [Wed, 30 Sep 2020 13:15:02 +0000 (15:15 +0200)]
docs: s3tc -> S3TC

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: clang -> Clang
Erik Faye-Lund [Wed, 30 Sep 2020 13:09:37 +0000 (15:09 +0200)]
docs: clang -> Clang

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: gcc -> GCC
Erik Faye-Lund [Wed, 30 Sep 2020 13:08:33 +0000 (15:08 +0200)]
docs: gcc -> GCC

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: fbo -> FBO
Erik Faye-Lund [Wed, 30 Sep 2020 13:03:03 +0000 (15:03 +0200)]
docs: fbo -> FBO

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: hud -> HUD
Erik Faye-Lund [Wed, 30 Sep 2020 08:36:29 +0000 (10:36 +0200)]
docs: hud -> HUD

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: api -> API
Erik Faye-Lund [Wed, 30 Sep 2020 08:33:25 +0000 (10:33 +0200)]
docs: api -> API

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: anistropy -> anisotropy
Erik Faye-Lund [Wed, 30 Sep 2020 13:20:15 +0000 (15:20 +0200)]
docs: anistropy -> anisotropy

While one of these is referring to an identifier, the actual identifier
is correctly spelled.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: eg. -> e.g.
Erik Faye-Lund [Wed, 30 Sep 2020 13:24:01 +0000 (15:24 +0200)]
docs: eg. -> e.g.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agodocs: ie. -> i.e.
Erik Faye-Lund [Wed, 30 Sep 2020 08:30:19 +0000 (10:30 +0200)]
docs: ie. -> i.e.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7060>

3 years agoradv: remove call to nir_lower_pack()
Daniel Schürmann [Fri, 23 Oct 2020 14:04:33 +0000 (16:04 +0200)]
radv: remove call to nir_lower_pack()

The pack_* instructions are now lowered via nir_lower_alu_to_scalar()
and unpack_* are not lowered anymore.

These bitcasts are no-ops, and lowering prevents
some optimizations like vectorization.

Note: There are still some *_split variations remaining
from different other NIR passes.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6527>

3 years agoradv: lower pack_[64/32]_* via nir_lower_alu_to_scalar()
Daniel Schürmann [Mon, 21 Sep 2020 13:02:33 +0000 (14:02 +0100)]
radv: lower pack_[64/32]_* via nir_lower_alu_to_scalar()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6527>

3 years agonir: add options to lower nir_op_pack_[64/32]_* via nir_lower_alu_to_scalar()
Daniel Schürmann [Mon, 21 Sep 2020 13:01:24 +0000 (14:01 +0100)]
nir: add options to lower nir_op_pack_[64/32]_* via nir_lower_alu_to_scalar()

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6527>

3 years agoac/nir: implement nir_op_[un]pack_64_4x16
Daniel Schürmann [Mon, 26 Oct 2020 10:52:00 +0000 (11:52 +0100)]
ac/nir: implement nir_op_[un]pack_64_4x16

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6527>

3 years agoaco: implement nir_op_unpack_[64/32]_*
Daniel Schürmann [Mon, 31 Aug 2020 16:37:25 +0000 (17:37 +0100)]
aco: implement nir_op_unpack_[64/32]_*

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6527>

3 years agov3dv: enable alphaToOne feature
Iago Toral Quiroga [Tue, 27 Oct 2020 11:39:53 +0000 (12:39 +0100)]
v3dv: enable alphaToOne feature

This is another case of a feature that is implemented in the compiler
and that only required that we set the shader key properly from the
pipeline state, which we were already doing.

I verified we pass the tests in dEQP-VK.pipeline.multisample.alpha_to_one.*
(we only support 4x multisampling, so we can only pass a single test there),
however, the tests seem to have a bug by which they always pass, even if
the driver doesn't actually implement alpha to one correctly. I submitted
a fix to Khronos and verified that we also pass the fixed tests (and that
we failed them if we don't actually set te shader key correctly).

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7336>

3 years agoradv: Do not access set layout during vkCmdBindDescriptorSets.
Bas Nieuwenhuizen [Sun, 18 Oct 2020 13:14:36 +0000 (15:14 +0200)]
radv: Do not access set layout during vkCmdBindDescriptorSets.

The spec says:

"
VkDescriptorSetLayout objects may be accessed by commands that operate on descriptor sets allocated using that layout
"

So our behavior is valid here, but this is a temporary workaround for an issue with Baldur's Gate 3.

CC: mesa-stable
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3607
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7207>

3 years agoradv: Fix 1D compressed mipmaps on GFX9.
Bas Nieuwenhuizen [Wed, 21 Oct 2020 01:35:26 +0000 (03:35 +0200)]
radv: Fix 1D compressed mipmaps on GFX9.

Partial rollback as GFX9 really requires height = 1 to work.

The two substantial parts of the fix remaining:

1) Deal with views with multiple levels.
2) Limit the expansion to the base mip pitch/height. On GFX9 this
   is exactly equal to the surf_pitch that was used before. I've
   done some investigation to make sure that on GFX10 this always
   results in the right physical layout.

Remaining stupid question is how the actual extents for bounds
checking never end up too low when the size gets clamped, but
this change and the previous change don't change that ...

Fixes: 1fb3e1fb708 "radv: Fix mipmap extent adjustment on GFX9+."
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7245>

3 years agointel/mi_builder: Support gen11 command-streamer based register offsets
Jordan Justen [Sun, 14 Apr 2019 10:11:25 +0000 (03:11 -0700)]
intel/mi_builder: Support gen11 command-streamer based register offsets

Reworks:
 * Automatically apply to any register in the range 0x2000 - 0x4000

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5466>

3 years agoFix VMware capitalization.
Vinson Lee [Wed, 21 Oct 2020 22:13:03 +0000 (15:13 -0700)]
Fix VMware capitalization.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7260>

3 years agoutil: use dllexport for mingw too
Michel Zou [Sat, 24 Oct 2020 20:27:06 +0000 (22:27 +0200)]
util: use dllexport for mingw too

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agolavapipe: configure suffix in icd json
Michel Zou [Sun, 18 Oct 2020 17:55:21 +0000 (19:55 +0200)]
lavapipe: configure suffix in icd json

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agogallium: use libpipe_loader_links
Michel Zou [Sun, 18 Oct 2020 09:45:44 +0000 (11:45 +0200)]
gallium: use libpipe_loader_links

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agowsi: move drm code to wsi_common_drm.c
Michel Zou [Sun, 18 Oct 2020 09:30:35 +0000 (11:30 +0200)]
wsi: move drm code to wsi_common_drm.c

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agolavapipe: fix usleep usage in lvp_device
Michel Zou [Mon, 19 Oct 2020 18:52:26 +0000 (20:52 +0200)]
lavapipe: fix usleep usage in lvp_device

Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7341>

3 years agointel/dev: Add device info for ADL-S
Jordan Justen [Wed, 8 Apr 2020 01:10:22 +0000 (18:10 -0700)]
intel/dev: Add device info for ADL-S

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7322>

3 years agoaco: ignore the ACO-inserted continue in create_continue_phis()
Rhys Perry [Wed, 14 Oct 2020 20:42:01 +0000 (21:42 +0100)]
aco: ignore the ACO-inserted continue in create_continue_phis()

Otherwise, for loops without continue_or_break, create_continue_phis()
always returns an undef operand.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 638cbc21a1c ("aco: handle when ACO adds new continue edges")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2848
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7148>

3 years agoCI: remove llvmpipe cl flake test
Dave Airlie [Tue, 27 Oct 2020 05:25:24 +0000 (15:25 +1000)]
CI: remove llvmpipe cl flake test

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7328>

3 years agoanv: Drop warning about gen12 not being supported
Jordan Justen [Tue, 27 Oct 2020 09:24:36 +0000 (02:24 -0700)]
anv: Drop warning about gen12 not being supported

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7333>

3 years agopanfrost: AFBC compress Z16 depth buffers
Icecream95 [Fri, 16 Oct 2020 12:49:58 +0000 (01:49 +1300)]
panfrost: AFBC compress Z16 depth buffers

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

3 years agopanfrost: Z16 depth buffer support
Icecream95 [Fri, 16 Oct 2020 12:49:31 +0000 (01:49 +1300)]
panfrost: Z16 depth buffer support

Only for MFBD GPUs as on t720 it causes some dEQP tests to fail.

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

3 years agopanfrost: Move zs format handling code out of the !afbc case
Icecream95 [Fri, 16 Oct 2020 12:42:16 +0000 (01:42 +1300)]
panfrost: Move zs format handling code out of the !afbc case

This will allow supporting more AFBC depth/stencil formats without
duplicating the format handling.

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

3 years agodocs: Specify when branch points happen
Jason Ekstrand [Wed, 14 Oct 2020 21:38:25 +0000 (16:38 -0500)]
docs: Specify when branch points happen

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7149>

3 years agovulkan/util,vulkan/wsi,radv: Add typed outarray API
James Park [Fri, 7 Aug 2020 03:57:10 +0000 (20:57 -0700)]
vulkan/util,vulkan/wsi,radv: Add typed outarray API

MSVC cannot perform GCC __typeof__ for C code. (C++ has decltype.)

Add adjacent functions to allow specifying types manually.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7270>

3 years agoaco: remove all-undef phi opt
Rhys Perry [Fri, 16 Oct 2020 14:50:39 +0000 (15:50 +0100)]
aco: remove all-undef phi opt

This doesn't look like it would create correct IR for 8/16-bit phis and
doesn't seem to help anything. If we ever want to do this, it's probably
better done in nir_opt_remove_phis().

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: use v_mov_b32_sdwa for some 16-bit constants
Rhys Perry [Fri, 16 Oct 2020 12:18:08 +0000 (13:18 +0100)]
aco: use v_mov_b32_sdwa for some 16-bit constants

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: remove some unused optimizations
Rhys Perry [Thu, 15 Oct 2020 14:18:40 +0000 (15:18 +0100)]
aco: remove some unused optimizations

These are unused now that we almost always use p_parallelcopy for simple
copies.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: use Builder::copy more
Rhys Perry [Thu, 15 Oct 2020 14:09:20 +0000 (15:09 +0100)]
aco: use Builder::copy more

fossil-db (Navi):
Totals from 6973 (5.07% of 137413) affected shaders:
SGPRs: 381768 -> 381776 (+0.00%)
VGPRs: 306092 -> 306096 (+0.00%); split: -0.00%, +0.00%
CodeSize: 24440844 -> 24421196 (-0.08%); split: -0.09%, +0.01%
MaxWaves: 86581 -> 86583 (+0.00%)
Instrs: 4682161 -> 4679578 (-0.06%); split: -0.06%, +0.00%
Cycles: 68793116 -> 68261648 (-0.77%); split: -0.83%, +0.05%

fossil-db (Polaris):
Totals from 8154 (5.87% of 138881) affected shaders:
VGPRs: 338916 -> 338920 (+0.00%); split: -0.00%, +0.00%
CodeSize: 23540428 -> 23540488 (+0.00%); split: -0.00%, +0.00%
MaxWaves: 49090 -> 49091 (+0.00%)
Instrs: 4576085 -> 4576101 (+0.00%); split: -0.00%, +0.00%
Cycles: 51720704 -> 51720888 (+0.00%); split: -0.00%, +0.00%

Most of the Navi cycle/instruction changes are from 8/16-bit parallel-rdp
shaders. They appear to be improved because the p_create_vector from
lower_subdword_phis() was blocking constant propagation.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: always use p_parallelcopy for pre-RA copies
Rhys Perry [Wed, 14 Oct 2020 12:50:24 +0000 (13:50 +0100)]
aco: always use p_parallelcopy for pre-RA copies

Most fossil-db changes are because literals are applied earlier
(in label_instruction), so use counts are more accurate and more literals
are applied.

fossil-db (Navi):
Totals from 79551 (57.89% of 137413) affected shaders:
SGPRs: 4549610 -> 4542802 (-0.15%); split: -0.19%, +0.04%
VGPRs: 3326764 -> 3324172 (-0.08%); split: -0.10%, +0.03%
SpillSGPRs: 38886 -> 34562 (-11.12%); split: -11.14%, +0.02%
CodeSize: 240143456 -> 240001008 (-0.06%); split: -0.11%, +0.05%
MaxWaves: 1078919 -> 1079281 (+0.03%); split: +0.04%, -0.01%
Instrs: 46627073 -> 46528490 (-0.21%); split: -0.22%, +0.01%

fossil-db (Polaris):
Totals from 98463 (70.90% of 138881) affected shaders:
SGPRs: 5164689 -> 5164353 (-0.01%); split: -0.02%, +0.01%
VGPRs: 3920936 -> 3921856 (+0.02%); split: -0.00%, +0.03%
SpillSGPRs: 56298 -> 52259 (-7.17%); split: -7.22%, +0.04%
CodeSize: 258680092 -> 258692712 (+0.00%); split: -0.02%, +0.03%
MaxWaves: 620863 -> 620823 (-0.01%); split: +0.00%, -0.01%
Instrs: 50776289 -> 50757577 (-0.04%); split: -0.04%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: allow literals on sub-dword p_parallelcopy
Rhys Perry [Thu, 15 Oct 2020 21:09:45 +0000 (22:09 +0100)]
aco: allow literals on sub-dword p_parallelcopy

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: don't use bld.copy() in handle_operands()
Rhys Perry [Thu, 15 Oct 2020 18:39:37 +0000 (19:39 +0100)]
aco: don't use bld.copy() in handle_operands()

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: expand vectors passed as copy operands
Rhys Perry [Thu, 15 Oct 2020 13:49:34 +0000 (14:49 +0100)]
aco: expand vectors passed as copy operands

Most copies which hit this case use p_create_vector, but in the future
p_parallelcopy will be used instead.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: copy-propgate through p_create_vector during value numbering
Rhys Perry [Wed, 14 Oct 2020 14:35:20 +0000 (15:35 +0100)]
aco: copy-propgate through p_create_vector during value numbering

fossil-db (Navi):
Totals from 182 (0.13% of 137413) affected shaders:
SGPRs: 9304 -> 9312 (+0.09%)
VGPRs: 7636 -> 7620 (-0.21%); split: -0.26%, +0.05%
CodeSize: 733516 -> 733092 (-0.06%); split: -0.07%, +0.01%
MaxWaves: 2478 -> 2479 (+0.04%)
Instrs: 139664 -> 139561 (-0.07%); split: -0.09%, +0.02%
Cycles: 3215104 -> 3214080 (-0.03%); split: -0.04%, +0.01%

fossil-db (Polaris):
Totals from 161 (0.12% of 138881) affected shaders:
VGPRs: 5608 -> 5596 (-0.21%); split: -0.29%, +0.07%
CodeSize: 605336 -> 605120 (-0.04%); split: -0.05%, +0.02%
Instrs: 117957 -> 117902 (-0.05%); split: -0.07%, +0.02%
Cycles: 3105008 -> 3103876 (-0.04%); split: -0.04%, +0.00%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: skip value numbering of copies
Rhys Perry [Mon, 26 Oct 2020 19:22:14 +0000 (19:22 +0000)]
aco: skip value numbering of copies

Instead, copy-propagate through and remove them.

This improves value numbering in this situation:
a = ...
b = copy a
c = copy a
use(b)
use(c)

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

3 years agoaco: don't do divergent break+discard
Rhys Perry [Mon, 19 Oct 2020 10:03:34 +0000 (11:03 +0100)]
aco: don't do divergent break+discard

If the shader does:
loop {
   if (divergent)
      discard
   else
      a()
   b()
}
then a()'s block will dominate b()'s block in the logical CFG, but not the
linear CFG. This will cause value numbering to try to combine SLAU from
a() and b().

This didn't happen with break/continue because sanitize_if() would move
a() out of the branch. Using sanitize_if() to fix this doesn't look easy,
because discards are not control flow instructions in NIR.

No fossil-db changes.

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

3 years agoaco: update phi_map in add_subdword_operand()
Rhys Perry [Tue, 27 Oct 2020 10:59:35 +0000 (10:59 +0000)]
aco: update phi_map in add_subdword_operand()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 56345b8c610 ("aco: allow reading/writing upper halves/bytes when possible")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7216>

3 years agoaco: Clean up some C++ usages
James Park [Fri, 23 Oct 2020 03:40:04 +0000 (20:40 -0700)]
aco: Clean up some C++ usages

Iterate over maps by reference to avoid copies.

Replace find/insert with insert to avoid double search.

Use range-based for loop, avoiding copies by reference. Delete comment.

Erase by iterator instead of key to avoid repeat search.

Iterators unneeded to modify unwaited_instrs. Use range-based for loop.

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7285>

3 years agoradv: enable VK_AMD_mixed_attachment_samples on GFX6-GFX7
Samuel Pitoiset [Wed, 6 May 2020 09:43:24 +0000 (11:43 +0200)]
radv: enable VK_AMD_mixed_attachment_samples on GFX6-GFX7

Now that dEQP-VK.pipeline.multisample.mixed_attachment_samples.* pass,
it should be safe to also enable this extension on these old chips.

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

3 years agoradv: flush CB before and after FMASK_DECOMPRESS or DCC_DECOMPRESS
Samuel Pitoiset [Wed, 6 May 2020 09:42:43 +0000 (11:42 +0200)]
radv: flush CB before and after FMASK_DECOMPRESS or DCC_DECOMPRESS

According to RadeonSI and AMDVLK, it seems required to flush CB
before and after FMASK_DECOMPRESS or DCC_DECOMPRESS.

This shouldn't much affect performance because the driver already
flushes CB after these operations (including FCE too).

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

3 years agodocs: add link to extension spec
Erik Faye-Lund [Mon, 26 Oct 2020 11:27:41 +0000 (12:27 +0100)]
docs: add link to extension spec

We already do this for all the other VK extensions, so we might as well
do this for VK_EXT_vertex_attribute_divisor as well.

Fixes: 2ff97847d19 ("docs: document zink's gl > 3.0 requirements")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7312>

3 years agoCI: Only run OpenCL tests when we need to
Daniel Stone [Tue, 27 Oct 2020 07:42:15 +0000 (07:42 +0000)]
CI: Only run OpenCL tests when we need to

Like the other drivers, set up rules so we don't run piglit-cl unless we
need to.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3695
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7330>

3 years agoradv: do not perform a FMASK expand for non-writeable MSAA images
Samuel Pitoiset [Thu, 22 Oct 2020 12:54:03 +0000 (14:54 +0200)]
radv: do not perform a FMASK expand for non-writeable MSAA images

It should only be required for writeable MSAA images.

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

3 years agoaco: fix GFX8 16-bit packing
Daniel Schürmann [Tue, 27 Oct 2020 10:35:27 +0000 (11:35 +0100)]
aco: fix GFX8 16-bit packing

def.physReg() was uninitialized.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: d96f387e7ac448b450091b900ab089eea3eb7b86 ('aco: improve code sequences for 16bit packing')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7334>

3 years agov3dv: grow meta descriptor pool dynamically
Iago Toral Quiroga [Mon, 26 Oct 2020 09:39:29 +0000 (10:39 +0100)]
v3dv: grow meta descriptor pool dynamically

Our blit shader path allocates a descriptor pool to create
combined image sampler descriptors for blit source images. So
far, we had sized this pool statically and the driver would
fail if we ever need to allocate more descriptors than that.

With this change, we switch to using a dynamic allocation
mechanism instead where we allocate as many pools as we need to
meet descriptor set allocation requirements for the command buffer.

Also, every time a new pool needs to be created, we double its
size (up to a limit), so we can start small and avoid wasting
memory for command buffers that only have a small number of blits,
while trying to keep allocation overhead low for command buffers
that record a lot of blits.

v2: use existing framework for automatic destruction of private
    driver objects to free allocated pools.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7311>

3 years agoci: Run git_archive job if all_paths matches
Michel Dänzer [Mon, 26 Oct 2020 17:05:49 +0000 (18:05 +0100)]
ci: Run git_archive job if all_paths matches

The lack of this could break post-merge pipelines:
https://gitlab.freedesktop.org/mesa/mesa/-/pipelines/218636

(I missed this in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7278)

Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7319>

3 years agopan/mdg: fix LOCAL_STORAGE wls_instances packing
Italo Nicola [Mon, 26 Oct 2020 13:46:52 +0000 (13:46 +0000)]
pan/mdg: fix LOCAL_STORAGE wls_instances packing

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

3 years agov3dv: enable the logicOp feature
Iago Toral Quiroga [Mon, 26 Oct 2020 12:00:07 +0000 (13:00 +0100)]
v3dv: enable the logicOp feature

For us this is mostly handled in the compiler by a NIR lowering so
for the Vulkan driver we only need to make sure that we program our
shader key correctly from the pipeline state, which we were already
doing.

It doesn't look like CTS has any coverage for this yet so it has only
been smoke tested, but it seems to be working correctly, as expected.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7313>

3 years agoRevert "radeonsi: use staging buffer uploads for most VRAM buffers"
Marek Olšák [Sat, 17 Oct 2020 22:06:21 +0000 (18:06 -0400)]
Revert "radeonsi: use staging buffer uploads for most VRAM buffers"

This reverts commit fd6bbdcf59dc5b87fed31f8fc51a2b27eaedfbb2.

Fixes: fd6bbdcf59dc5b87fed31f8fc51a2b27eaedfbb2
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3611

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7262>

3 years agoamd/addrlib: Initialize Gfx10Lib members in constructor.
Vinson Lee [Fri, 16 Oct 2020 00:25:50 +0000 (17:25 -0700)]
amd/addrlib: Initialize Gfx10Lib members in constructor.

Fix defects reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member m_numPkrLog2 is not
initialized in this constructor nor in any functions that it
calls.
uninit_member: Non-static class member m_numSaLog2 is not
initialized in this constructor nor in any functions that it
calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7178>

3 years agofreedreno/gmem: Respect max-height limits too
Rob Clark [Mon, 19 Oct 2020 17:20:56 +0000 (10:20 -0700)]
freedreno/gmem: Respect max-height limits too

There is an upper bound on # of bits we have to encode bin height on
various gens, which we could exceed with larger GMEM sizes and low
byte/pixel formats.

The max-width limits are initialized based on corresponding bitfield
sizes.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7222>

3 years agofreedreno: Rework GMEM limit init
Rob Clark [Mon, 19 Oct 2020 16:29:19 +0000 (09:29 -0700)]
freedreno: Rework GMEM limit init

Split out into helper that can be re-used by gmemtool, to de-duplicate
the limits table.  And convert to switch instead of if-else ladder.
A little bit of duplication, but that will no longer be the case with
additional limits added in next patch.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7222>

3 years agopan/bi: Fix ms_idx type to catch missing ms_index source
Boris Brezillon [Mon, 26 Oct 2020 08:24:32 +0000 (09:24 +0100)]
pan/bi: Fix ms_idx type to catch missing ms_index source

nir_tex_instr_src_index() returns a negative result when the requested
source does not exist, but we cast that to an unsigned type thus losing
this information.

Fixes: b83c293674c1 ("pan/bi: Add basic support for txf_ms")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7314>

3 years agopan/bi: Add ult support
Boris Brezillon [Sun, 18 Oct 2020 20:19:15 +0000 (22:19 +0200)]
pan/bi: Add ult support

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

3 years agopan/bi: Lower {i,u}{min,max} instructions
Boris Brezillon [Sun, 18 Oct 2020 19:52:25 +0000 (21:52 +0200)]
pan/bi: Lower {i,u}{min,max} instructions

There's no native integer min/min instruction on Bifrost, lower those
to a cmp+bcsel pair.

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

3 years agopan/bi: Add support for load_point_coord
Boris Brezillon [Sun, 18 Oct 2020 19:11:49 +0000 (21:11 +0200)]
pan/bi: Add support for load_point_coord

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

3 years agopan/bi: Add support for load_front_face
Boris Brezillon [Sun, 18 Oct 2020 16:06:29 +0000 (18:06 +0200)]
pan/bi: Add support for load_front_face

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

3 years agopanfrost: Preload primitive flags when gl_FrontFacing is accessed
Boris Brezillon [Sun, 18 Oct 2020 16:08:48 +0000 (18:08 +0200)]
panfrost: Preload primitive flags when gl_FrontFacing is accessed

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

3 years agoci: Add "check mr" job to needs: of build jobs
Michel Dänzer [Thu, 22 Oct 2020 15:58:35 +0000 (17:58 +0200)]
ci: Add "check mr" job to needs: of build jobs

So that if the former fails, build & test jobs won't run, wasting less
time & CI resources.

This requires slight tweaks to the rules: of the former job, to make
sure it always exists when the build jobs do.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7278>

3 years agoaco: remove isel_context::allocated
Rhys Perry [Thu, 8 Oct 2020 14:11:12 +0000 (15:11 +0100)]
aco: remove isel_context::allocated

Now that we have Program::temp_rc, we can replace it with the first
temporary id allocated for NIR's ssa defs.

No fossil-db changes on Navi.

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

3 years agovirgl: Always enable emulated BGRA and swizzling unless specifically told not to
Rohan Garg [Fri, 25 Sep 2020 15:25:34 +0000 (17:25 +0200)]
virgl: Always enable emulated BGRA and swizzling unless specifically told not to

The emulation is turned on by default only for GLES hosts when the
host does not support the BGRA/RGBA external/internal format
combination.

This can be turned off by setting VIRGL_DEBUG=noemubgra,nobgraswz
environment variable.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6847>

3 years agonir/lower_memcpy: Don't mask the store
Jason Ekstrand [Sun, 25 Oct 2020 11:28:52 +0000 (06:28 -0500)]
nir/lower_memcpy: Don't mask the store

For constant-size memcpys, we can do as much as a vec4 at a time.  We
were accidentally masking the store to only the .x component.

Fixes: a3177cca996145 "nir: Add a lowering pass to lower memcpy"
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7305>

3 years agofreedreno: Disallow tiled if SHARED and not QCOM_COMPRESSED
Rob Clark [Sun, 25 Oct 2020 21:13:38 +0000 (14:13 -0700)]
freedreno: Disallow tiled if SHARED and not QCOM_COMPRESSED

If the user is not aware of modifiers, and wants to allocate a shared
resource, we shouldn't leave them with tiled.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3678
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7308>

3 years agofreedreno: Update import/export traces
Rob Clark [Sun, 25 Oct 2020 20:07:23 +0000 (13:07 -0700)]
freedreno: Update import/export traces

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7308>

3 years agost/va: fix build with old libva
Andrew Randrianasulu [Fri, 23 Oct 2020 07:52:58 +0000 (10:52 +0300)]
st/va: fix build with old libva

Closes: #3682
Fixes: 0eccd158

Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7297>

3 years agoglx: get rid of memory leak
Andrii Simiklit [Mon, 26 Oct 2020 09:32:57 +0000 (11:32 +0200)]
glx: get rid of memory leak

It fixes Coverity issue: `CID 1468356:  Resource leaks  (RESOURCE_LEAK)`

Fixes: e1964496 ("glx: initial plumbing to let users force-enable/disable extensions")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7310>

3 years agomapi: do not return thread-specific data for wrong thread
Erik Faye-Lund [Thu, 22 Oct 2020 17:06:44 +0000 (19:06 +0200)]
mapi: do not return thread-specific data for wrong thread

If the current thread asks for either the current context or the current
dispatch table for a thread that has not yet set any context current, we
currently risk returning the wrong data if there was only a single
thread that had called u_current_init() yet.

So let's first check if the only expected thread-id is the one getting
these, and return NULL and/or __glapi_noop_table instead if not.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7280>

3 years agomapi: do not call thread-unsafe dispatch getter
Erik Faye-Lund [Thu, 22 Oct 2020 16:21:07 +0000 (18:21 +0200)]
mapi: do not call thread-unsafe dispatch getter

When not using the USE_ELF_TLS code-path, this function is
thread-unsafe, because it returns u_current_table if set without
consulting the ThreadSafe variable in u_current.c.

There's a short period where this can cause problems, if a program uses
multiple threads, but only have made a single context current so far. If
the program issues OpenGL commands from the initialized thread while a
new thread is setting u_current_table to __glapi_noop_table, we will
return the wrong table here.

It doesn't seem right to have two versions of the code that does the
same anyway, so let's use the version that doesn't have this problem
instead.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7280>

3 years agomapi: remove unused function
Erik Faye-Lund [Thu, 22 Oct 2020 16:11:15 +0000 (18:11 +0200)]
mapi: remove unused function

This function is unused, and also unsafe. Let's just get rid of it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7280>

3 years agoaco: use do_pack() for self-intersecting operations.
Daniel Schürmann [Fri, 16 Oct 2020 11:29:28 +0000 (13:29 +0200)]
aco: use do_pack() for self-intersecting operations.

This improves the code for GFX8+, but is slightly
worse for GFX6_7.

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

3 years agoaco: improve code sequences for 16bit packing
Daniel Schürmann [Thu, 15 Oct 2020 17:47:12 +0000 (19:47 +0200)]
aco: improve code sequences for 16bit packing

This includes using alignbyte for GFX6 and GFX7,
and 32-bit instructions for GFX8.

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

3 years agoaco: refactor GFX6_7 subdword copy lowering
Daniel Schürmann [Fri, 16 Oct 2020 13:12:28 +0000 (15:12 +0200)]
aco: refactor GFX6_7 subdword copy lowering

The new code uses alignbyte which leads
to shorter code and preserves the operand's
registers.

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