platform/upstream/mesa.git
3 years agocrocus: fixup workaround_bo to match 965.
Dave Airlie [Mon, 21 Jun 2021 05:31:06 +0000 (15:31 +1000)]
crocus: fixup workaround_bo to match 965.

Always add to the batch, and don't set the reloc write flag when
adding to reloc list, as this will confuse the render/compute sync
code and cause over syncing.

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

3 years agocrocus: rename genX proto functions to avoid iris conflicts.
Dave Airlie [Mon, 21 Jun 2021 06:10:38 +0000 (16:10 +1000)]
crocus: rename genX proto functions to avoid iris conflicts.

If we start adding gen8, then conflicts occur, but the crocus
ones into their own namespace to avoid this.

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

3 years agocrocus: fixup stray tab
Dave Airlie [Mon, 21 Jun 2021 07:17:02 +0000 (17:17 +1000)]
crocus: fixup stray tab

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

3 years agocrocus: drop dead gen prototypes.
Dave Airlie [Mon, 21 Jun 2021 06:06:23 +0000 (16:06 +1000)]
crocus: drop dead gen prototypes.

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

3 years agoi915g: Clear xfails for vertex texturing.
Emma Anholt [Mon, 21 Jun 2021 20:26:23 +0000 (13:26 -0700)]
i915g: Clear xfails for vertex texturing.

Fixes: 7378c6479278 ("i915: Disable vertex texturing and delete the code.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11512>

3 years agoi915g: Use the color swizzle to reshuffle the blend const color.
Emma Anholt [Mon, 21 Jun 2021 16:28:59 +0000 (09:28 -0700)]
i915g: Use the color swizzle to reshuffle the blend const color.

If we're remapping RGBA from the shader into dst channels, we also need to
remap the blend constant color.  The previous static mapping only worked
for ARGB cbufs, but we get ABGR in surfaceless deqp.

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

3 years agoi915g: Simplify color write mask setup.
Emma Anholt [Tue, 22 Jun 2021 17:05:07 +0000 (10:05 -0700)]
i915g: Simplify color write mask setup.

Use the surface's precomputed swizzle instead of doing a local format
table.

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

3 years agoi915g: Move cbuf color swizzle lookup to CSO creation time.
Emma Anholt [Sun, 20 Jun 2021 16:19:59 +0000 (09:19 -0700)]
i915g: Move cbuf color swizzle lookup to CSO creation time.

Saves walking the loop, and makes a nice place to store a swizzle for use
in other atoms.

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

3 years agoi915g: Compute 3DSTATE_BUF_INFO flags at surface create time.
Emma Anholt [Sun, 20 Jun 2021 15:52:25 +0000 (08:52 -0700)]
i915g: Compute 3DSTATE_BUF_INFO flags at surface create time.

No need to compute them at state emit.

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

3 years agoi915g: Create an i915_surface for our pipe_surfaces.
Emma Anholt [Sun, 20 Jun 2021 15:41:50 +0000 (08:41 -0700)]
i915g: Create an i915_surface for our pipe_surfaces.

Nothing added in yet, just wrapping the struct.

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

3 years agoi915g: Remove nr_cbufs loop.
Emma Anholt [Sun, 20 Jun 2021 15:34:16 +0000 (08:34 -0700)]
i915g: Remove nr_cbufs loop.

This hardware definitely only does one cbuf.

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

3 years agoradeon/vcn: use st_rps_bits only when it's set
Boyuan Zhang [Wed, 16 Jun 2021 20:07:31 +0000 (16:07 -0400)]
radeon/vcn: use st_rps_bits only when it's set

Fixes: c9baccb5

For certain player which doesn't implement st_rps_bits, or when st_rps_bits
is set to 0 (e.g. it doesn't have rps explicitly defined in slice header),
we don't set st_rps_bits and the related flag, since we don't skip parsing
the rps structure in these cases.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11432>

3 years agodocs/isl: Consistently use 3-space tabs
Jason Ekstrand [Tue, 22 Jun 2021 16:05:11 +0000 (11:05 -0500)]
docs/isl: Consistently use 3-space tabs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agodocs/nir: Use 3-space tabs
Jason Ekstrand [Tue, 22 Jun 2021 16:00:29 +0000 (11:00 -0500)]
docs/nir: Use 3-space tabs

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agoeditorconfig: Use 3-space tabs for .rst
Jason Ekstrand [Tue, 22 Jun 2021 16:02:37 +0000 (11:02 -0500)]
editorconfig: Use 3-space tabs for .rst

This is what all the sphinx examples do and is what most of docs/
currently does.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11529>

3 years agoci/llvmpipe: Mark two more multithread program link flakes.
Emma Anholt [Mon, 21 Jun 2021 21:01:46 +0000 (14:01 -0700)]
ci/llvmpipe: Mark two more multithread program link flakes.

Seen in #mesa-swrast-ci since adding the IRC channel.

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

3 years agofreedreno: Cooperate with tc to stop checking the BC for resource_busy().
Emma Anholt [Mon, 21 Jun 2021 19:31:14 +0000 (12:31 -0700)]
freedreno: Cooperate with tc to stop checking the BC for resource_busy().

The resource_busy() hook was having to check the batch cache for usage of
the resource, since TC didn't know how long our driver would.  By
committing to calling the tc_driver_internal_flush_notify() hook on
non-deferred flushes, TC keeps track of which buffers have been used but
not flushed and considers them busy, saving us needing to look in the BC
(which we won't be able to do once we move it to being per-context).

drawoverhead test results (all numbers are throughput, n=5):

   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change:      -4.94214% +/- 2.45047%
   7, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ vertex attrib change: 48.3992% +/- 5.02827%
   8, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 1 texture change:     26.0974% +/- 1.14932%
   9, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 8 textures change:    12.6963% +/- 3.01077%
  17, DrawElements ( 1 VBO| 8 UBO|  8 Tex) w/ 8 UBOs change:        54.3846% +/- 35.0049%

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

3 years agovk/util: add macros for multidraw
Mike Blumenkrantz [Tue, 30 Mar 2021 18:48:50 +0000 (14:48 -0400)]
vk/util: add macros for multidraw

this simplifies implementations since a lot of the code is going to be
copy/pasted around, enabling related tweaks to be made in a centralized place

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11496>

3 years agoradv: advertise extendedDynamicState2LogicOp
Samuel Pitoiset [Mon, 17 May 2021 08:42:03 +0000 (10:42 +0200)]
radv: advertise extendedDynamicState2LogicOp

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

3 years agoradv: implement dynamic logic op
Samuel Pitoiset [Mon, 17 May 2021 08:41:24 +0000 (10:41 +0200)]
radv: implement dynamic logic op

This is part of VK_EXT_extended_dynamic_state2.

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

3 years agoaco/gfx10: Emit barrier at the start of NGG VS and TES.
Timur Kristóf [Sat, 19 Jun 2021 12:36:15 +0000 (14:36 +0200)]
aco/gfx10: Emit barrier at the start of NGG VS and TES.

The Navi 1x NGG hardware can hang in certain conditions when
not every wave launched before s_sendmsg(GS_ALLOC_REQ).

As a workaround, to ensure this never happens, let's emit a
workgroup barrier at the beginning of NGG VS and TES.
Note that NGG GS already has a workgroup barrier so it doesn't
need this.

Cc: mesa-stable
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/10837>

3 years agoaco/gfx10: NGG zero output workaround for conservative rasterization.
Timur Kristóf [Mon, 17 May 2021 10:28:15 +0000 (12:28 +0200)]
aco/gfx10: NGG zero output workaround for conservative rasterization.

Navi 1x GPUs have an issue: they can hang when the output vertex
and primitive counts are zero. The workaround is exporting a dummy
triangle.

This commit changes the dummy triangle's vertex so its positions
are all NaN. This should make sure the triangle is never rendered.

Cc: mesa-stable
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/10837>

3 years agoradv/llvm: Emit s_barrier at the beginning of NGG non-GS shaders.
Timur Kristóf [Mon, 17 May 2021 12:00:58 +0000 (14:00 +0200)]
radv/llvm: Emit s_barrier at the beginning of NGG non-GS shaders.

This is to fix a hang that can potentially happen when not every
wave had launched when a gs_alloc_req is executed.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>

3 years agopanfrost: Add a Vulkan driver for Midgard/Bifrost GPUs
Boris Brezillon [Tue, 16 Jul 2019 17:20:49 +0000 (19:20 +0200)]
panfrost: Add a Vulkan driver for Midgard/Bifrost GPUs

Based on turnip.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11139>

3 years agopan/midg: Add a flag to dump internal shaders
Boris Brezillon [Mon, 17 May 2021 12:51:11 +0000 (14:51 +0200)]
pan/midg: Add a flag to dump internal shaders

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

3 years agopanfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer
Boris Brezillon [Thu, 6 May 2021 06:43:00 +0000 (08:43 +0200)]
panfrost: Make panfrost_scoreboard_initialize_tiler() return the job pointer

In the vulkan driver we need to patch job headers when re-submitting
an already submitted batch. Change panfrost_scoreboard_initialize_tiler()
prototype to allow that.

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

3 years agopanfrost: Constify the constants pointers passed to pan_blend functions
Boris Brezillon [Wed, 19 May 2021 07:49:28 +0000 (09:49 +0200)]
panfrost: Constify the constants pointers passed to pan_blend functions

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

3 years agoanv: adjust headers for non-GNU after e9e1e0362b6c
Jan Beich [Tue, 22 Jun 2021 00:29:40 +0000 (00:29 +0000)]
anv: adjust headers for non-GNU after e9e1e0362b6c

src/intel/vulkan/anv_device.c:27:10: fatal error: 'sys/sysmacros.h' file not found
 #include <sys/sysmacros.h>
          ^~~~~~~~~~~~~~~~~

Fixes: e9e1e036 ("anv: implement VK_EXT_physical_device_drm")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11516>

3 years agoradv: implement VK_EXT_physical_device_drm
Simon Ser [Fri, 8 Jan 2021 15:06:51 +0000 (16:06 +0100)]
radv: implement VK_EXT_physical_device_drm

This adds support for the Vulkan extension introduced in [1]. The
extension allows to get a VkPhysicalDevice's DRM node device IDs.

[1]: https://github.com/KhronosGroup/Vulkan-Docs/pull/1356

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8390>

3 years agozink: use multidraw
Mike Blumenkrantz [Wed, 20 Jan 2021 19:29:14 +0000 (14:29 -0500)]
zink: use multidraw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11498>

3 years agozink: support multidraw
Mike Blumenkrantz [Wed, 20 Jan 2021 19:23:20 +0000 (14:23 -0500)]
zink: support multidraw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11498>

3 years agozink: clear the fb clears array instead of freeing it on reset
Mike Blumenkrantz [Mon, 21 Jun 2021 15:25:04 +0000 (11:25 -0400)]
zink: clear the fb clears array instead of freeing it on reset

this cuts cpu usage by ~2% in sourcemark due to not reallocating the array
on every draw

Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11499>

3 years agozink: add more clear hooks
Mike Blumenkrantz [Fri, 18 Jun 2021 15:47:23 +0000 (11:47 -0400)]
zink: add more clear hooks

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

3 years agozink: add a flag for disabling conditional render during blit
Mike Blumenkrantz [Fri, 18 Jun 2021 15:55:54 +0000 (11:55 -0400)]
zink: add a flag for disabling conditional render during blit

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

3 years agospirv_to_nir: Add environment variable to change default log level
Charlie Turner [Thu, 17 Jun 2021 09:17:26 +0000 (10:17 +0100)]
spirv_to_nir: Add environment variable to change default log level

During dEQP runs for radv, I see a lot of warnings like,

ERROR - dEQP error: SPIR-V WARNING:
ERROR - dEQP error:     In file ../src/compiler/spirv/spirv_to_nir.c:1073
ERROR - dEQP error:     Decoration not allowed on struct members: SpvDecorationRestrict
ERROR - dEQP error:     408 bytes into the SPIR-V binary

This fails jobs on Gitlab, due to,

Job's log exceeded limit of 4194304 bytes.
Job execution will continue but no more output will be collected.

Since it doesn't seem feasible right now to fix the many shaders in
the VK-CTS triggering this warning, add an environment toggle that
allows test runners to only see the level of commentary they want.

v2 from Martin:
 - Add my SoB

v3 from Martin:
 - fix the indentation (suggested by Eric)
 - put the declarations at the top of the function

v4 from Martin:
 - make vtn_default_log_level() static (Marcin)
 - cache the default level in vtn_log (Marcin)
 - move vtn_log_level_strings inside vtn_default_log_level()
 - Fix the build issue on MSC

Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11491>

3 years agoradv: Provide a toggle to avoid warnings about unsupported devices.
Charlie Turner [Thu, 17 Jun 2021 11:43:27 +0000 (12:43 +0100)]
radv: Provide a toggle to avoid warnings about unsupported devices.

In the CI, we have such devices, and this message is printed many
hundreds of times. This results in a useless spam which makes it
difficult to see real issues.

v2 from Martin:
 - Reword the commit message a bit
 - Add a SoB

Signed-off-by: Martin Peres <martin.peres@mupuf.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Andres Gomez <agomez@igalia.com>
Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11491>

3 years agov3dv/build: meson infrastructure for multi-hw-version support
Alejandro Piñeiro [Wed, 9 Jun 2021 22:21:45 +0000 (00:21 +0200)]
v3dv/build: meson infrastructure for multi-hw-version support

We follow the same approach that v3d. We compile the files that
depends on the version several times, passing a different version each
time. We link all those per-version libs on the main library.

Note that right now we only support version == 42, so the array of
supported versions is one-sized.

Also note that although we were doing a previous work to split
hw-version dependant code from general code, this is the first commit
that only inject the current V3D_VERSION on the former.

We have two cases where we hardcode the V3D_VERSION (as a full
wrapping would be an overkill) that we need to include here to avoid
warnings/errors if we do that before or after.

Having some exceptions also happens on v3d. As we are here we add some
comment on v3d clarifying that.

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

3 years agov3dv: remove gen-dependant includes from v3dv_private
Alejandro Piñeiro [Fri, 28 May 2021 11:46:57 +0000 (13:46 +0200)]
v3dv: remove gen-dependant includes from v3dv_private

As we are here, we move the hooks for the packet definitions (used by
the broadcom packets helpers) to v3dv_cl

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

3 years agov3dv: don't use cl_packet_length for prepacked data
Alejandro Piñeiro [Tue, 1 Jun 2021 08:39:20 +0000 (10:39 +0200)]
v3dv: don't use cl_packet_length for prepacked data

cl_packet_length depends on the specific hw generation packets, so it
is can't be included directly by main header.

The straight forward solution would be to allocate them dynamically,
based on the current generation. That ended to be complex and
messy. Also, even if that change between hw versions, it will not
change significantly.

So we just add some definition with the size of the packets we
prepack. We just need to be careful that this needs to be the maximum
value considering all the versions supported.

Note that on Opengl v3d does something similar, using hardcoded
values, but without a define, neither a runtime check.

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

3 years agov3dv: split v3dv_descriptor hw version dependant to a new source file.
Alejandro Piñeiro [Tue, 1 Jun 2021 08:41:00 +0000 (10:41 +0200)]
v3dv: split v3dv_descriptor hw version dependant to a new source file.

As part of this, we get rid of the v3dv_xxx_descriptor structs to
v3dv_descriptor. The main reason is that in order to support several
versions, we would need to define them several times. Also, they were
somewhat an overkill even before, as their main advantage was getting
the offset for each data on the combined case. That functionality is
replaced with some new helpers.

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

3 years agov3dv: move several hw version dependant code to their own (v3dvx) source file
Alejandro Piñeiro [Mon, 14 Jun 2021 21:36:45 +0000 (23:36 +0200)]
v3dv: move several hw version dependant code to their own (v3dvx) source file

This includes code from:
  * v3dv_cmd_buffer
  * v3dv_meta_copy
  * v3dv_meta_clear

v2: move some of the functions to source files that makes more sense
now (Iago).

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

3 years agov3dv: split v3dv_device hw version dependant code to a new source file
Alejandro Piñeiro [Mon, 14 Jun 2021 21:36:08 +0000 (23:36 +0200)]
v3dv: split v3dv_device hw version dependant code to a new source file

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

3 years agov3dv: split v3dv_format hw version dependant code to a new source file
Alejandro Piñeiro [Mon, 14 Jun 2021 09:35:06 +0000 (11:35 +0200)]
v3dv: split v3dv_format hw version dependant code to a new source file

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

3 years agov3dv: split v3dv_image hw version dependant code to a new source file
Alejandro Piñeiro [Thu, 10 Jun 2021 12:43:54 +0000 (14:43 +0200)]
v3dv: split v3dv_image hw version dependant code to a new source file

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

3 years agov3dv: split v3dv_pipeline hw version dependant code to a new source file
Alejandro Piñeiro [Thu, 10 Jun 2021 12:17:55 +0000 (14:17 +0200)]
v3dv: split v3dv_pipeline hw version dependant code to a new source file

v2: merge some of the v3dvx entrypoints to general pack methods (Iago)

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

3 years agov3dv: start to move and wrap hw-version code with v3dv_queue
Alejandro Piñeiro [Thu, 10 Jun 2021 11:39:35 +0000 (13:39 +0200)]
v3dv: start to move and wrap hw-version code with v3dv_queue

The idea would be to move all the code that uses cl_emit,
cl_emit_with_prepack, v3dx_pack, and any enum/structure definition
defined on the v3d pack headers.

All those methods would be defined on v3dvx_private (that would be the
equivalent to v3dx_context.h on v3d).

This commit includes the definition of v3dX for the current version
supported (42), a function calling wrapper, and the move for v3dv_queue
methods as a reference.

About the function calling wrapper, I took the idea from anv. We don't
have on v3d, but we added it because we foresee that we will need that
functionality more often. So without that macro, in order to call the
correct version of the method from the general code we would need to
do like we do on v3d, and doing something like this:

            if (devinfo->ver >= 42)
                    return v3d42_pack_sampler_state(sampler, pCreateInfo);
            else
                    return v3d33_pack_sampler_state(sampler, pCreateInfo);

So with the macro we can just do this:
            v3dv_X(device, pack_sampler_state)(sampler, pCreateInfo).

Note that as mentioned, that is to be used on the general code, so a
runtime decision. If we are already on version-dependant code (so at
v3dx_queue for example) we just use v3dX, as at that point is a build
time decision.

Also, fwiw, I don't like too much the name of that macro, but I was
not able to think on a better one.

v2: merge job_emit_noop_bin and job_emit_noop_render (Iago)

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

3 years agov3dv/cmd_buffer: move cl_emit calls for Draw methods to helpers
Alejandro Piñeiro [Mon, 7 Jun 2021 22:19:55 +0000 (00:19 +0200)]
v3dv/cmd_buffer: move cl_emit calls for Draw methods to helpers

As we plan to move them to hw-dependant source files, but not the main
entrypoint.

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

3 years agov3dv/cmd_buffer: add helper job_emit_binning_prolog
Alejandro Piñeiro [Wed, 2 Jun 2021 11:53:31 +0000 (13:53 +0200)]
v3dv/cmd_buffer: add helper job_emit_binning_prolog

Just to isolate more tightly cl_emit calls. That would make easier to
split v3dv_cmd_buffer.

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

3 years agov3dv: rename v3dv_pack for v3dvx_pack
Alejandro Piñeiro [Fri, 4 Jun 2021 09:27:49 +0000 (11:27 +0200)]
v3dv: rename v3dv_pack for v3dvx_pack

For consistency, as we use use the v3dvx convention to point that it
depends on the hw version. Also on OpenGL the equivalent macro is
v3dx_pack.

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

3 years agoi965: fix regression in pipe control on g45
Dave Airlie [Tue, 22 Jun 2021 07:00:41 +0000 (17:00 +1000)]
i965: fix regression in pipe control on g45

The cleanups got the wrong value here, just noticed in drive by.

Fixes: b505db3864b0 ("intel: Simplify few version checks involving G4X")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11519>

3 years agowgl: remove hard limit on pixelformats
Erik Faye-Lund [Thu, 17 Jun 2021 11:46:42 +0000 (13:46 +0200)]
wgl: remove hard limit on pixelformats

Zink on Intel's Windows driver supports more than 256 pixelformats,
triggering asserts. So let's get rid of the hard-coded limit, and
instead use u_dynarray to store the pixelformat info.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11447>

3 years agoac/perfcounters: add a GPU block ID to every block definitions
Samuel Pitoiset [Mon, 31 May 2021 14:32:57 +0000 (16:32 +0200)]
ac/perfcounters: add a GPU block ID to every block definitions

The enumeration comes from AMDVLK.

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

3 years agoac/perfcounters: add more SPM configuration fields
Samuel Pitoiset [Fri, 4 Jun 2021 11:26:09 +0000 (13:26 +0200)]
ac/perfcounters: add more SPM configuration fields

Add the number of SPM wires because sometimes a block has eg.
2 counters but only holds 3 16-bit counters instead of 4.

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

3 years agoac/perfcounters: rename num_multi to num_spm_counters
Samuel Pitoiset [Fri, 4 Jun 2021 10:17:56 +0000 (12:17 +0200)]
ac/perfcounters: rename num_multi to num_spm_counters

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

3 years agoac/perfcounters,radeonsi: rework performance counters layout
Samuel Pitoiset [Fri, 4 Jun 2021 07:59:59 +0000 (09:59 +0200)]
ac/perfcounters,radeonsi: rework performance counters layout

Instead of having different layouts which might complicate things when
some registers are missing, hardcode the SELECT and SELECT1 registers
into separate arrays.

The SELECT registers are "legacy" counters, while the SELECT1 registers
are SPM counters.

This is more verbose and emit more UCONFIG registers, but emitting the
SELECT registers is now much simpler and it seems less error prone.
This will also help emitting the SPM configuration.

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

3 years agoac/perfcounters: remove ac_pc_block_base::num_prelude
Samuel Pitoiset [Fri, 4 Jun 2021 06:55:17 +0000 (08:55 +0200)]
ac/perfcounters: remove ac_pc_block_base::num_prelude

This seems unnecessary if the first select register is correctly set.
This CB filter was always disabled anyways.

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

3 years agoanv: provide dummy vkCmdSetPatchControlPointsEXT
Tapani Pälli [Mon, 21 Jun 2021 16:50:36 +0000 (19:50 +0300)]
anv: provide dummy vkCmdSetPatchControlPointsEXT

This makes dEQP-VK.api.version_check.entry_points pass and matches how
other drivers are handling this case. We do not support the feature but
still need to provide a dummy entrypoint.

v2: throw error if/when called (Jason)

Fixes: 0d031d1da34 ("anv: toggle on VK_EXT_extended_dynamic_state2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11503>

3 years agollvmpipe: Add handle export for resource_get_param
Daniel Stone [Mon, 21 Jun 2021 18:44:01 +0000 (19:44 +0100)]
llvmpipe: Add handle export for resource_get_param

mesa/mesa@2dcc9c7f54ed from mesa/mesa!6639 added a resource_get_param
hook for llvmpipe, which was nice since it gave lavapipe more features.
One of those features was not exporting llvmpipe textures, so those
parts were stubbed out and landed in an assert(0).

This completely broke kms_swrast (llvmpipe+GBM) on non-release builds,
since that definitely does need to export llvmpipe textures.

The query codepath which caused this explosion does fall back to
resource_get_handle() - which is how it worked previously - but not all
callers do this, so just do what all other drivers implementing
resource_get_param() do and open-code the translation.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reported-by: Jonas Ådahl <jadahl@gmail.com>
Tested-by: Jonas Ådahl <jadahl@gmail.com>
Fixes: 2dcc9c7f54ed ("llvmpipe: add resource get param support.")
Ref: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6639
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11504>

3 years agodocs,isl: Document Sandy Bridge HiZ/stencil
Jason Ekstrand [Mon, 21 Jun 2021 15:25:41 +0000 (10:25 -0500)]
docs,isl: Document Sandy Bridge HiZ/stencil

This is annoying and tricky and we don't have all the gory details
written down in one central place anywhere.  Add a docs section on it.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11500>

3 years agonir: Add raytracing shader call lowering pass.
Bas Nieuwenhuizen [Tue, 16 Feb 2021 01:37:40 +0000 (02:37 +0100)]
nir: Add raytracing shader call lowering pass.

Really copying Jason's pass.

Changes:
- Instead of all the intel lowering introduce rt_{execute_callable,trace_ray,resume}
- Add the ability to use scratch intrinsics directly.

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

3 years agonir: Add lowered vendor independent raytracing intrinsics.
Bas Nieuwenhuizen [Tue, 20 Apr 2021 01:45:22 +0000 (03:45 +0200)]
nir: Add lowered vendor independent raytracing intrinsics.

For use in a generic nir_lower_shader_calls.

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

3 years agofreedreno: Handle full blit discards by invalidating the resource.
Emma Anholt [Thu, 17 Jun 2021 16:50:15 +0000 (09:50 -0700)]
freedreno: Handle full blit discards by invalidating the resource.

The previous implementation had several issues:

- It wasn't checking all the conditions necessary for "this blit updates
  the whole surface", like PIPE_MASK_Z but not S on a depth/stencil
  buffer.
- It would reset the previous batchbuffer, even if that batch had side
  effects on other buffers.
- The layering was painful to follow and made any recursion extra
  dangerous.

Now, we use a more conservative test (enough for the resource shadowing
case) and just invalidate the buffer up front, which should have the right
logic for discarding drawing to that resource.

I found I had to add fd_bc_flush_writer() to the end of fd_blitter_blit()
-- a flush was happening at fb state restore time when the discard flag
was set, and losing that flush breaks
dEQP-GLES31.functional.stencil_texturing.format.stencil_index8_cube.

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

3 years agofreedreno: Move the rsc-based batch flushing to helper functions.
Emma Anholt [Tue, 15 Jun 2021 18:17:27 +0000 (11:17 -0700)]
freedreno: Move the rsc-based batch flushing to helper functions.

I want to reuse these, and this gives them nice names.

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

3 years agogallium/util: Introduce a helper for finding whole-resource blits.
Emma Anholt [Thu, 17 Jun 2021 16:33:24 +0000 (09:33 -0700)]
gallium/util: Introduce a helper for finding whole-resource blits.

This can be useful for tilers to discard previous rendering to a buffer
instead of reloading before drawing all the pixels.

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

3 years agogallium/draw: Garbage collect draw_pt_fetch_emit.
Emma Anholt [Wed, 16 Jun 2021 05:29:15 +0000 (22:29 -0700)]
gallium/draw: Garbage collect draw_pt_fetch_emit.

Now that we don't have draw_set_force_passthrough(), this middle end was
inaccessible.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11410>

3 years agogallium/draw: Garbage collect draw_set_force_passthrough
Emma Anholt [Wed, 16 Jun 2021 05:25:12 +0000 (22:25 -0700)]
gallium/draw: Garbage collect draw_set_force_passthrough

Introduced in c48da7d78b4e ("draw: add switch for drivers to force vertex
data passthrough") in 2008 and never used.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11410>

3 years agodocs/envvars: document MESA_VK_WSI_PRESENT_MODE
Simon Ser [Thu, 17 Jun 2021 08:23:24 +0000 (10:23 +0200)]
docs/envvars: document MESA_VK_WSI_PRESENT_MODE

This env var was introduced in a182adfd83ad ("wsi: allow to override the
present mode with MESA_VK_WSI_PRESENT_MODE").

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11441>

3 years agovulkan/wsi/wayland: simplify wl_surface version check
Simon Ser [Wed, 16 Jun 2021 12:33:57 +0000 (14:33 +0200)]
vulkan/wsi/wayland: simplify wl_surface version check

No need to cast to a wl_proxy, there is a wl_surface variant
available.

No need to cache the result of get_version(), this is just a
one-line getter and doesn't perform any roundtrip.

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11420>

3 years agointel/gen125.xml: Drop GPGPU_WALKER
Jordan Justen [Mon, 21 Jun 2021 01:10:02 +0000 (18:10 -0700)]
intel/gen125.xml: Drop GPGPU_WALKER

Ref: f4902bb189c ("intel/genxml,anv,iris: Drop the legacy compute path from gen125.xml")
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/11489>

3 years agoanv: implement VK_EXT_physical_device_drm
Lionel Landwerlin [Fri, 22 Jan 2021 10:38:41 +0000 (12:38 +0200)]
anv: implement VK_EXT_physical_device_drm

v2: add docs
    update error messages (Sagar)

v3: Use fstat() (Jason)

v4: Do fstat() on demand (Jason)

v5: clear major/minor values if not present (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8649>

3 years agoradeonsi: cleanup some primitive discard CS TODOs regarding instancing, etc.
Marek Olšák [Tue, 1 Jun 2021 04:18:51 +0000 (00:18 -0400)]
radeonsi: cleanup some primitive discard CS TODOs regarding instancing, etc.

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

3 years agoradeonsi: skip buffer_atomic_add(ptr, n) when n=0 in the prim discard CS
Marek Olšák [Tue, 1 Jun 2021 04:35:34 +0000 (00:35 -0400)]
radeonsi: skip buffer_atomic_add(ptr, n) when n=0 in the prim discard CS

This improves performance of the shader nicely.

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

3 years agoradeonsi: drop support for triangle fans from the prim discard CS
Marek Olšák [Mon, 31 May 2021 23:21:28 +0000 (19:21 -0400)]
radeonsi: drop support for triangle fans from the prim discard CS

because it doesn't implement triangle fan splitting, so it's incomplete

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

3 years agoradeonsi: drop gfx7 support from the prim discard CS to simplify code
Marek Olšák [Mon, 31 May 2021 22:32:52 +0000 (18:32 -0400)]
radeonsi: drop gfx7 support from the prim discard CS to simplify code

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

3 years agoradeonsi: remove the Z culling option from the primitive discard CS
Marek Olšák [Mon, 31 May 2021 00:29:29 +0000 (20:29 -0400)]
radeonsi: remove the Z culling option from the primitive discard CS

Not useful.

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

3 years agoradeonsi: don't compile TES and GS draw_vbo variants for the prim discard CS
Marek Olšák [Mon, 24 May 2021 19:43:54 +0000 (15:43 -0400)]
radeonsi: don't compile TES and GS draw_vbo variants for the prim discard CS

This also fixes the incorrect emit_draw_packets template argument.
The condition should be inverted.

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

3 years agoradeonsi: try to keep all VS input loads together for better perf
Marek Olšák [Mon, 24 May 2021 23:42:17 +0000 (19:42 -0400)]
radeonsi: try to keep all VS input loads together for better perf

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

3 years agoradeonsi: remove incorrect comment about PA
Marek Olšák [Mon, 24 May 2021 23:14:18 +0000 (19:14 -0400)]
radeonsi: remove incorrect comment about PA

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

3 years agoradeonsi: set more precise max_waves in NGG code
Marek Olšák [Mon, 24 May 2021 21:23:56 +0000 (17:23 -0400)]
radeonsi: set more precise max_waves in NGG code

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

3 years agoradeonsi: merge 2 conditional blocks with same condition into 1 in culling code
Marek Olšák [Tue, 11 May 2021 15:47:10 +0000 (11:47 -0400)]
radeonsi: merge 2 conditional blocks with same condition into 1 in culling code

The block only loads input VGPRs from LDS, and the next block uses them.
The entering condition is the same, even though the second block is
the next shader part beginning with the prolog.

Simply move the VGPR loads into the prolog.

This decreases the shader code size by 12 bytes.

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

3 years agoradeonsi: restructure si_get_vs_vgpr_comp_cnt for readability
Marek Olšák [Tue, 11 May 2021 04:40:39 +0000 (00:40 -0400)]
radeonsi: restructure si_get_vs_vgpr_comp_cnt for readability

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

3 years agofreedreno: Flush if at risk of overflowing bos table
Rob Clark [Sun, 20 Jun 2021 18:39:03 +0000 (11:39 -0700)]
freedreno: Flush if at risk of overflowing bos table

Fixes overflow crash in tex-miplevel-selection

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

3 years agofreedreno/a6xx: Handle fb_read in sysmem path
Rob Clark [Sun, 20 Jun 2021 15:58:42 +0000 (08:58 -0700)]
freedreno/a6xx: Handle fb_read in sysmem path

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

3 years agofreedreno/ci: Garbage collect some a630 flakes
Rob Clark [Sun, 20 Jun 2021 14:47:54 +0000 (07:47 -0700)]
freedreno/ci: Garbage collect some a630 flakes

Haven't seen these, at least since flake reporting switched to OFTC
channel (~1 month ago)

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

3 years agogallium/tools: improve handling of pointer arrays
Matti Hamalainen [Mon, 31 May 2021 12:32:01 +0000 (15:32 +0300)]
gallium/tools: improve handling of pointer arrays

Extend the special handling of return types to also include pointer
type array list elements, so we ignore the initial "name" of the
element until we know a better type for them. This improves the type
"detection" of such pointer array elements when parsing the logs
with dump.py / tracediff.sh

Related to Mesa issue #4609

Signed-off-by: Matti Hamalainen <ccr@tnsp.org>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11492>

3 years agoradv: allow VK_FORMAT_R8G8_SRGB sampling
Rhys Perry [Fri, 11 Jun 2021 09:51:52 +0000 (10:51 +0100)]
radv: allow VK_FORMAT_R8G8_SRGB sampling

No reason why we can't do this. AMDVLK also allows this.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11317>

3 years agonir: Document all the ALU opcodes
Jason Ekstrand [Fri, 18 Jun 2021 13:17:14 +0000 (08:17 -0500)]
nir: Document all the ALU opcodes

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11438>

3 years agonir,docs: Add docs for NIR ALU instructions
Jason Ekstrand [Fri, 18 Jun 2021 13:16:18 +0000 (08:16 -0500)]
nir,docs: Add docs for NIR ALU instructions

About half or more of the text here is actually from Connor Abbot.  I've
edited it a bit to bring it up-to-date and make a few things more clear.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11438>

3 years agonir: Require vectorized ALU ops to be all-or-nothing
Jason Ekstrand [Thu, 17 Jun 2021 15:32:34 +0000 (10:32 -0500)]
nir: Require vectorized ALU ops to be all-or-nothing

Long ago, the semantics of bcsel were such that it took a single boolean
value and selected between whole vectors.  These days, it takes a vector
boolean with the assumption that if you want the old behavior you can
just use a .xxxx swizzle.  There currently are no opcodes which use a
output_size of 0 but have a scalar or fixed-vector input.  Let's
disallow it for now to force us to think through the semantics again if
this ever comes up as something someone actually wants.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11438>

3 years agonir/propagate_invariant: add invariant_prim option
Rhys Perry [Wed, 13 Jan 2021 15:50:52 +0000 (15:50 +0000)]
nir/propagate_invariant: add invariant_prim option

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11035>

3 years agozink: handle custom border color without matching wrap mode case
Mike Blumenkrantz [Mon, 21 Jun 2021 13:49:18 +0000 (09:49 -0400)]
zink: handle custom border color without matching wrap mode case

this is just default border color and the custom color is ignored

Fixes: 36f4e61403a ("zink: rework border color handling")

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

3 years agovulkan: Update the XML and headers to 1.2.182
Jason Ekstrand [Mon, 21 Jun 2021 14:05:23 +0000 (09:05 -0500)]
vulkan: Update the XML and headers to 1.2.182

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11497>

3 years agonir,vc4: Suffix a bunch of unorm 4x8 opcodes _vc4
Jason Ekstrand [Fri, 18 Jun 2021 14:28:59 +0000 (09:28 -0500)]
nir,vc4: Suffix a bunch of unorm 4x8 opcodes _vc4

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11463>

3 years agonir,panfrost: Suffix fsat_signed and fclamp_pos with _mali
Jason Ekstrand [Fri, 18 Jun 2021 14:21:07 +0000 (09:21 -0500)]
nir,panfrost: Suffix fsat_signed and fclamp_pos with _mali

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

3 years agonir,amd: Suffix nir_op_cube_face_coord/index with _amd
Jason Ekstrand [Fri, 18 Jun 2021 14:17:01 +0000 (09:17 -0500)]
nir,amd: Suffix nir_op_cube_face_coord/index with _amd

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

3 years agoaco: Fix checking if load_shared is used by cross lane instructions.
Timur Kristóf [Mon, 14 Jun 2021 15:31:33 +0000 (17:31 +0200)]
aco: Fix checking if load_shared is used by cross lane instructions.

This commit fixes two issues with it:

1. Prevent it from going into an infinite loop.
2. Check all uses, not just first use.

Closes: #4916
Fixes: b4e22eb4822d74a6e981c629ddff9bcd29b9a0ec
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11361>

3 years agoci: use bash with download-git-cache.sh
Andres Gomez [Fri, 26 Mar 2021 22:56:46 +0000 (00:56 +0200)]
ci: use bash with download-git-cache.sh

It's a bash script, so make sure we use bash and not just sh.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9865>

3 years agoutil/fossilize_db: Only lock the db file, not the index.
Bas Nieuwenhuizen [Sat, 19 Jun 2021 23:15:29 +0000 (01:15 +0200)]
util/fossilize_db: Only lock the db file, not the index.

This thing is entirely opt-in wrt caring about it when writing to
a file anyway. Since we also lock the two at the same time and they
have an 1-1 relation we can just lock one of the two files. Saves
some syscalls.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11485>

3 years agoutil/fossilize_db: Do not lock the fossilize db permanently.
Bas Nieuwenhuizen [Sat, 19 Jun 2021 23:06:53 +0000 (01:06 +0200)]
util/fossilize_db: Do not lock the fossilize db permanently.

This avoids all locks for reads and using lock only while actually
writing.

This is enabled by doing two things:

1) Reading the index incrementally. This way we get new entries
   written by other processes and do not write duplicate entries.
2) Taking the lock only during writes, and applying the incremental
   read while holding the lock so we always append to the actual end of the file.

Fixes: eca6bb9540d ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11485>

3 years agoutil/fossilize_db: Split out reading the index.
Bas Nieuwenhuizen [Sat, 19 Jun 2021 17:51:09 +0000 (19:51 +0200)]
util/fossilize_db: Split out reading the index.

Fixes: eca6bb9540d ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11485>